issue

package
v1.22.6 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 35 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAssigneeIfNotAssigned added in v1.11.0

func AddAssigneeIfNotAssigned(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, assigneeID int64, notify bool) (comment *issues_model.Comment, 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 added in v1.11.0

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

AddLabel adds a new label to the issue.

func AddLabels added in v1.11.0

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

AddLabels adds a list of new labels to the issue.

func CanDoerChangeReviewRequests added in v1.22.0

func CanDoerChangeReviewRequests(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, posterID int64) bool

CanDoerChangeReviewRequests returns if the doer can add/remove review requests of a PR

func ChangeContent added in v1.11.0

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

ChangeContent changes issue content, as the given user.

func ChangeIssueRef added in v1.13.0

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 added in v1.11.0

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

ChangeMilestoneAssign changes assignment of milestone for issue.

func ChangeStatus added in v1.11.0

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

ChangeStatus changes issue status to open or closed. closed means the target status Fix me: you should check whether the current issue status is same to the target status before call this function as in function changeIssueStatus we will return WasClosedError, even the issue status and target status are both open

func ChangeTitle

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

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

func ClearLabels added in v1.11.0

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

ClearLabels clears all of an issue's labels

func CreateCommentReaction added in v1.22.0

func CreateCommentReaction(ctx context.Context, doer *user_model.User, comment *issues_model.Comment, content string) (*issues_model.Reaction, error)

CreateCommentReaction creates a reaction on a comment.

func CreateIssueComment added in v1.17.4

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 CreateIssueReaction added in v1.22.0

func CreateIssueReaction(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, content string) (*issues_model.Reaction, error)

CreateIssueReaction creates a reaction on an issue.

func CreateRefComment added in v1.17.4

func CreateRefComment(ctx context.Context, 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 added in v1.17.4

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

DeleteComment deletes the comment

func DeleteIssue added in v1.17.0

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

DeleteIssue deletes an issue

func DeleteNotPassedAssignee added in v1.11.0

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 added in v1.20.0

func GetDefaultTemplateConfig() api.IssueConfig

func GetRefEndNamesAndURLs added in v1.12.0

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 added in v1.20.0

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 added in v1.20.0

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 HasTemplatesOrContactLinks(repo *repo.Repository, gitRepo *git.Repository) bool

func IsTemplateConfig added in v1.20.0

func IsTemplateConfig(path string) bool

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

func IsValidReviewRequest added in v1.14.0

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 added in v1.14.0

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, projectID int64) error

NewIssue creates new issue with labels for repository.

func ParseTemplatesFromDefaultBranch added in v1.21.6

func ParseTemplatesFromDefaultBranch(repo *repo.Repository, gitRepo *git.Repository) (ret struct {
	IssueTemplates []*api.IssueTemplate
	TemplateErrors map[string]error
},
)

ParseTemplatesFromDefaultBranch parses the issue templates in the repo's default branch, returns valid templates and the errors of invalid template files (the errors map is guaranteed to be non-nil).

func RemoveLabel added in v1.11.0

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

RemoveLabel removes a label from issue by given ID.

func ReplaceLabels added in v1.11.2

func ReplaceLabels(ctx context.Context, 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 added in v1.12.0

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 ReviewRequestNotify added in v1.21.9

func ReviewRequestNotify(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, reviewNotifiers []*ReviewRequestNotifier)

func TeamReviewRequest added in v1.13.0

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 ToggleAssigneeWithNotify added in v1.20.3

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

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

func UpdateAssignees added in v1.11.0

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 added in v1.17.4

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

UpdateComment updates information of comment.

func UpdateIssuesCommit added in v1.15.7

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

UpdateIssuesCommit checks if issues are manipulated by commit message.

Types

type ReviewRequestNotifier added in v1.21.9

type ReviewRequestNotifier struct {
	Comment    *issues_model.Comment
	IsAdd      bool
	Reviewer   *user_model.User
	ReviewTeam *org_model.Team
}

func PullRequestCodeOwnersReview added in v1.21.9

func PullRequestCodeOwnersReview(ctx context.Context, issue *issues_model.Issue, pr *issues_model.PullRequest) ([]*ReviewRequestNotifier, error)

Jump to

Keyboard shortcuts

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