issue

package
v0.19.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAssigneeIfNotAssigned

func AddAssigneeIfNotAssigned(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, assigneeID int64) (err error)

AddAssigneeIfNotAssigned adds an assignee only if he isn't already assigned to the issue. Also checks for access of assigned user

func AddLabel

func AddLabel(issue *issues_model.Issue, doer *user_model.User, label *issues_model.Label) error

AddLabel adds a new label to the issue.

func AddLabels

func AddLabels(issue *issues_model.Issue, doer *user_model.User, labels []*issues_model.Label) error

AddLabels adds a list of new labels to the issue.

func ChangeContent

func ChangeContent(issue *issues_model.Issue, doer *user_model.User, content string) (err error)

ChangeContent changes issue content, as the given user.

func ChangeIssueRef

func ChangeIssueRef(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, ref string) error

ChangeIssueRef changes the branch of this issue, as the given user.

func ChangeMilestoneAssign

func ChangeMilestoneAssign(issue *issues_model.Issue, doer *user_model.User, oldMilestoneID int64) (err error)

ChangeMilestoneAssign changes assignment of milestone for issue.

func ChangeStatus

func ChangeStatus(issue *issues_model.Issue, doer *user_model.User, commitID string, closed bool) error

ChangeStatus changes issue status to open or closed.

func ChangeTitle

func ChangeTitle(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, title string) (err error)

ChangeTitle changes the title of this issue, as the given user.

func ClearLabels

func ClearLabels(issue *issues_model.Issue, doer *user_model.User) (err error)

ClearLabels clears all of an issue's labels

func CreateComment

func CreateComment(ctx context.Context, opts *issues_model.CreateCommentOptions) (comment *issues_model.Comment, err error)

CreateComment creates comment of issue or commit.

func CreateIssueComment

func CreateIssueComment(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, issue *issues_model.Issue, content string, attachments []string) (*issues_model.Comment, error)

CreateIssueComment creates a plain issue comment.

func CreateRefComment

func CreateRefComment(doer *user_model.User, repo *repo_model.Repository, issue *issues_model.Issue, content, commitSHA string) error

CreateRefComment creates a commit reference comment to issue.

func DeleteComment

func DeleteComment(ctx context.Context, doer *user_model.User, comment *issues_model.Comment) error

DeleteComment deletes the comment

func DeleteIssue

func DeleteIssue(ctx context.Context, doer *user_model.User, gitRepo *git.Repository, issue *issues_model.Issue) error

DeleteIssue deletes an issue

func DeleteNotPassedAssignee

func DeleteNotPassedAssignee(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, assignees []*user_model.User) (err error)

DeleteNotPassedAssignee deletes all assignees who aren't passed via the "assignees" array

func GetDefaultTemplateConfig

func GetDefaultTemplateConfig() api.IssueConfig

func GetRefEndNamesAndURLs

func GetRefEndNamesAndURLs(issues []*issues_model.Issue, repoLink string) (map[int64]string, map[int64]string)

GetRefEndNamesAndURLs retrieves the ref end names (e.g. refs/heads/branch-name -> branch-name) and their respective URLs.

func GetTemplateConfig

func GetTemplateConfig(gitRepo *git.Repository, path string, commit *git.Commit) (api.IssueConfig, error)

GetTemplateConfig loads the given issue config file. It never returns a nil config.

func GetTemplateConfigFromDefaultBranch

func GetTemplateConfigFromDefaultBranch(repo *repo.Repository, gitRepo *git.Repository) (api.IssueConfig, error)

GetTemplateConfigFromDefaultBranch returns the issue config for this repo. It never returns a nil config.

func GetTemplatesFromDefaultBranch

func GetTemplatesFromDefaultBranch(repo *repo.Repository, gitRepo *git.Repository) ([]*api.IssueTemplate, map[string]error)

GetTemplatesFromDefaultBranch checks for issue templates in the repo's default branch, returns valid templates and the errors of invalid template files.

func HasTemplatesOrContactLinks(repo *repo.Repository, gitRepo *git.Repository) bool

func IsTemplateConfig

func IsTemplateConfig(path string) bool

IsTemplateConfig returns if the given path is a issue config file.

func IsValidReviewRequest

func IsValidReviewRequest(ctx context.Context, reviewer, doer *user_model.User, isAdd bool, issue *issues_model.Issue, permDoer *access_model.Permission) error

IsValidReviewRequest Check permission for ReviewRequest

func IsValidTeamReviewRequest

func IsValidTeamReviewRequest(ctx context.Context, reviewer *organization.Team, doer *user_model.User, isAdd bool, issue *issues_model.Issue) error

IsValidTeamReviewRequest Check permission for ReviewRequest Team

func NewIssue

func NewIssue(ctx context.Context, repo *repo_model.Repository, issue *issues_model.Issue, labelIDs []int64, uuids []string, assigneeIDs []int64) error

NewIssue creates new issue with labels for repository.

func RemoveLabel

func RemoveLabel(issue *issues_model.Issue, doer *user_model.User, label *issues_model.Label) error

RemoveLabel removes a label from issue by given ID.

func ReplaceLabels

func ReplaceLabels(issue *issues_model.Issue, doer *user_model.User, labels []*issues_model.Label) error

ReplaceLabels removes all current labels and add new labels to the issue.

func ReviewRequest

func ReviewRequest(ctx context.Context, issue *issues_model.Issue, doer, reviewer *user_model.User, isAdd bool) (comment *issues_model.Comment, err error)

ReviewRequest add or remove a review request from a user for this PR, and make comment for it.

func TeamReviewRequest

func TeamReviewRequest(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, reviewer *organization.Team, isAdd bool) (comment *issues_model.Comment, err error)

TeamReviewRequest add or remove a review request from a team for this PR, and make comment for it.

func ToggleAssignee

func ToggleAssignee(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, assigneeID int64) (removed bool, comment *issues_model.Comment, err error)

ToggleAssignee changes a user between assigned and not assigned for this issue, and make issue comment for it.

func UpdateAssignees

func UpdateAssignees(ctx context.Context, issue *issues_model.Issue, oneAssignee string, multipleAssignees []string, doer *user_model.User) (err error)

UpdateAssignees is a helper function to add or delete one or multiple issue assignee(s) Deleting is done the GitHub way (quote from their api documentation): https://developer.github.com/v3/issues/#edit-an-issue "assignees" (array): Logins for Users to assign to this issue. Pass one or more user logins to replace the set of assignees on this Issue. Send an empty array ([]) to clear all assignees from the Issue.

func UpdateComment

func UpdateComment(ctx context.Context, c *issues_model.Comment, doer *user_model.User, oldContent string) error

UpdateComment updates information of comment.

func UpdateIssuesCommit

func UpdateIssuesCommit(doer *user_model.User, repo *repo_model.Repository, commits []*repository.PushCommit, branchName string) error

UpdateIssuesCommit checks if issues are manipulated by commit message.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL