Documentation
¶
Index ¶
- Constants
- Variables
- func AddDeletePRBranchComment(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, ...) error
- func BuildLabelNamesIssueIDsCondition(labelNames []string) *builder.Builder
- func CanMaintainerWriteToBranch(ctx context.Context, p access_model.Permission, branch string, ...) bool
- func CanMarkConversation(ctx context.Context, issue *Issue, doer *user_model.User) (permResult bool, err error)
- func CancelStopwatch(ctx context.Context, user *user_model.User, issue *Issue) (ok bool, err error)
- func ChangeIssueContent(ctx context.Context, issue *Issue, doer *user_model.User, content string, ...) (err error)
- func ChangeIssueRef(ctx context.Context, issue *Issue, doer *user_model.User, oldRef string) (err error)
- func ChangeIssueTimeEstimate(ctx context.Context, issue *Issue, doer *user_model.User, timeEstimate int64) error
- func ChangeIssueTitle(ctx context.Context, issue *Issue, doer *user_model.User, oldTitle string) (err error)
- func ChangeMilestoneStatus(ctx context.Context, m *Milestone, isClosed bool) (err error)
- func ChangeMilestoneStatusByRepoIDAndID(ctx context.Context, repoID, milestoneID int64, isClosed bool) error
- func CheckIssueWatch(ctx context.Context, user *user_model.User, issue *Issue) (bool, error)
- func ClearIssueLabels(ctx context.Context, issue *Issue, doer *user_model.User) (err error)
- func CommentHashTag(id int64) string
- func CommentTypeIsRef(t CommentType) bool
- func CountCommentTypeLabelWithEmptyLabel(ctx context.Context) (int64, error)
- func CountCommentTypeLabelWithOutsideLabels(ctx context.Context) (int64, error)
- func CountComments(ctx context.Context, opts *FindCommentsOptions) (int64, error)
- func CountIssueLabelWithOutsideLabels(ctx context.Context) (int64, error)
- func CountIssueWatchers(ctx context.Context, issueID int64) (int64, error)
- func CountIssues(ctx context.Context, opts *IssuesOptions, otherConds ...builder.Cond) (int64, error)
- func CountIssuesByRepo(ctx context.Context, opts *IssuesOptions) (map[int64]int64, error)
- func CountLabelsByOrgID(ctx context.Context, orgID int64) (int64, error)
- func CountLabelsByRepoID(ctx context.Context, repoID int64) (int64, error)
- func CountMilestonesMap(ctx context.Context, opts FindMilestoneOptions) (map[int64]int64, error)
- func CountOrphanedIssueLabels(ctx context.Context) (int64, error)
- func CountOrphanedIssues(ctx context.Context) (int64, error)
- func CountOrphanedLabels(ctx context.Context) (int64, error)
- func CountReviews(ctx context.Context, opts FindReviewOptions) (int64, error)
- func CountTrackedTimes(ctx context.Context, opts *FindTrackedTimesOptions) (int64, error)
- func CountUserStopwatches(ctx context.Context, userID int64) (int64, error)
- func CreateIssueDependency(ctx context.Context, user *user_model.User, issue, dep *Issue) error
- func CreateIssueStopwatch(ctx context.Context, user *user_model.User, issue *Issue) (ok bool, err error)
- func CreateOrUpdateIssueWatch(ctx context.Context, userID, issueID int64, isWatching bool) error
- func DecrRepoIssueNumbers(ctx context.Context, repoID int64, isPull, includeTotal, includeClosed bool) error
- func DeleteComment(ctx context.Context, comment *Comment) error
- func DeleteCommentReaction(ctx context.Context, doerID, issueID, commentID int64, content string) error
- func DeleteIssueLabel(ctx context.Context, issue *Issue, label *Label, doer *user_model.User) error
- func DeleteIssueReaction(ctx context.Context, doerID, issueID int64, content string) error
- func DeleteIssueUserTimes(ctx context.Context, issue *Issue, user *user_model.User) error
- func DeleteLabel(ctx context.Context, id, labelID int64) error
- func DeleteLabelsByRepoID(ctx context.Context, repoID int64) error
- func DeleteMilestoneByRepoID(ctx context.Context, repoID, id int64) error
- func DeleteOrphanedIssueLabels(ctx context.Context) error
- func DeleteOrphanedLabels(ctx context.Context) error
- func DeletePullsByBaseRepoID(ctx context.Context, repoID int64) error
- func DeleteReaction(ctx context.Context, opts *ReactionOptions) error
- func DeleteReview(ctx context.Context, r *Review) error
- func DeleteTime(ctx context.Context, t *TrackedTime) error
- func DismissReview(ctx context.Context, review *Review, isDismiss bool) (err error)
- func FindAndUpdateIssueMentions(ctx context.Context, issue *Issue, doer *user_model.User, content string) (mentions []*user_model.User, err error)
- func FinishIssueStopwatch(ctx context.Context, user *user_model.User, issue *Issue) (ok bool, err error)
- func FixCommentTypeLabelWithEmptyLabel(ctx context.Context) (int64, error)
- func FixCommentTypeLabelWithOutsideLabels(ctx context.Context) (int64, error)
- func FixIssueLabelWithOutsideLabels(ctx context.Context) (int64, error)
- func GetAssigneeIDsByIssue(ctx context.Context, issueID int64) ([]int64, error)
- func GetGrantedApprovalsCount(ctx context.Context, protectBranch *git_model.ProtectedBranch, pr *PullRequest) int64
- func GetIssueIDsByRepoID(ctx context.Context, repoID int64) ([]int64, error)
- func GetIssueMentionIDs(ctx context.Context, issueID int64) ([]int64, error)
- func GetIssueTotalTrackedTime(ctx context.Context, opts *IssuesOptions, isClosed optional.Option[bool]) (int64, error)
- func GetIssueWatchersIDs(ctx context.Context, issueID int64, watching bool) ([]int64, error)
- func GetLabelIDsByNames(ctx context.Context, labelNames []string) ([]int64, error)
- func GetLabelIDsInOrgByNames(ctx context.Context, orgID int64, labelNames []string) ([]int64, error)
- func GetLabelIDsInRepoByNames(ctx context.Context, repoID int64, labelNames []string) ([]int64, error)
- func GetMilestoneIDsByNames(ctx context.Context, names []string) ([]int64, error)
- func GetOrphanedIssueRepoIDs(ctx context.Context) ([]int64, error)
- func GetParticipantsIDsByIssueID(ctx context.Context, issueID int64) ([]int64, error)
- func GetPinnedIssueIDs(ctx context.Context, repoID int64, isPull bool) ([]int64, error)
- func GetPullRequestIDsByCheckStatus(ctx context.Context, status PullRequestStatus) ([]int64, error)
- func GetTrackedSeconds(ctx context.Context, opts FindTrackedTimesOptions) (trackedSeconds int64, err error)
- func HasEnoughApprovals(ctx context.Context, protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
- func HasIssueContentHistory(dbCtx context.Context, issueID, commentID int64) (bool, error)
- func HasIssueLabel(ctx context.Context, issueID, labelID int64) bool
- func HasMergedPullRequestInRepo(ctx context.Context, repoID, posterID int64) (bool, error)
- func HasMergedPullRequestInRepoBefore(ctx context.Context, repoID, posterID int64, beforeUnix timeutil.TimeStamp, ...) (bool, error)
- func HasMilestoneByRepoID(ctx context.Context, repoID, id int64) (bool, error)
- func HasUnmergedPullRequestsByHeadInfo(ctx context.Context, repoID int64, branch string) (bool, error)
- func HasUserStopwatch(ctx context.Context, userID int64) (exists bool, sw *Stopwatch, issue *Issue, err error)
- func HasWorkInProgressPrefix(title string) bool
- func IncrRepoIssueNumbers(ctx context.Context, repoID int64, isPull, totalOrClosed bool) error
- func InsertIssueComments(ctx context.Context, comments []*Comment) error
- func InsertIssues(ctx context.Context, issues ...*Issue) error
- func InsertMilestones(ctx context.Context, ms ...*Milestone) (err error)
- func InsertPullRequests(ctx context.Context, prs ...*PullRequest) error
- func InsertReviews(ctx context.Context, reviews []*Review) error
- func IsContentEmptyErr(err error) bool
- func IsErrCircularDependency(err error) bool
- func IsErrCommentNotExist(err error) bool
- func IsErrDependenciesLeft(err error) bool
- func IsErrDependencyExists(err error) bool
- func IsErrDependencyNotExists(err error) bool
- func IsErrForbiddenIssueReaction(err error) bool
- func IsErrIssueIsClosed(err error) bool
- func IsErrIssueIsOpen(err error) bool
- func IsErrIssueMaxPinReached(err error) bool
- func IsErrIssueNotExist(err error) bool
- func IsErrLabelNotExist(err error) bool
- func IsErrMilestoneNotExist(err error) bool
- func IsErrNewIssueInsert(err error) bool
- func IsErrNotValidReviewRequest(err error) bool
- func IsErrOrgLabelNotExist(err error) bool
- func IsErrPullRequestAlreadyExists(err error) bool
- func IsErrPullRequestNotExist(err error) bool
- func IsErrReactionAlreadyExist(err error) bool
- func IsErrRepoLabelNotExist(err error) bool
- func IsErrReviewNotExist(err error) bool
- func IsErrReviewRequestOnClosedPR(err error) bool
- func IsErrUnknownDependencyType(err error) bool
- func IsNewPinAllowed(ctx context.Context, repoID int64, isPull bool) (bool, error)
- func IsOfficialReviewer(ctx context.Context, issue *Issue, reviewer *user_model.User) (bool, error)
- func IsOfficialReviewerTeam(ctx context.Context, issue *Issue, team *organization.Team) (bool, error)
- func IsUserAssignedToIssue(ctx context.Context, issue *Issue, user *user_model.User) (isAssigned bool, err error)
- func IsUserParticipantsOfIssue(ctx context.Context, user *user_model.User, issue *Issue) bool
- func IssueAssignOrRemoveProject(ctx context.Context, issue *Issue, doer *user_model.User, ...) error
- func IssueIDs(ctx context.Context, opts *IssuesOptions, otherConds ...builder.Cond) ([]int64, int64, error)
- func IssueNoDependenciesLeft(ctx context.Context, issue *Issue) (bool, error)
- func KeepLimitedContentHistory(ctx context.Context, issueID, commentID int64, limit int)
- func LoadProjectIssueColumnMap(ctx context.Context, projectID, defaultColumnID int64) (map[int64]int64, error)
- func LockIssue(ctx context.Context, opts *IssueLockOptions) error
- func MakeIDsFromAPIAssigneesToAdd(ctx context.Context, oneAssignee string, multipleAssignees []string) (assigneeIDs []int64, err error)
- func MarkConversation(ctx context.Context, comment *Comment, doer *user_model.User, isResolve bool) (err error)
- func MarkReviewsAsNotStale(ctx context.Context, issueID int64, commitID string) (err error)
- func MarkReviewsAsStale(ctx context.Context, issueID int64) (err error)
- func MergeBlockedByOfficialReviewRequests(ctx context.Context, protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
- func MergeBlockedByOutdatedBranch(protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
- func MergeBlockedByRejectedReview(ctx context.Context, protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
- func MovePin(ctx context.Context, issue *Issue, newPosition int) error
- func NewIssue(ctx context.Context, repo *repo_model.Repository, issue *Issue, ...) (err error)
- func NewIssueLabel(ctx context.Context, issue *Issue, label *Label, doer *user_model.User) (err error)
- func NewIssueLabels(ctx context.Context, issue *Issue, labels []*Label, doer *user_model.User) (err error)
- func NewIssueUsers(ctx context.Context, repo *repo_model.Repository, issue *Issue) error
- func NewIssueWithIndex(ctx context.Context, doer *user_model.User, opts NewIssueOptions) (err error)
- func NewLabel(ctx context.Context, l *Label) error
- func NewLabels(ctx context.Context, labels ...*Label) error
- func NewMilestone(ctx context.Context, m *Milestone) (err error)
- func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *Issue, ...) (err error)
- func PinIssue(ctx context.Context, issue *Issue, user *user_model.User) error
- func QueryIssueContentHistoryEditedCountMap(dbCtx context.Context, issueID int64) (map[int64]int, error)
- func RecalculateIssueIndexForRepo(ctx context.Context, repoID int64) error
- func RemoveDuplicateExclusiveIssueLabels(ctx context.Context, issue *Issue, label *Label, doer *user_model.User) (err error)
- func RemoveIssueDependency(ctx context.Context, user *user_model.User, issue, dep *Issue, ...) (err error)
- func RemoveIssueWatchersByRepoID(ctx context.Context, userID, repoID int64) error
- func ReplaceIssueLabels(ctx context.Context, issue *Issue, labels []*Label, doer *user_model.User) (err error)
- func ResolveIssueMentionsByVisibility(ctx context.Context, issue *Issue, doer *user_model.User, mentions []string) (users []*user_model.User, err error)
- func ReviewExists(ctx context.Context, issue *Issue, treePath string, line int64) (bool, error)
- func SaveIssueContentHistory(ctx context.Context, posterID, issueID, commentID int64, ...) error
- func SoftDeleteIssueContentHistory(dbCtx context.Context, historyID int64) error
- func StopwatchExists(ctx context.Context, userID, issueID int64) bool
- func SubmitReview(ctx context.Context, doer *user_model.User, issue *Issue, ...) (*Review, *Comment, error)
- func TokenizeCodeOwnersLine(line string) []string
- func TotalTimesForEachUser(ctx context.Context, options *FindTrackedTimesOptions) (map[*user_model.User]int64, error)
- func UnlockIssue(ctx context.Context, opts *IssueLockOptions) error
- func UnpinIssue(ctx context.Context, issue *Issue, user *user_model.User) error
- func UpdateAllowEdits(ctx context.Context, pr *PullRequest) error
- func UpdateComment(ctx context.Context, c *Comment, contentVersion int, doer *user_model.User) error
- func UpdateCommentAttachments(ctx context.Context, c *Comment, uuids []string) error
- func UpdateCommentInvalidate(ctx context.Context, c *Comment) error
- func UpdateCommentsMigrationsByType(ctx context.Context, tp structs.GitServiceType, originalAuthorID string, ...) error
- func UpdateIssueAttachments(ctx context.Context, issueID int64, uuids []string) (err error)
- func UpdateIssueCols(ctx context.Context, issue *Issue, cols ...string) error
- func UpdateIssueDeadline(ctx context.Context, issue *Issue, deadlineUnix timeutil.TimeStamp, ...) (err error)
- func UpdateIssueMentions(ctx context.Context, issueID int64, mentions []*user_model.User) error
- func UpdateIssueNumComments(ctx context.Context, issueID int64) error
- func UpdateIssueNumCommentsBuilder(issueID int64) *builder.Builder
- func UpdateIssueUserByRead(ctx context.Context, uid, issueID int64) error
- func UpdateIssueUsersByMentions(ctx context.Context, issueID int64, uids []int64) error
- func UpdateIssuesMigrationsByType(ctx context.Context, gitServiceType api.GitServiceType, ...) error
- func UpdateLabel(ctx context.Context, l *Label) error
- func UpdateMilestone(ctx context.Context, m *Milestone, oldIsClosed bool) error
- func UpdateMilestoneCounters(ctx context.Context, id int64) error
- func UpdateReactionsMigrationsByType(ctx context.Context, gitServiceType api.GitServiceType, ...) error
- func UpdateReviewsMigrationsByType(ctx context.Context, tp structs.GitServiceType, originalAuthorID string, ...) error
- type AssignedIssuesOptions
- type CodeComments
- type CodeOwnerRule
- type Comment
- func AddReviewRequest(ctx context.Context, issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
- func AddTeamReviewRequest(ctx context.Context, issue *Issue, reviewer *organization.Team, ...) (*Comment, error)
- func CloseIssue(ctx context.Context, issue *Issue, doer *user_model.User) (*Comment, error)
- func CreateAutoMergeComment(ctx context.Context, typ CommentType, pr *PullRequest, doer *user_model.User) (comment *Comment, err error)
- func CreateComment(ctx context.Context, opts *CreateCommentOptions) (_ *Comment, err error)
- func GetCommentByID(ctx context.Context, id int64) (*Comment, error)
- func RemoveReviewRequest(ctx context.Context, issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
- func RemoveTeamReviewRequest(ctx context.Context, issue *Issue, reviewer *organization.Team, ...) (*Comment, error)
- func ReopenIssue(ctx context.Context, issue *Issue, doer *user_model.User) (*Comment, error)
- func SetIssueAsClosed(ctx context.Context, issue *Issue, doer *user_model.User, isMergePull bool) (*Comment, error)
- func ToggleIssueAssignee(ctx context.Context, issue *Issue, doer *user_model.User, assigneeID int64) (removed bool, comment *Comment, err error)
- func (c *Comment) APIURL(ctx context.Context) string
- func (c *Comment) AddCrossReferences(stdCtx context.Context, doer *user_model.User, removeOld bool) error
- func (c *Comment) AfterDelete(ctx context.Context)
- func (c *Comment) AfterLoad()
- func (c *Comment) BeforeInsert()
- func (c *Comment) BeforeUpdate()
- func (c *Comment) CodeCommentLink(ctx context.Context) string
- func (c *Comment) DiffSide() string
- func (c *Comment) EventTag() string
- func (c *Comment) GetExternalID() int64
- func (c *Comment) GetExternalName() string
- func (c *Comment) GetUserID() int64
- func (c *Comment) HTMLURL(ctx context.Context) string
- func (c *Comment) HasOriginalAuthor() bool
- func (c *Comment) HashTag() string
- func (c *Comment) IsResolved() bool
- func (c *Comment) IssueURL(ctx context.Context) string
- func (c *Comment) Link(ctx context.Context) string
- func (c *Comment) LoadAssigneeUserAndTeam(ctx context.Context) error
- func (c *Comment) LoadAttachments(ctx context.Context) error
- func (c *Comment) LoadDepIssueDetails(ctx context.Context) (err error)
- func (c *Comment) LoadIssue(ctx context.Context) (err error)
- func (c *Comment) LoadLabel(ctx context.Context) error
- func (c *Comment) LoadMilestone(ctx context.Context) error
- func (c *Comment) LoadPoster(ctx context.Context) (err error)
- func (c *Comment) LoadProject(ctx context.Context) error
- func (c *Comment) LoadReactions(ctx context.Context, repo *repo_model.Repository) (err error)
- func (c *Comment) LoadRefComment(ctx context.Context) (err error)
- func (c *Comment) LoadRefIssue(ctx context.Context) (err error)
- func (c *Comment) LoadResolveDoer(ctx context.Context) (err error)
- func (c *Comment) LoadReview(ctx context.Context) (err error)
- func (c *Comment) LoadTime(ctx context.Context) error
- func (c *Comment) PRURL(ctx context.Context) string
- func (c *Comment) RefCommentLink(ctx context.Context) string
- func (c *Comment) RefIssueIdent(ctx context.Context) string
- func (c *Comment) RefIssueLink(ctx context.Context) string
- func (c *Comment) RefIssueTitle(ctx context.Context) string
- func (c *Comment) RemapExternalUser(externalName string, externalID, userID int64) error
- func (c *Comment) UnsignedLine() uint64
- type CommentList
- func (comments CommentList) Issues() IssueList
- func (comments CommentList) LoadAttachments(ctx context.Context) (err error)
- func (comments CommentList) LoadAttachmentsByIssue(ctx context.Context) error
- func (comments CommentList) LoadAttributes(ctx context.Context) (err error)
- func (comments CommentList) LoadIssues(ctx context.Context) error
- func (comments CommentList) LoadPosters(ctx context.Context) error
- type CommentMetaData
- type CommentType
- type ContentEmptyErr
- type ContentHistory
- type CreateCommentOptions
- type CreateReviewOptions
- type DependencyInfo
- type DependencyType
- type ErrCircularDependency
- type ErrCommentNotExist
- type ErrDependenciesLeft
- type ErrDependencyExists
- type ErrDependencyNotExists
- type ErrForbiddenIssueReaction
- type ErrIssueContentHistoryNotExist
- type ErrIssueIsClosed
- type ErrIssueIsOpen
- type ErrIssueNotExist
- type ErrLabelNotExist
- type ErrMilestoneNotExist
- type ErrNewIssueInsert
- type ErrNotValidReviewRequest
- type ErrOrgLabelNotExist
- type ErrPullRequestAlreadyExists
- type ErrPullRequestNotExist
- type ErrReactionAlreadyExist
- type ErrRepoLabelNotExist
- type ErrReviewNotExist
- type ErrReviewRequestOnClosedPR
- type ErrUnknownDependencyType
- type ErrUserMustCollaborator
- type FindCommentsOptions
- type FindMilestoneOptions
- type FindReactionsOptions
- type FindReviewOptions
- type FindTrackedTimesOptions
- type Issue
- func GetAssignedIssues(ctx context.Context, opts *AssignedIssuesOptions) ([]*Issue, int64, error)
- func GetIssueByID(ctx context.Context, id int64) (*Issue, error)
- func GetIssueByIndex(ctx context.Context, repoID, index int64) (*Issue, error)
- func GetIssueWithAttrsByIndex(ctx context.Context, repoID, index int64) (*Issue, error)
- func (issue *Issue) APIURL(ctx context.Context) string
- func (issue *Issue) AddCrossReferences(stdCtx context.Context, doer *user_model.User, removeOld bool) error
- func (issue *Issue) BlockedByDependencies(ctx context.Context, opts db.ListOptions) (issueDeps []*DependencyInfo, err error)
- func (issue *Issue) BlockingDependencies(ctx context.Context) (issueDeps []*DependencyInfo, err error)
- func (issue *Issue) DiffURL() string
- func (issue *Issue) GetExternalID() int64
- func (issue *Issue) GetExternalName() string
- func (issue *Issue) GetIsRead(ctx context.Context, userID int64) error
- func (issue *Issue) GetLastComment(ctx context.Context) (*Comment, error)
- func (issue *Issue) GetLastEventLabel() string
- func (issue *Issue) GetLastEventLabelFake() string
- func (issue *Issue) GetLastEventTimestamp() timeutil.TimeStamp
- func (issue *Issue) GetParticipantIDsByIssue(ctx context.Context) ([]int64, error)
- func (issue *Issue) GetTasks() int
- func (issue *Issue) GetTasksDone() int
- func (issue *Issue) GetUserID() int64
- func (issue *Issue) HTMLURL(ctx context.Context) string
- func (issue *Issue) HasOriginalAuthor() bool
- func (issue *Issue) HashTag() string
- func (issue *Issue) IsOverdue() bool
- func (issue *Issue) IsPinned() bool
- func (issue *Issue) IsPoster(uid int64) bool
- func (issue *Issue) IsTimetrackerEnabled(ctx context.Context) bool
- func (issue *Issue) Link() string
- func (issue *Issue) LoadAssignees(ctx context.Context) (err error)
- func (issue *Issue) LoadAttachments(ctx context.Context) (err error)
- func (issue *Issue) LoadAttributes(ctx context.Context) (err error)
- func (issue *Issue) LoadDiscussComments(ctx context.Context) error
- func (issue *Issue) LoadLabels(ctx context.Context) (err error)
- func (issue *Issue) LoadMilestone(ctx context.Context) (err error)
- func (issue *Issue) LoadPinOrder(ctx context.Context) error
- func (issue *Issue) LoadPoster(ctx context.Context) (err error)
- func (issue *Issue) LoadProject(ctx context.Context) (err error)
- func (issue *Issue) LoadPullRequest(ctx context.Context) (err error)
- func (issue *Issue) LoadRepo(ctx context.Context) (err error)
- func (issue *Issue) LoadTotalTimes(ctx context.Context) (err error)
- func (issue *Issue) PatchURL() string
- func (issue *Issue) ProjectColumnID(ctx context.Context) (int64, error)
- func (issue *Issue) RemapExternalUser(externalName string, externalID, userID int64) error
- func (issue *Issue) ResetAttributesLoaded()
- func (issue *Issue) State() api.StateType
- type IssueAssignees
- type IssueContentListItem
- type IssueDependency
- type IssueIndex
- type IssueLabel
- type IssueList
- func FindIssuesSuggestionByKeyword(ctx context.Context, repoID int64, keyword string, ...) (IssueList, error)
- func FindLatestUpdatedIssues(ctx context.Context, repoID int64, isPull optional.Option[bool], pageSize int) (IssueList, error)
- func GetIssuesByIDs(ctx context.Context, issueIDs []int64, keepOrder ...bool) (IssueList, error)
- func GetPinnedIssues(ctx context.Context, repoID int64, isPull bool) (IssueList, error)
- func Issues(ctx context.Context, opts *IssuesOptions) (IssueList, error)
- func LoadIssuesFromColumn(ctx context.Context, b *project_model.Column, opts *IssuesOptions) (IssueList, error)
- func (issues IssueList) GetApprovalCounts(ctx context.Context) (map[int64][]*ReviewCount, error)
- func (issues IssueList) LoadAssignees(ctx context.Context) error
- func (issues IssueList) LoadAttachments(ctx context.Context) (err error)
- func (issues IssueList) LoadAttributes(ctx context.Context) error
- func (issues IssueList) LoadComments(ctx context.Context) error
- func (issues IssueList) LoadDiscussComments(ctx context.Context) error
- func (issues IssueList) LoadIsRead(ctx context.Context, userID int64) error
- func (issues IssueList) LoadLabels(ctx context.Context) error
- func (issues IssueList) LoadMilestones(ctx context.Context) error
- func (issues IssueList) LoadPinOrder(ctx context.Context) error
- func (issues IssueList) LoadPosters(ctx context.Context) error
- func (issues IssueList) LoadProjects(ctx context.Context) error
- func (issues IssueList) LoadPullRequests(ctx context.Context) error
- func (issues IssueList) LoadRepositories(ctx context.Context) (repo_model.RepositoryList, error)
- type IssueLockOptions
- type IssuePin
- type IssueStats
- type IssueUser
- type IssueWatch
- type IssueWatchList
- type IssuesOptions
- type Label
- func GetLabelByID(ctx context.Context, labelID int64) (*Label, error)
- func GetLabelInOrgByID(ctx context.Context, orgID, labelID int64) (*Label, error)
- func GetLabelInOrgByName(ctx context.Context, orgID int64, labelName string) (*Label, error)
- func GetLabelInRepoByID(ctx context.Context, repoID, labelID int64) (*Label, error)
- func GetLabelInRepoByName(ctx context.Context, repoID int64, labelName string) (*Label, error)
- func GetLabelsByIDs(ctx context.Context, labelIDs []int64, cols ...string) ([]*Label, error)
- func GetLabelsByIssueID(ctx context.Context, issueID int64) ([]*Label, error)
- func GetLabelsByOrgID(ctx context.Context, orgID int64, sortType string, listOptions db.ListOptions) ([]*Label, error)
- func GetLabelsByRepoID(ctx context.Context, repoID int64, sortType string, listOptions db.ListOptions) ([]*Label, error)
- func GetLabelsInOrgByIDs(ctx context.Context, orgID int64, labelIDs []int64) ([]*Label, error)
- func GetLabelsInRepoByIDs(ctx context.Context, repoID int64, labelIDs []int64) ([]*Label, error)
- func RemoveDuplicateExclusiveLabels(labels []*Label) []*Label
- func (l *Label) BelongsToOrg() bool
- func (l *Label) BelongsToRepo() bool
- func (l *Label) CalOpenIssues()
- func (l *Label) CalOpenOrgIssues(ctx context.Context, repoID, labelID int64)
- func (l *Label) ExclusiveScope() string
- func (l *Label) IsArchived() bool
- func (l *Label) LoadSelectedLabelsAfterClick(currentSelectedLabels []int64, currentSelectedExclusiveScopes []string)
- func (l *Label) SetArchived(isArchived bool)
- type Milestone
- type MilestoneList
- type MilestonesStats
- type NewIssueOptions
- type PullRequest
- func GetAllUnmergedAgitPullRequestByPoster(ctx context.Context, uid int64) ([]*PullRequest, error)
- func GetLatestPullRequestByHeadInfo(ctx context.Context, repoID int64, branch string) (*PullRequest, error)
- func GetPullRequestByBaseHeadInfo(ctx context.Context, baseID, headID int64, base, head string) (*PullRequest, error)
- func GetPullRequestByID(ctx context.Context, id int64) (*PullRequest, error)
- func GetPullRequestByIndex(ctx context.Context, repoID, index int64) (*PullRequest, error)
- func GetPullRequestByIssueID(ctx context.Context, issueID int64) (*PullRequest, error)
- func GetPullRequestByIssueIDWithNoAttributes(ctx context.Context, issueID int64) (*PullRequest, error)
- func GetPullRequestByMergedCommit(ctx context.Context, repoID int64, sha string) (*PullRequest, error)
- func GetUnmergedPullRequest(ctx context.Context, headRepoID, baseRepoID int64, ...) (*PullRequest, error)
- func (pr *PullRequest) CanAutoMerge() bool
- func (pr *PullRequest) GetApprovalCounts(ctx context.Context) ([]*ReviewCount, error)
- func (pr *PullRequest) GetApprovers(ctx context.Context) string
- func (pr *PullRequest) GetBaseBranchLink(ctx context.Context) string
- func (pr *PullRequest) GetGitHeadRefName() string
- func (pr *PullRequest) GetHeadBranchLink(ctx context.Context) string
- func (pr *PullRequest) GetReviewCommentsCount(ctx context.Context) int
- func (pr *PullRequest) GetWorkInProgressPrefix(ctx context.Context) string
- func (pr *PullRequest) IsAgitFlow() bool
- func (pr *PullRequest) IsAncestor() bool
- func (pr *PullRequest) IsChecking() bool
- func (pr *PullRequest) IsEmpty() bool
- func (pr *PullRequest) IsFilesConflicted() bool
- func (pr *PullRequest) IsFromFork() bool
- func (pr *PullRequest) IsSameRepo() bool
- func (pr *PullRequest) IsWorkInProgress(ctx context.Context) bool
- func (pr *PullRequest) LoadAttributes(ctx context.Context) (err error)
- func (pr *PullRequest) LoadBaseRepo(ctx context.Context) (err error)
- func (pr *PullRequest) LoadHeadRepo(ctx context.Context) (err error)
- func (pr *PullRequest) LoadIssue(ctx context.Context) (err error)
- func (pr *PullRequest) LoadRequestedReviewers(ctx context.Context) error
- func (pr *PullRequest) LoadRequestedReviewersTeams(ctx context.Context) error
- func (pr *PullRequest) Mergeable(ctx context.Context) bool
- func (pr *PullRequest) MustHeadUserName(ctx context.Context) string
- func (pr *PullRequest) ResolveCrossReferences(ctx context.Context) ([]*Comment, error)
- func (pr *PullRequest) String() string
- func (pr *PullRequest) UpdateCols(ctx context.Context, cols ...string) error
- func (pr *PullRequest) UpdateColsIfNotMerged(ctx context.Context, cols ...string) (int64, error)
- func (pr *PullRequest) UpdateCommitDivergence(ctx context.Context, ahead, behind int) error
- type PullRequestFlow
- type PullRequestList
- func GetPullRequestByIssueIDs(ctx context.Context, issueIDs []int64) (PullRequestList, error)
- func GetUnmergedPullRequestsByBaseInfo(ctx context.Context, repoID int64, branch string) (PullRequestList, error)
- func GetUnmergedPullRequestsByHeadInfo(ctx context.Context, repoID int64, branch string) (PullRequestList, error)
- func PullRequests(ctx context.Context, baseRepoID int64, opts *PullRequestsOptions) (PullRequestList, int64, error)
- func (prs PullRequestList) GetIssueIDs() []int64
- func (prs PullRequestList) LoadAttributes(ctx context.Context) error
- func (prs PullRequestList) LoadIssues(ctx context.Context) (IssueList, error)
- func (prs PullRequestList) LoadRepositories(ctx context.Context) error
- func (prs PullRequestList) LoadReviewCommentsCounts(ctx context.Context) (map[int64]int, error)
- func (prs PullRequestList) LoadReviews(ctx context.Context) (ReviewList, error)
- func (prs PullRequestList) SetBaseRepo(baseRepo *repo_model.Repository)
- func (prs PullRequestList) SetHeadRepo(headRepo *repo_model.Repository)
- type PullRequestStatus
- type PullRequestType
- type PullRequestsOptions
- type PushActionContent
- type Reaction
- type ReactionList
- func FindCommentReactions(ctx context.Context, issueID, commentID int64) (ReactionList, int64, error)
- func FindIssueReactions(ctx context.Context, issueID int64, listOptions db.ListOptions) (ReactionList, int64, error)
- func FindReactions(ctx context.Context, opts FindReactionsOptions) (ReactionList, int64, error)
- func (list ReactionList) GetFirstUsers() string
- func (list ReactionList) GetMoreUserCount() int
- func (list ReactionList) GroupByType() map[string]ReactionList
- func (list ReactionList) HasUser(userID int64) bool
- func (list ReactionList) LoadUsers(ctx context.Context, repo *repo_model.Repository) ([]*user_model.User, error)
- type ReactionOptions
- type Review
- func CreateReview(ctx context.Context, opts CreateReviewOptions) (*Review, error)
- func GetCurrentReview(ctx context.Context, reviewer *user_model.User, issue *Issue) (*Review, error)
- func GetReviewByID(ctx context.Context, id int64) (*Review, error)
- func GetReviewByIssueIDAndUserID(ctx context.Context, issueID, userID int64) (*Review, error)
- func GetTeamReviewerByIssueIDAndTeamID(ctx context.Context, issueID, teamID int64) (*Review, error)
- func (r *Review) GetCodeCommentsCount(ctx context.Context) int
- func (r *Review) GetExternalID() int64
- func (r *Review) GetExternalName() string
- func (r *Review) GetUserID() int64
- func (r *Review) HTMLTypeColorName() string
- func (r *Review) HTMLURL(ctx context.Context) string
- func (r *Review) LoadAttributes(ctx context.Context) (err error)
- func (r *Review) LoadCodeComments(ctx context.Context) (err error)
- func (r *Review) LoadIssue(ctx context.Context) (err error)
- func (r *Review) LoadReviewer(ctx context.Context) (err error)
- func (r *Review) LoadReviewerTeam(ctx context.Context) (err error)
- func (r *Review) RemapExternalUser(externalName string, externalID, userID int64) error
- func (r *Review) TooltipContent() string
- type ReviewCount
- type ReviewList
- type ReviewType
- type RoleDescriptor
- type RoleInRepo
- type Stopwatch
- type TrackedTime
- type TrackedTimeList
- type UserStopwatch
Constants ¶
const ( FilterModeAll = iota FilterModeAssign FilterModeCreate FilterModeMention FilterModeReviewRequested FilterModeReviewed FilterModeYourRepositories )
Filter modes.
const ( // MaxQueryParameters represents the max query parameters // When queries are broken down in parts because of the number // of parameters, attempt to break by this amount MaxQueryParameters = 300 )
const ScopeSortPrefix = "scope-"
Variables ¶
var ErrCommentAlreadyChanged = util.NewInvalidArgumentErrorf("the comment is already changed")
var ErrIssueAlreadyChanged = util.NewInvalidArgumentErrorf("the issue is already changed")
var ErrIssueMaxPinReached = util.NewInvalidArgumentErrorf("the max number of pinned issues has been readched")
var ErrMustCollaborator = util.NewPermissionDeniedErrorf("user must be a collaborator")
Functions ¶
func AddDeletePRBranchComment ¶
func AddDeletePRBranchComment(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, issueID int64, branchName string) error
AddDeletePRBranchComment adds delete branch comment for pull request issue
func BuildLabelNamesIssueIDsCondition ¶
BuildLabelNamesIssueIDsCondition returns a builder where get issue ids match label names
func CanMaintainerWriteToBranch ¶
func CanMaintainerWriteToBranch(ctx context.Context, p access_model.Permission, branch string, user *user_model.User) bool
CanMaintainerWriteToBranch check whether user is a maintainer and could write to the branch
func CanMarkConversation ¶
func CanMarkConversation(ctx context.Context, issue *Issue, doer *user_model.User) (permResult bool, err error)
CanMarkConversation Add or remove Conversation mark for a code comment permission check the PR writer , official reviewer and poster can do it
func CancelStopwatch ¶
CancelStopwatch removes the given stopwatch and logs it into issue's timeline.
func ChangeIssueContent ¶
func ChangeIssueContent(ctx context.Context, issue *Issue, doer *user_model.User, content string, contentVersion int) (err error)
ChangeIssueContent changes issue content, as the given user.
func ChangeIssueRef ¶
func ChangeIssueRef(ctx context.Context, issue *Issue, doer *user_model.User, oldRef string) (err error)
ChangeIssueRef changes the branch of this issue, as the given user.
func ChangeIssueTimeEstimate ¶
func ChangeIssueTimeEstimate(ctx context.Context, issue *Issue, doer *user_model.User, timeEstimate int64) error
ChangeIssueTimeEstimate changes the plan time of this issue, as the given user.
func ChangeIssueTitle ¶
func ChangeIssueTitle(ctx context.Context, issue *Issue, doer *user_model.User, oldTitle string) (err error)
ChangeIssueTitle changes the title of this issue, as the given user.
func ChangeMilestoneStatus ¶
ChangeMilestoneStatus changes the milestone open/closed status.
func ChangeMilestoneStatusByRepoIDAndID ¶
func ChangeMilestoneStatusByRepoIDAndID(ctx context.Context, repoID, milestoneID int64, isClosed bool) error
ChangeMilestoneStatusByRepoIDAndID changes a milestone open/closed status if the milestone ID is in the repo.
func CheckIssueWatch ¶
CheckIssueWatch check if an user is watching an issue it takes participants and repo watch into account
func ClearIssueLabels ¶
ClearIssueLabels removes all issue labels as the given user. Triggers appropriate WebHooks, if any.
func CommentHashTag ¶
CommentHashTag returns unique hash tag for comment id.
func CommentTypeIsRef ¶
func CommentTypeIsRef(t CommentType) bool
CommentTypeIsRef returns true if CommentType is a reference from another issue
func CountCommentTypeLabelWithEmptyLabel ¶
CountCommentTypeLabelWithEmptyLabel count label comments with empty label
func CountCommentTypeLabelWithOutsideLabels ¶
CountCommentTypeLabelWithOutsideLabels count label comments with outside label
func CountComments ¶
func CountComments(ctx context.Context, opts *FindCommentsOptions) (int64, error)
CountComments count all comments according options by ignoring pagination
func CountIssueLabelWithOutsideLabels ¶
CountIssueLabelWithOutsideLabels count label comments with outside label
func CountIssueWatchers ¶
CountIssueWatchers count watchers/unwatchers of a given issue
func CountIssues ¶
func CountIssues(ctx context.Context, opts *IssuesOptions, otherConds ...builder.Cond) (int64, error)
CountIssues number return of issues by given conditions.
func CountIssuesByRepo ¶
CountIssuesByRepo map from repoID to number of issues matching the options
func CountLabelsByOrgID ¶
CountLabelsByOrgID count all labels that belong to given organization by ID.
func CountLabelsByRepoID ¶
CountLabelsByRepoID count number of all labels that belong to given repository by ID.
func CountMilestonesMap ¶
CountMilestonesByRepoCondAndKw map from repo conditions and the keyword of milestones' name to number of milestones matching the options`
func CountOrphanedIssueLabels ¶
CountOrphanedIssueLabels return count of IssueLabels witch have no label behind anymore
func CountOrphanedIssues ¶
CountOrphanedIssues count issues without a repo
func CountOrphanedLabels ¶
CountOrphanedLabels return count of labels witch are broken and not accessible via ui anymore
func CountReviews ¶
func CountReviews(ctx context.Context, opts FindReviewOptions) (int64, error)
CountReviews returns count of reviews passing FindReviewOptions
func CountTrackedTimes ¶
func CountTrackedTimes(ctx context.Context, opts *FindTrackedTimesOptions) (int64, error)
CountTrackedTimes returns count of tracked times that fit to the given options.
func CountUserStopwatches ¶
CountUserStopwatches return count of the user's all stopwatches
func CreateIssueDependency ¶
CreateIssueDependency creates a new dependency for an issue
func CreateIssueStopwatch ¶
func CreateIssueStopwatch(ctx context.Context, user *user_model.User, issue *Issue) (ok bool, err error)
CreateIssueStopwatch creates a stopwatch if the issue doesn't have the user's stopwatch. It also stops any other stopwatch that might be running for the user.
func CreateOrUpdateIssueWatch ¶
CreateOrUpdateIssueWatch set watching for a user and issue
func DecrRepoIssueNumbers ¶
func DecrRepoIssueNumbers(ctx context.Context, repoID int64, isPull, includeTotal, includeClosed bool) error
DecrRepoIssueNumbers decrements repository issue numbers.
func DeleteComment ¶
DeleteComment deletes the comment
func DeleteCommentReaction ¶
func DeleteCommentReaction(ctx context.Context, doerID, issueID, commentID int64, content string) error
DeleteCommentReaction deletes a reaction on comment.
func DeleteIssueLabel ¶
DeleteIssueLabel deletes issue-label relation.
func DeleteIssueReaction ¶
DeleteIssueReaction deletes a reaction on issue.
func DeleteIssueUserTimes ¶
DeleteIssueUserTimes deletes times for issue
func DeleteLabel ¶
DeleteLabel delete a label
func DeleteLabelsByRepoID ¶
DeleteLabelsByRepoID deletes labels of some repository
func DeleteMilestoneByRepoID ¶
DeleteMilestoneByRepoID deletes a milestone from a repository.
func DeleteOrphanedIssueLabels ¶
DeleteOrphanedIssueLabels delete IssueLabels witch have no label behind anymore
func DeleteOrphanedLabels ¶
DeleteOrphanedLabels delete labels witch are broken and not accessible via ui anymore
func DeletePullsByBaseRepoID ¶
DeletePullsByBaseRepoID deletes all pull requests by the base repository ID
func DeleteReaction ¶
func DeleteReaction(ctx context.Context, opts *ReactionOptions) error
DeleteReaction deletes reaction for issue or comment.
func DeleteReview ¶
DeleteReview delete a review and it's code comments
func DeleteTime ¶
func DeleteTime(ctx context.Context, t *TrackedTime) error
DeleteTime delete a specific Time
func DismissReview ¶
DismissReview change the dismiss status of a review
func FindAndUpdateIssueMentions ¶
func FindAndUpdateIssueMentions(ctx context.Context, issue *Issue, doer *user_model.User, content string) (mentions []*user_model.User, err error)
FindAndUpdateIssueMentions finds users mentioned in the given content string, and saves them in the database.
func FinishIssueStopwatch ¶
func FinishIssueStopwatch(ctx context.Context, user *user_model.User, issue *Issue) (ok bool, err error)
FinishIssueStopwatch if stopwatch exists, then finish it.
func FixCommentTypeLabelWithEmptyLabel ¶
FixCommentTypeLabelWithEmptyLabel count label comments with empty label
func FixCommentTypeLabelWithOutsideLabels ¶
FixCommentTypeLabelWithOutsideLabels count label comments with outside label
func FixIssueLabelWithOutsideLabels ¶
FixIssueLabelWithOutsideLabels fix label comments with outside label
func GetAssigneeIDsByIssue ¶
GetAssigneeIDsByIssue returns the IDs of users assigned to an issue but skips joining with `user` for performance reasons. User permissions must be verified elsewhere if required.
func GetGrantedApprovalsCount ¶
func GetGrantedApprovalsCount(ctx context.Context, protectBranch *git_model.ProtectedBranch, pr *PullRequest) int64
GetGrantedApprovalsCount returns the number of granted approvals for pr. A granted approval must be authored by a user in an approval whitelist.
func GetIssueIDsByRepoID ¶
GetIssueIDsByRepoID returns all issue ids by repo id
func GetIssueMentionIDs ¶
GetIssueMentionIDs returns all mentioned user IDs of an issue.
func GetIssueTotalTrackedTime ¶
func GetIssueTotalTrackedTime(ctx context.Context, opts *IssuesOptions, isClosed optional.Option[bool]) (int64, error)
GetIssueTotalTrackedTime returns the total tracked time for issues by given conditions.
func GetIssueWatchersIDs ¶
GetIssueWatchersIDs returns IDs of subscribers or explicit unsubscribers to a given issue id but avoids joining with `user` for performance reasons User permissions must be verified elsewhere if required
func GetLabelIDsByNames ¶
GetLabelIDsByNames returns a list of labelIDs by names. It doesn't filter them by repo or org, so it could return labels belonging to different repos/orgs. It's used for filtering issues via indexer, otherwise it would be useless. Since it could return labels with the same name, so the length of returned ids could be more than the length of names.
func GetLabelIDsInOrgByNames ¶
func GetLabelIDsInOrgByNames(ctx context.Context, orgID int64, labelNames []string) ([]int64, error)
GetLabelIDsInOrgByNames returns a list of labelIDs by names in a given org.
func GetLabelIDsInRepoByNames ¶
func GetLabelIDsInRepoByNames(ctx context.Context, repoID int64, labelNames []string) ([]int64, error)
GetLabelIDsInRepoByNames returns a list of labelIDs by names in a given repository. it silently ignores label names that do not belong to the repository.
func GetMilestoneIDsByNames ¶
GetMilestoneIDsByNames returns a list of milestone ids by given names. It doesn't filter them by repo, so it could return milestones belonging to different repos. It's used for filtering issues via indexer, otherwise it would be useless. Since it could return milestones with the same name, so the length of returned ids could be more than the length of names.
func GetParticipantsIDsByIssueID ¶
GetParticipantsIDsByIssueID returns the IDs of all users who participated in comments of an issue, but skips joining with `user` for performance reasons. User permissions must be verified elsewhere if required.
func GetPinnedIssueIDs ¶
func GetPullRequestIDsByCheckStatus ¶
func GetPullRequestIDsByCheckStatus(ctx context.Context, status PullRequestStatus) ([]int64, error)
GetPullRequestIDsByCheckStatus returns all pull requests according the special checking status.
func GetTrackedSeconds ¶
func GetTrackedSeconds(ctx context.Context, opts FindTrackedTimesOptions) (trackedSeconds int64, err error)
GetTrackedSeconds return sum of seconds
func HasEnoughApprovals ¶
func HasEnoughApprovals(ctx context.Context, protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
HasEnoughApprovals returns true if pr has enough granted approvals.
func HasIssueContentHistory ¶
HasIssueContentHistory check if a ContentHistory entry exists
func HasIssueLabel ¶
HasIssueLabel returns true if issue has been labeled.
func HasMergedPullRequestInRepo ¶
HasMergedPullRequestInRepo returns whether the user(poster) has merged pull-request in the repo
func HasMergedPullRequestInRepoBefore ¶
func HasMergedPullRequestInRepoBefore(ctx context.Context, repoID, posterID int64, beforeUnix timeutil.TimeStamp, excludePullID int64) (bool, error)
HasMergedPullRequestInRepoBefore returns whether the user has a merged PR before a timestamp (0 = no limit)
func HasMilestoneByRepoID ¶
HasMilestoneByRepoID returns if the milestone exists in the repository.
func HasUnmergedPullRequestsByHeadInfo ¶
func HasUnmergedPullRequestsByHeadInfo(ctx context.Context, repoID int64, branch string) (bool, error)
HasUnmergedPullRequestsByHeadInfo checks if there are open and not merged pull request by given head information (repo and branch)
func HasUserStopwatch ¶
func HasUserStopwatch(ctx context.Context, userID int64) (exists bool, sw *Stopwatch, issue *Issue, err error)
HasUserStopwatch returns true if the user has a stopwatch
func HasWorkInProgressPrefix ¶
HasWorkInProgressPrefix determines if the given PR title has a Work In Progress prefix
func IncrRepoIssueNumbers ¶
IncrRepoIssueNumbers increments repository issue numbers.
func InsertIssueComments ¶
InsertIssueComments inserts many comments of issues.
func InsertIssues ¶
InsertIssues insert issues to database
func InsertMilestones ¶
InsertMilestones creates milestones of repository.
func InsertPullRequests ¶
func InsertPullRequests(ctx context.Context, prs ...*PullRequest) error
InsertPullRequests inserted pull requests
func InsertReviews ¶
InsertReviews inserts review and review comments
func IsContentEmptyErr ¶
IsContentEmptyErr returns true if err is a ContentEmptyErr
func IsErrCircularDependency ¶
IsErrCircularDependency checks if an error is a ErrCircularDependency.
func IsErrCommentNotExist ¶
IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
func IsErrDependenciesLeft ¶
IsErrDependenciesLeft checks if an error is a ErrDependenciesLeft.
func IsErrDependencyExists ¶
IsErrDependencyExists checks if an error is a ErrDependencyExists.
func IsErrDependencyNotExists ¶
IsErrDependencyNotExists checks if an error is a ErrDependencyExists.
func IsErrForbiddenIssueReaction ¶
IsErrForbiddenIssueReaction checks if an error is a ErrForbiddenIssueReaction.
func IsErrIssueIsClosed ¶
IsErrIssueIsClosed checks if an error is a ErrIssueIsClosed.
func IsErrIssueIsOpen ¶
IsErrIssueIsOpen checks if an error is a ErrIssueIsOpen.
func IsErrIssueMaxPinReached ¶
IsErrIssueMaxPinReached returns if the error is, that the User can't pin more Issues
func IsErrIssueNotExist ¶
IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
func IsErrLabelNotExist ¶
IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
func IsErrMilestoneNotExist ¶
IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
func IsErrNewIssueInsert ¶
IsErrNewIssueInsert checks if an error is a ErrNewIssueInsert.
func IsErrNotValidReviewRequest ¶
IsErrNotValidReviewRequest checks if an error is a ErrNotValidReviewRequest.
func IsErrOrgLabelNotExist ¶
IsErrOrgLabelNotExist checks if an error is a OrgErrLabelNotExist.
func IsErrPullRequestAlreadyExists ¶
IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
func IsErrPullRequestNotExist ¶
IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
func IsErrReactionAlreadyExist ¶
IsErrReactionAlreadyExist checks if an error is a ErrReactionAlreadyExist.
func IsErrRepoLabelNotExist ¶
IsErrRepoLabelNotExist checks if an error is a RepoErrLabelNotExist.
func IsErrReviewNotExist ¶
IsErrReviewNotExist checks if an error is a ErrReviewNotExist.
func IsErrReviewRequestOnClosedPR ¶
IsErrReviewRequestOnClosedPR checks if an error is an ErrReviewRequestOnClosedPR.
func IsErrUnknownDependencyType ¶
IsErrUnknownDependencyType checks if an error is ErrUnknownDependencyType
func IsNewPinAllowed ¶
IsNewPinAllowed returns if a new Issue or Pull request can be pinned
func IsOfficialReviewer ¶
IsOfficialReviewer check if at least one of the provided reviewers can make official reviews in issue (counts towards required approvals)
func IsOfficialReviewerTeam ¶
func IsOfficialReviewerTeam(ctx context.Context, issue *Issue, team *organization.Team) (bool, error)
IsOfficialReviewerTeam check if reviewer in this team can make official reviews in issue (counts towards required approvals)
func IsUserAssignedToIssue ¶
func IsUserAssignedToIssue(ctx context.Context, issue *Issue, user *user_model.User) (isAssigned bool, err error)
IsUserAssignedToIssue returns true when the user is assigned to the issue
func IsUserParticipantsOfIssue ¶
IsUserParticipantsOfIssue return true if user is participants of an issue
func IssueAssignOrRemoveProject ¶
func IssueAssignOrRemoveProject(ctx context.Context, issue *Issue, doer *user_model.User, newProjectID, newColumnID int64) error
IssueAssignOrRemoveProject changes the project associated with an issue If newProjectID is 0, the issue is removed from the project
func IssueIDs ¶
func IssueIDs(ctx context.Context, opts *IssuesOptions, otherConds ...builder.Cond) ([]int64, int64, error)
IssueIDs returns a list of issue ids by given conditions.
func IssueNoDependenciesLeft ¶
IssueNoDependenciesLeft checks if issue can be closed
func KeepLimitedContentHistory ¶
KeepLimitedContentHistory keeps at most `limit` history revisions, it will hard delete out-dated revisions, sorting by revision interval we can ignore all errors in this function, so we just log them
func LoadProjectIssueColumnMap ¶
func LockIssue ¶
func LockIssue(ctx context.Context, opts *IssueLockOptions) error
LockIssue locks an issue. This would limit commenting abilities to users with write access to the repo
func MakeIDsFromAPIAssigneesToAdd ¶
func MakeIDsFromAPIAssigneesToAdd(ctx context.Context, oneAssignee string, multipleAssignees []string) (assigneeIDs []int64, err error)
MakeIDsFromAPIAssigneesToAdd returns an array with all assignee IDs
func MarkConversation ¶
func MarkConversation(ctx context.Context, comment *Comment, doer *user_model.User, isResolve bool) (err error)
MarkConversation Add or remove Conversation mark for a code comment
func MarkReviewsAsNotStale ¶
MarkReviewsAsNotStale marks existing reviews as not stale for a giving commit SHA
func MarkReviewsAsStale ¶
MarkReviewsAsStale marks existing reviews as stale
func MergeBlockedByOfficialReviewRequests ¶
func MergeBlockedByOfficialReviewRequests(ctx context.Context, protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
MergeBlockedByOfficialReviewRequests block merge because of some review request to official reviewer of from official review
func MergeBlockedByOutdatedBranch ¶
func MergeBlockedByOutdatedBranch(protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
MergeBlockedByOutdatedBranch returns true if merge is blocked by an outdated head branch
func MergeBlockedByRejectedReview ¶
func MergeBlockedByRejectedReview(ctx context.Context, protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
MergeBlockedByRejectedReview returns true if merge is blocked by rejected reviews
func MovePin ¶
MovePin moves a Pinned Issue to a new Position
func NewIssue ¶
func NewIssue(ctx context.Context, repo *repo_model.Repository, issue *Issue, labelIDs []int64, uuids []string) (err error)
NewIssue creates new issue with labels for repository. The title will be cut off at 255 characters if it's longer than 255 characters.
func NewIssueLabel ¶
func NewIssueLabel(ctx context.Context, issue *Issue, label *Label, doer *user_model.User) (err error)
NewIssueLabel creates a new issue-label relation.
func NewIssueLabels ¶
func NewIssueLabels(ctx context.Context, issue *Issue, labels []*Label, doer *user_model.User) (err error)
NewIssueLabels creates a list of issue-label relations.
func NewIssueUsers ¶
func NewIssueUsers(ctx context.Context, repo *repo_model.Repository, issue *Issue) error
NewIssueUsers inserts an issue related users
func NewIssueWithIndex ¶
func NewIssueWithIndex(ctx context.Context, doer *user_model.User, opts NewIssueOptions) (err error)
NewIssueWithIndex creates issue with given index
func NewLabels ¶
NewLabels creates new labels
func NewMilestone ¶
NewMilestone creates new milestone of repository.
func NewPullRequest ¶
func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *Issue, labelIDs []int64, uuids []string, pr *PullRequest) (err error)
NewPullRequest creates new pull request with labels for repository.
func PinIssue ¶
Pin pins a Issue
func QueryIssueContentHistoryEditedCountMap ¶
func QueryIssueContentHistoryEditedCountMap(dbCtx context.Context, issueID int64) (map[int64]int, error)
QueryIssueContentHistoryEditedCountMap query related history count of each comment (comment_id = 0 means the main issue) only return the count map for "edited" (history revision count > 1) issues or comments.
func RecalculateIssueIndexForRepo ¶
RecalculateIssueIndexForRepo create issue_index for repo if not exist and update it based on highest index of existing issues assigned to a repo
func RemoveDuplicateExclusiveIssueLabels ¶
func RemoveDuplicateExclusiveIssueLabels(ctx context.Context, issue *Issue, label *Label, doer *user_model.User) (err error)
Remove all issue labels in the given exclusive scope
func RemoveIssueDependency ¶
func RemoveIssueDependency(ctx context.Context, user *user_model.User, issue, dep *Issue, depType DependencyType) (err error)
RemoveIssueDependency removes a dependency from an issue
func RemoveIssueWatchersByRepoID ¶
RemoveIssueWatchersByRepoID remove issue watchers by repoID
func ReplaceIssueLabels ¶
func ReplaceIssueLabels(ctx context.Context, issue *Issue, labels []*Label, doer *user_model.User) (err error)
ReplaceIssueLabels removes all current labels and add new labels to the issue. Triggers appropriate WebHooks, if any.
func ResolveIssueMentionsByVisibility ¶
func ResolveIssueMentionsByVisibility(ctx context.Context, issue *Issue, doer *user_model.User, mentions []string) (users []*user_model.User, err error)
ResolveIssueMentionsByVisibility returns the users mentioned in an issue, removing those that don't have access to reading it. Teams are expanded into their users, but organizations are ignored.
func ReviewExists ¶
ReviewExists returns whether a review exists for a particular line of code in the PR
func SaveIssueContentHistory ¶
func SaveIssueContentHistory(ctx context.Context, posterID, issueID, commentID int64, editTime timeutil.TimeStamp, contentText string, isFirstCreated bool) error
SaveIssueContentHistory save history
func SoftDeleteIssueContentHistory ¶
SoftDeleteIssueContentHistory soft delete
func StopwatchExists ¶
StopwatchExists returns true if the stopwatch exists
func SubmitReview ¶
func SubmitReview(ctx context.Context, doer *user_model.User, issue *Issue, reviewType ReviewType, content, commitID string, stale bool, attachmentUUIDs []string) (*Review, *Comment, error)
SubmitReview creates a review out of the existing pending review or creates a new one if no pending review exist
func TotalTimesForEachUser ¶
func TotalTimesForEachUser(ctx context.Context, options *FindTrackedTimesOptions) (map[*user_model.User]int64, error)
TotalTimesForEachUser returns the spent time in seconds for each user by an issue
func UnlockIssue ¶
func UnlockIssue(ctx context.Context, opts *IssueLockOptions) error
UnlockIssue unlocks a previously locked issue.
func UnpinIssue ¶
UnpinIssue unpins a Issue
func UpdateAllowEdits ¶
func UpdateAllowEdits(ctx context.Context, pr *PullRequest) error
UpdateAllowEdits update if PR can be edited from maintainers
func UpdateComment ¶
func UpdateComment(ctx context.Context, c *Comment, contentVersion int, doer *user_model.User) error
UpdateComment updates information of comment.
func UpdateCommentAttachments ¶
UpdateCommentAttachments update attachments by UUIDs for the comment
func UpdateCommentInvalidate ¶
UpdateCommentInvalidate updates comment invalidated column
func UpdateCommentsMigrationsByType ¶
func UpdateCommentsMigrationsByType(ctx context.Context, tp structs.GitServiceType, originalAuthorID string, posterID int64) error
UpdateCommentsMigrationsByType updates comments' migrations information via given git service type and original id and poster id
func UpdateIssueAttachments ¶
UpdateIssueAttachments update attachments by UUIDs for the issue
func UpdateIssueCols ¶
UpdateIssueCols updates cols of issue
func UpdateIssueDeadline ¶
func UpdateIssueDeadline(ctx context.Context, issue *Issue, deadlineUnix timeutil.TimeStamp, doer *user_model.User) (err error)
UpdateIssueDeadline updates an issue deadline and adds comments. Setting a deadline to 0 means deleting it.
func UpdateIssueMentions ¶
UpdateIssueMentions updates issue-user relations for mentioned users.
func UpdateIssueNumCommentsBuilder ¶
func UpdateIssueUserByRead ¶
UpdateIssueUserByRead updates issue-user relation for reading.
func UpdateIssueUsersByMentions ¶
UpdateIssueUsersByMentions updates issue-user pairs by mentioning.
func UpdateIssuesMigrationsByType ¶
func UpdateIssuesMigrationsByType(ctx context.Context, gitServiceType api.GitServiceType, originalAuthorID string, posterID int64) error
UpdateIssuesMigrationsByType updates all migrated repositories' issues from gitServiceType to replace originalAuthorID to posterID
func UpdateLabel ¶
UpdateLabel updates label information.
func UpdateMilestone ¶
UpdateMilestone updates information of given milestone.
func UpdateMilestoneCounters ¶
UpdateMilestoneCounters calculates NumIssues, NumClosesIssues and Completeness
func UpdateReactionsMigrationsByType ¶
func UpdateReactionsMigrationsByType(ctx context.Context, gitServiceType api.GitServiceType, originalAuthorID string, userID int64) error
UpdateReactionsMigrationsByType updates all migrated repositories' reactions from gitServiceType to replace originalAuthorID to posterID
Types ¶
type AssignedIssuesOptions ¶
type AssignedIssuesOptions struct {
db.ListOptions
AssigneeID int64
RepoOwnerID int64
}
func (*AssignedIssuesOptions) ToConds ¶
func (opts *AssignedIssuesOptions) ToConds() builder.Cond
type CodeComments ¶
CodeComments represents comments on code by using this structure: FILENAME -> LINE (+ == proposed; - == previous) -> COMMENTS
func FetchCodeComments ¶
func FetchCodeComments(ctx context.Context, issue *Issue, currentUser *user_model.User, showOutdatedComments bool) (CodeComments, error)
FetchCodeComments will return a 2d-map: ["Path"]["Line"] = Comments at line
type CodeOwnerRule ¶
type CodeOwnerRule struct {
Rule *regexp.Regexp
Negative bool
Users []*user_model.User
Teams []*org_model.Team
}
func GetCodeOwnersFromContent ¶
func GetCodeOwnersFromContent(ctx context.Context, data string) ([]*CodeOwnerRule, []string)
GetCodeOwnersFromContent returns the code owners configuration Return empty slice if files missing Return warning messages on parsing errors We're trying to do the best we can when parsing a file. Invalid lines are skipped. Non-existent users and teams too.
type Comment ¶
type Comment struct {
ID int64 `xorm:"pk autoincr"`
Type CommentType `xorm:"INDEX"`
PosterID int64 `xorm:"INDEX"`
Poster *user_model.User `xorm:"-"`
OriginalAuthor string
OriginalAuthorID int64
IssueID int64 `xorm:"INDEX"`
Issue *Issue `xorm:"-"`
LabelID int64
Label *Label `xorm:"-"`
AddedLabels []*Label `xorm:"-"`
RemovedLabels []*Label `xorm:"-"`
OldProjectID int64
ProjectID int64
OldProject *project_model.Project `xorm:"-"`
Project *project_model.Project `xorm:"-"`
OldMilestoneID int64
MilestoneID int64
OldMilestone *Milestone `xorm:"-"`
Milestone *Milestone `xorm:"-"`
TimeID int64
Time *TrackedTime `xorm:"-"`
AssigneeID int64
RemovedAssignee bool
Assignee *user_model.User `xorm:"-"`
AssigneeTeamID int64 `xorm:"NOT NULL DEFAULT 0"`
AssigneeTeam *organization.Team `xorm:"-"`
ResolveDoerID int64
ResolveDoer *user_model.User `xorm:"-"`
OldTitle string
NewTitle string
OldRef string
NewRef string
DependentIssueID int64 `xorm:"index"` // This is used by issue_service.deleteIssue
DependentIssue *Issue `xorm:"-"`
CommitID int64
Line int64 // - previous line / + proposed line
TreePath string `xorm:"VARCHAR(4000)"` // SQLServer only supports up to 4000
Content string `xorm:"LONGTEXT"`
ContentVersion int `xorm:"NOT NULL DEFAULT 0"`
RenderedContent template.HTML `xorm:"-"`
// Path represents the 4 lines of code cemented by this comment
Patch string `xorm:"-"`
PatchQuoted string `xorm:"LONGTEXT patch"`
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
// Reference issue in commit message
CommitSHA string `xorm:"VARCHAR(64)"`
Attachments []*repo_model.Attachment `xorm:"-"`
Reactions ReactionList `xorm:"-"`
// For view issue page.
ShowRole RoleDescriptor `xorm:"-"`
Review *Review `xorm:"-"`
ReviewID int64 `xorm:"index"`
Invalidated bool
// Reference an issue or pull from another comment, issue or PR
// All information is about the origin of the reference
RefRepoID int64 `xorm:"index"` // Repo where the referencing
RefIssueID int64 `xorm:"index"`
RefCommentID int64 `xorm:"index"` // 0 if origin is Issue title or content (or PR's)
RefAction references.XRefAction `xorm:"SMALLINT"` // What happens if RefIssueID resolves
RefIsPull bool
CommentMetaData *CommentMetaData `xorm:"JSON TEXT"` // put all non-index metadata in a single field
RefRepo *repo_model.Repository `xorm:"-"`
RefIssue *Issue `xorm:"-"`
RefComment *Comment `xorm:"-"`
Commits []*git_model.SignCommitWithStatuses `xorm:"-"`
OldCommit string `xorm:"-"`
NewCommit string `xorm:"-"`
CommitsNum int64 `xorm:"-"`
IsForcePush bool `xorm:"-"`
}
Comment represents a comment in commit and issue page.
func AddReviewRequest ¶
func AddReviewRequest(ctx context.Context, issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
AddReviewRequest add a review request from one reviewer
func AddTeamReviewRequest ¶
func AddTeamReviewRequest(ctx context.Context, issue *Issue, reviewer *organization.Team, doer *user_model.User) (*Comment, error)
AddTeamReviewRequest add a review request from one team
func CloseIssue ¶
CloseIssue changes issue status to closed.
func CreateAutoMergeComment ¶
func CreateAutoMergeComment(ctx context.Context, typ CommentType, pr *PullRequest, doer *user_model.User) (comment *Comment, err error)
CreateAutoMergeComment is a internal function, only use it for CommentTypePRScheduledToAutoMerge and CommentTypePRUnScheduledToAutoMerge CommentTypes
func CreateComment ¶
func CreateComment(ctx context.Context, opts *CreateCommentOptions) (_ *Comment, err error)
CreateComment creates comment with context
func GetCommentByID ¶
GetCommentByID returns the comment by given ID.
func RemoveReviewRequest ¶
func RemoveReviewRequest(ctx context.Context, issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
RemoveReviewRequest remove a review request from one reviewer
func RemoveTeamReviewRequest ¶
func RemoveTeamReviewRequest(ctx context.Context, issue *Issue, reviewer *organization.Team, doer *user_model.User) (*Comment, error)
RemoveTeamReviewRequest remove a review request from one team
func ReopenIssue ¶
ReopenIssue changes issue status to open.
func SetIssueAsClosed ¶
func ToggleIssueAssignee ¶
func ToggleIssueAssignee(ctx context.Context, issue *Issue, doer *user_model.User, assigneeID int64) (removed bool, comment *Comment, err error)
ToggleIssueAssignee changes a user between assigned and not assigned for this issue, and make issue comment for it.
func (*Comment) APIURL ¶
APIURL formats a API-string to the issue-comment
func (*Comment) AddCrossReferences ¶
func (c *Comment) AddCrossReferences(stdCtx context.Context, doer *user_model.User, removeOld bool) error
AddCrossReferences add cross references
func (*Comment) AfterDelete ¶
AfterDelete is invoked from XORM after the object is deleted.
func (*Comment) AfterLoad ¶
func (c *Comment) AfterLoad()
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*Comment) BeforeInsert ¶
func (c *Comment) BeforeInsert()
BeforeInsert will be invoked by XORM before inserting a record
func (*Comment) BeforeUpdate ¶
func (c *Comment) BeforeUpdate()
BeforeUpdate will be invoked by XORM before updating a record
func (*Comment) CodeCommentLink ¶
CodeCommentLink returns the url to a comment in code
func (*Comment) DiffSide ¶
DiffSide returns "previous" if Comment.Line is a LOC of the previous changes and "proposed" if it is a LOC of the proposed changes.
func (*Comment) EventTag ¶
EventTag returns unique event hash tag for comment.
func (*Comment) GetExternalID ¶
GetExternalID ExternalUserRemappable interface
func (*Comment) GetExternalName ¶
GetExternalName ExternalUserRemappable interface
func (*Comment) GetUserID ¶
GetUserID ExternalUserRemappable interface
func (*Comment) HTMLURL ¶
HTMLURL formats a URL-string to the issue-comment
func (*Comment) HasOriginalAuthor ¶
HasOriginalAuthor returns if a comment was migrated and has an original author.
func (*Comment) HashTag ¶
HashTag returns unique hash tag for comment.
func (*Comment) IsResolved ¶
IsResolved check if an code comment is resolved
func (*Comment) IssueURL ¶
IssueURL formats a URL-string to the issue
func (*Comment) Link ¶
Link formats a relative URL-string to the issue-comment
func (*Comment) LoadAssigneeUserAndTeam ¶
LoadAssigneeUserAndTeam if comment.Type is CommentTypeAssignees, then load assignees
func (*Comment) LoadAttachments ¶
LoadAttachments loads attachments (it never returns error, the error during `GetAttachmentsByCommentIDCtx` is ignored)
func (*Comment) LoadDepIssueDetails ¶
LoadDepIssueDetails loads Dependent Issue Details
func (*Comment) LoadIssue ¶
LoadIssue loads the issue reference for the comment
func (*Comment) LoadLabel ¶
LoadLabel if comment.Type is CommentTypeLabel, then load Label
func (*Comment) LoadMilestone ¶
LoadMilestone if comment.Type is CommentTypeMilestone, then load milestone
func (*Comment) LoadPoster ¶
LoadPoster loads comment poster
func (*Comment) LoadProject ¶
LoadProject if comment.Type is CommentTypeProject, then load project.
func (*Comment) LoadReactions ¶
func (c *Comment) LoadReactions(ctx context.Context, repo *repo_model.Repository) (err error)
LoadReactions loads comment reactions
func (*Comment) LoadRefComment ¶
LoadRefComment loads comment that created this reference from database
func (*Comment) LoadRefIssue ¶
LoadRefIssue loads comment that created this reference from database
func (*Comment) LoadResolveDoer ¶
LoadResolveDoer if comment.Type is CommentTypeCode and ResolveDoerID not zero, then load resolveDoer
func (*Comment) LoadReview ¶
LoadReview loads the associated review
func (*Comment) LoadTime ¶
LoadTime loads the associated time for a CommentTypeAddTimeManual
func (*Comment) PRURL ¶
PRURL formats a URL-string to the pull-request
func (*Comment) RefCommentLink ¶
RefCommentLink returns the relative URL for the comment that created this reference
func (*Comment) RefIssueIdent ¶
RefIssueIdent returns the user friendly identity (e.g. "#1234") of the issue where this reference was created
func (*Comment) RefIssueLink ¶
RefIssueLink returns the relative URL of the issue where this reference was created
func (*Comment) RefIssueTitle ¶
RefIssueTitle returns the title of the issue where this reference was created
func (*Comment) RemapExternalUser ¶
RemapExternalUser ExternalUserRemappable interface
type CommentList ¶
type CommentList []*Comment
CommentList defines a list of comments
func FetchCodeCommentsByLine ¶
func FetchCodeCommentsByLine(ctx context.Context, issue *Issue, currentUser *user_model.User, treePath string, line int64, showOutdatedComments bool) (CommentList, error)
FetchCodeCommentsByLine fetches the code comments for a given treePath and line number
func FindComments ¶
func FindComments(ctx context.Context, opts *FindCommentsOptions) (CommentList, error)
FindComments returns all comments according options
func (CommentList) Issues ¶
func (comments CommentList) Issues() IssueList
Issues returns all the issues of comments
func (CommentList) LoadAttachments ¶
func (comments CommentList) LoadAttachments(ctx context.Context) (err error)
LoadAttachments loads attachments
func (CommentList) LoadAttachmentsByIssue ¶
func (comments CommentList) LoadAttachmentsByIssue(ctx context.Context) error
LoadAttachmentsByIssue loads attachments by issue id
func (CommentList) LoadAttributes ¶
func (comments CommentList) LoadAttributes(ctx context.Context) (err error)
LoadAttributes loads attributes of the comments, except for attachments and comments
func (CommentList) LoadIssues ¶
func (comments CommentList) LoadIssues(ctx context.Context) error
LoadIssues loads issues of comments
func (CommentList) LoadPosters ¶
func (comments CommentList) LoadPosters(ctx context.Context) error
LoadPosters loads posters
type CommentMetaData ¶
type CommentMetaData struct {
ProjectColumnID int64 `json:"project_column_id,omitempty"`
ProjectColumnTitle string `json:"project_column_title,omitempty"`
ProjectTitle string `json:"project_title,omitempty"`
}
CommentMetaData stores metadata for a comment, these data will not be changed once inserted into database
type CommentType ¶
type CommentType int
CommentType defines whether a comment is just a simple comment, an action (like close) or a reference.
const ( CommentTypeComment CommentType = iota // 0 Plain comment, can be associated with a commit (CommitID > 0) and a line (LineNum > 0) CommentTypeReopen // 1 CommentTypeClose // 2 CommentTypeIssueRef // 3 References. CommentTypeCommitRef // 4 Reference from a commit (not part of a pull request) CommentTypeCommentRef // 5 Reference from a comment CommentTypePullRef // 6 Reference from a pull request CommentTypeLabel // 7 Labels changed CommentTypeMilestone // 8 Milestone changed CommentTypeAssignees // 9 Assignees changed CommentTypeChangeTitle // 10 Change Title CommentTypeDeleteBranch // 11 Delete Branch CommentTypeStartTracking // 12 Start a stopwatch for time tracking CommentTypeStopTracking // 13 Stop a stopwatch for time tracking CommentTypeAddTimeManual // 14 Add time manual for time tracking CommentTypeCancelTracking // 15 Cancel a stopwatch for time tracking CommentTypeAddedDeadline // 16 Added a due date CommentTypeModifiedDeadline // 17 Modified the due date CommentTypeRemovedDeadline // 18 Removed a due date CommentTypeAddDependency // 19 Dependency added CommentTypeRemoveDependency // 20 Dependency removed CommentTypeCode // 21 Comment a line of code CommentTypeReview // 22 Reviews a pull request by giving general feedback CommentTypeLock // 23 Lock an issue, giving only collaborators access CommentTypeUnlock // 24 Unlocks a previously locked issue CommentTypeChangeTargetBranch // 25 Change pull request's target branch CommentTypeDeleteTimeManual // 26 Delete time manual for time tracking CommentTypeReviewRequest // 27 add or remove Request from one CommentTypeMergePull // 28 merge pull request CommentTypePullRequestPush // 29 push to PR head branch CommentTypeProject // 30 Project changed CommentTypeProjectColumn // 31 Project column changed CommentTypeDismissReview // 32 Dismiss Review CommentTypeChangeIssueRef // 33 Change issue ref CommentTypePRScheduledToAutoMerge // 34 pr was scheduled to auto merge when checks succeed CommentTypePRUnScheduledToAutoMerge // 35 pr was un scheduled to auto merge when checks succeed CommentTypePin // 36 pin Issue/PullRequest CommentTypeUnpin // 37 unpin Issue/PullRequest CommentTypeChangeTimeEstimate // 38 Change time estimate )
const CommentTypeUndefined CommentType = -1
CommentTypeUndefined is used to search for comments of any type
func AsCommentType ¶
func AsCommentType(typeName string) CommentType
func ConversationCountedCommentType ¶
func ConversationCountedCommentType() []CommentType
ConversationCountedCommentType returns the comment types that are counted as a conversation
func (CommentType) CountedAsConversation ¶
func (t CommentType) CountedAsConversation() bool
func (CommentType) HasAttachmentSupport ¶
func (t CommentType) HasAttachmentSupport() bool
func (CommentType) HasContentSupport ¶
func (t CommentType) HasContentSupport() bool
func (CommentType) HasMailReplySupport ¶
func (t CommentType) HasMailReplySupport() bool
func (CommentType) String ¶
func (t CommentType) String() string
type ContentEmptyErr ¶
type ContentEmptyErr struct{}
ContentEmptyErr represents an content empty error
func (ContentEmptyErr) Error ¶
func (ContentEmptyErr) Error() string
type ContentHistory ¶
type ContentHistory struct {
ID int64 `xorm:"pk autoincr"`
PosterID int64
IssueID int64 `xorm:"INDEX"`
CommentID int64 `xorm:"INDEX"`
EditedUnix timeutil.TimeStamp `xorm:"INDEX"`
ContentText string `xorm:"LONGTEXT"`
IsFirstCreated bool
IsDeleted bool
}
ContentHistory save issue/comment content history revisions.
func GetIssueContentHistoryAndPrev ¶
func GetIssueContentHistoryAndPrev(dbCtx context.Context, issueID, id int64) (history, prevHistory *ContentHistory, err error)
GetIssueContentHistoryAndPrev get a history and the previous non-deleted history (to compare)
func GetIssueContentHistoryByID ¶
func GetIssueContentHistoryByID(dbCtx context.Context, id int64) (*ContentHistory, error)
GetIssueContentHistoryByID get issue content history
func (*ContentHistory) TableName ¶
func (m *ContentHistory) TableName() string
TableName provides the real table name
type CreateCommentOptions ¶
type CreateCommentOptions struct {
Type CommentType
Doer *user_model.User
Repo *repo_model.Repository
Issue *Issue
Label *Label
DependentIssueID int64
OldMilestoneID int64
MilestoneID int64
OldProjectID int64
ProjectID int64
ProjectTitle string
ProjectColumnID int64
ProjectColumnTitle string
TimeID int64
AssigneeID int64
AssigneeTeamID int64
RemovedAssignee bool
OldTitle string
NewTitle string
OldRef string
NewRef string
CommitID int64
CommitSHA string
Patch string
LineNum int64
TreePath string
ReviewID int64
Content string
Attachments []string // UUIDs of attachments
RefRepoID int64
RefIssueID int64
RefCommentID int64
RefAction references.XRefAction
RefIsPull bool
IsForcePush bool
Invalidated bool
}
CreateCommentOptions defines options for creating comment
type CreateReviewOptions ¶
type CreateReviewOptions struct {
Content string
Type ReviewType
Issue *Issue
Reviewer *user_model.User
ReviewerTeam *organization.Team
Official bool
CommitID string
Stale bool
}
CreateReviewOptions represent the options to create a review. Type, Issue and Reviewer are required.
type DependencyInfo ¶
type DependencyInfo struct {
Issue `xorm:"extends"`
repo_model.