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(p access_model.Permission, branch string, user *user_model.User) bool
- func CanMarkConversation(issue *Issue, doer *user_model.User) (permResult bool, err error)
- func CancelStopwatch(user *user_model.User, issue *Issue) error
- func ChangeIssueContent(issue *Issue, doer *user_model.User, content string) (err error)
- func ChangeIssueRef(issue *Issue, doer *user_model.User, oldRef string) (err error)
- func ChangeIssueTitle(ctx context.Context, issue *Issue, doer *user_model.User, oldTitle string) (err error)
- func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error)
- func ChangeMilestoneStatusByRepoIDAndID(repoID, milestoneID int64, isClosed bool) error
- func ChangeProjectAssign(issue *Issue, doer *user_model.User, newProjectID int64) error
- func CheckIssueWatch(user *user_model.User, issue *Issue) (bool, error)
- func ClearIssueLabels(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(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) (int64, error)
- func CountIssuesByRepo(ctx context.Context, opts *IssuesOptions) (map[int64]int64, error)
- func CountLabelsByOrgID(orgID int64) (int64, error)
- func CountLabelsByRepoID(repoID int64) (int64, error)
- func CountMilestones(ctx context.Context, opts GetMilestonesOption) (int64, error)
- func CountMilestonesByRepoCond(repoCond builder.Cond, isClosed bool) (map[int64]int64, error)
- func CountMilestonesByRepoCondAndKw(repoCond builder.Cond, keyword string, isClosed bool) (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(opts FindReviewOptions) (int64, error)
- func CountTrackedTimes(opts *FindTrackedTimesOptions) (int64, error)
- func CountUserStopwatches(userID int64) (int64, error)
- func CreateIssueDependency(user *user_model.User, issue, dep *Issue) error
- func CreateIssueStopwatch(ctx context.Context, user *user_model.User, issue *Issue) error
- func CreateOrStopIssueStopwatch(user *user_model.User, issue *Issue) error
- func CreateOrUpdateIssueWatch(userID, issueID int64, isWatching bool) error
- func DeleteComment(ctx context.Context, comment *Comment) error
- func DeleteCommentReaction(doerID, issueID, commentID int64, content string) error
- func DeleteInIssue(ctx context.Context, issueID int64, beans ...any) error
- func DeleteIssueLabel(ctx context.Context, issue *Issue, label *Label, doer *user_model.User) error
- func DeleteIssueReaction(doerID, issueID int64, content string) error
- func DeleteIssueUserTimes(issue *Issue, user *user_model.User) error
- func DeleteIssuesByRepoID(ctx context.Context, repoID int64) (attachmentPaths []string, err error)
- func DeleteLabel(id, labelID int64) error
- func DeleteLabelsByRepoID(ctx context.Context, repoID int64) error
- func DeleteMilestoneByRepoID(repoID, id int64) error
- func DeleteOrphanedIssueLabels(ctx context.Context) error
- func DeleteOrphanedIssues(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(r *Review) error
- func DeleteTime(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) error
- func FinishIssueStopwatchIfPossible(ctx context.Context, user *user_model.User, issue *Issue) 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 GetIssueWatchersIDs(ctx context.Context, issueID int64, watching bool) ([]int64, error)
- func GetLabelIDsInOrgByNames(orgID int64, labelNames []string) ([]int64, error)
- func GetLabelIDsInRepoByNames(repoID int64, labelNames []string) ([]int64, error)
- func GetParticipantsIDsByIssueID(ctx context.Context, issueID int64) ([]int64, error)
- func GetPullRequestIDsByCheckStatus(status PullRequestStatus) ([]int64, error)
- func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *user_model.User) ([]int64, error)
- func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen, numClosed int64)
- 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 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 InsertReviews(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 IsErrErrPullRequestHeadRepoMissing(err error) bool
- func IsErrForbiddenIssueReaction(err error) bool
- func IsErrIssueIsClosed(err error) bool
- func IsErrIssueMaxPinReached(err error) bool
- func IsErrIssueNotExist(err error) bool
- func IsErrIssueWasClosed(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 IsErrPullWasClosed(err error) bool
- func IsErrReactionAlreadyExist(err error) bool
- func IsErrRepoLabelNotExist(err error) bool
- func IsErrReviewNotExist(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, reviewers ...*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(user *user_model.User, issue *Issue) bool
- func IssueNoDependenciesLeft(ctx context.Context, issue *Issue) (bool, error)
- func KeepLimitedContentHistory(ctx context.Context, issueID, commentID int64, limit int)
- func LoadIssuesFromBoardList(ctx context.Context, bs project_model.BoardList) (map[int64]IssueList, error)
- func LockIssue(opts *IssueLockOptions) error
- func MakeIDsFromAPIAssigneesToAdd(ctx context.Context, oneAssignee string, multipleAssignees []string) (assigneeIDs []int64, err error)
- func MarkConversation(comment *Comment, doer *user_model.User, isResolve bool) (err error)
- func MarkReviewsAsNotStale(issueID int64, commitID string) (err error)
- func MarkReviewsAsStale(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 MoveIssueAcrossProjectBoards(issue *Issue, board *project_model.Board) error
- func NewIssue(repo *repo_model.Repository, issue *Issue, labelIDs []int64, uuids []string) (err error)
- func NewIssueLabel(issue *Issue, label *Label, doer *user_model.User) (err error)
- func NewIssueLabels(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(labels ...*Label) error
- func NewMilestone(m *Milestone) (err error)
- func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *Issue, ...) (err error)
- func QueryIssueContentHistoryEditedCountMap(dbCtx context.Context, issueID int64) (map[int64]int, error)
- func RecalculateIssueIndexForRepo(repoID int64) error
- func RemoveDuplicateExclusiveIssueLabels(ctx context.Context, issue *Issue, label *Label, doer *user_model.User) (err error)
- func RemoveIssueDependency(user *user_model.User, issue, dep *Issue, depType DependencyType) (err error)
- func RemoveIssueWatchersByRepoID(ctx context.Context, userID, repoID int64) error
- func ReplaceIssueLabels(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(issue *Issue, treePath string, line int64) (bool, error)
- func SaveIssueContentHistory(ctx context.Context, posterID, issueID, commentID int64, ...) error
- func SearchIssueIDsByKeyword(ctx context.Context, kw string, repoIDs []int64, limit, start int) (int64, []int64, error)
- func SoftDeleteIssueContentHistory(dbCtx context.Context, historyID int64) error
- func StopwatchExists(userID, issueID int64) bool
- func SubmitReview(doer *user_model.User, issue *Issue, reviewType ReviewType, ...) (*Review, *Comment, error)
- func TotalTimes(options *FindTrackedTimesOptions) (map[*user_model.User]string, error)
- func UnlockIssue(opts *IssueLockOptions) error
- func UpdateAllowEdits(ctx context.Context, pr *PullRequest) error
- func UpdateComment(c *Comment, doer *user_model.User) error
- func UpdateCommentInvalidate(ctx context.Context, c *Comment) error
- func UpdateCommentsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateIssueAttachments(issueID int64, uuids []string) (err error)
- func UpdateIssueCols(ctx context.Context, issue *Issue, cols ...string) error
- func UpdateIssueDeadline(issue *Issue, deadlineUnix timeutil.TimeStamp, doer *user_model.User) (err error)
- func UpdateIssueMentions(ctx context.Context, issueID int64, mentions []*user_model.User) error
- func UpdateIssueUserByRead(ctx context.Context, uid, issueID int64) error
- func UpdateIssueUsersByMentions(ctx context.Context, issueID int64, uids []int64) error
- func UpdateIssuesMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, posterID int64) error
- func UpdateLabel(l *Label) error
- func UpdateMilestone(m *Milestone, oldIsClosed bool) error
- func UpdateMilestoneCounters(ctx context.Context, id int64) error
- func UpdateReactionsMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, userID int64) error
- func UpdateReviewsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error
- type CodeComments
- 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 ChangeIssueStatus(ctx context.Context, issue *Issue, doer *user_model.User, isClosed bool) (*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 FetchCodeCommentsByLine(ctx context.Context, issue *Issue, currentUser *user_model.User, ...) ([]*Comment, 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 ToggleIssueAssignee(ctx context.Context, issue *Issue, doer *user_model.User, assigneeID int64) (removed bool, comment *Comment, err error)
- func UpdateIssueByAPI(issue *Issue, doer *user_model.User) (statusChangeComment *Comment, titleChanged bool, err error)
- func (c *Comment) APIURL() string
- func (c *Comment) AddCrossReferences(stdCtx context.Context, doer *user_model.User, removeOld bool) error
- func (c *Comment) AfterDelete()
- func (c *Comment) AfterLoad(session *xorm.Session)
- func (c *Comment) BeforeInsert()
- func (c *Comment) BeforeUpdate()
- func (c *Comment) CodeCommentLink() 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() string
- func (c *Comment) HasOriginalAuthor() bool
- func (c *Comment) HashTag() string
- func (c *Comment) IsResolved() bool
- func (c *Comment) IssueURL() string
- func (c *Comment) Link() string
- func (c *Comment) LoadAssigneeUserAndTeam() error
- func (c *Comment) LoadAttachments(ctx context.Context) error
- func (c *Comment) LoadDepIssueDetails() (err error)
- func (c *Comment) LoadIssue(ctx context.Context) (err error)
- func (c *Comment) LoadLabel() error
- func (c *Comment) LoadMilestone(ctx context.Context) error
- func (c *Comment) LoadPoster(ctx context.Context) (err error)
- func (c *Comment) LoadProject() error
- func (c *Comment) LoadPushCommits(ctx context.Context) (err error)
- func (c *Comment) LoadReactions(repo *repo_model.Repository) error
- func (c *Comment) LoadRefComment() (err error)
- func (c *Comment) LoadRefIssue() (err error)
- func (c *Comment) LoadResolveDoer() (err error)
- func (c *Comment) LoadReview() error
- func (c *Comment) LoadTime() error
- func (c *Comment) PRURL() string
- func (c *Comment) RefCommentLink() string
- func (c *Comment) RefIssueIdent() string
- func (c *Comment) RefIssueLink() string
- func (c *Comment) RefIssueTitle() string
- func (c *Comment) RemapExternalUser(externalName string, externalID, userID int64) error
- func (c *Comment) UnsignedLine() uint64
- func (c *Comment) UpdateAttachments(uuids []string) error
- type CommentList
- func (comments CommentList) Issues() IssueList
- func (comments CommentList) LoadAttachments(ctx context.Context) (err error)
- func (comments CommentList) LoadAttributes() error
- func (comments CommentList) LoadIssues(ctx context.Context) error
- func (comments CommentList) LoadPosters(ctx context.Context) error
- 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 ErrIssueNotExist
- type ErrIssueStopwatchAlreadyExist
- type ErrIssueStopwatchNotExist
- type ErrIssueWasClosed
- type ErrLabelNotExist
- type ErrMilestoneNotExist
- type ErrNewIssueInsert
- type ErrNotValidReviewRequest
- type ErrOrgLabelNotExist
- type ErrPullRequestAlreadyExists
- type ErrPullRequestHeadRepoMissing
- type ErrPullRequestNotExist
- type ErrPullWasClosed
- type ErrReactionAlreadyExist
- type ErrRepoLabelNotExist
- type ErrReviewNotExist
- type ErrUnknownDependencyType
- type FindCommentsOptions
- type FindReactionsOptions
- type FindReviewOptions
- type FindTrackedTimesOptions
- type GetMilestonesOption
- type Issue
- func GetIssueByID(ctx context.Context, id int64) (*Issue, error)
- func GetIssueByIndex(repoID, index int64) (*Issue, error)
- func GetIssueWithAttrsByID(id int64) (*Issue, error)
- func GetIssueWithAttrsByIndex(repoID, index int64) (*Issue, error)
- func GetPinnedIssues(ctx context.Context, repoID int64, isPull bool) ([]*Issue, error)
- func Issues(ctx context.Context, opts *IssuesOptions) ([]*Issue, error)
- func (issue *Issue) APIURL() 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(userID int64) error
- func (issue *Issue) GetLastComment() (*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) GetPullRequest() (pr *PullRequest, err error)
- func (issue *Issue) GetTasks() int
- func (issue *Issue) GetTasksDone() int
- func (issue *Issue) GetUserID() int64
- func (issue *Issue) HTMLURL() 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) 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) 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) MovePin(ctx context.Context, newPosition int) error
- func (issue *Issue) PatchURL() string
- func (issue *Issue) Pin(ctx context.Context, user *user_model.User) error
- func (issue *Issue) PinOrUnpin(ctx context.Context, user *user_model.User) error
- func (issue *Issue) ProjectBoardID() int64
- func (issue *Issue) RemapExternalUser(externalName string, externalID, userID int64) error
- func (issue *Issue) State() api.StateType
- func (issue *Issue) Unpin(ctx context.Context, user *user_model.User) error
- type IssueAssignees
- type IssueContentListItem
- type IssueDependency
- type IssueIndex
- type IssueLabel
- type IssueList
- func (issues IssueList) GetApprovalCounts(ctx context.Context) (map[int64][]*ReviewCount, error)
- func (issues IssueList) LoadAttachments(ctx context.Context) (err error)
- func (issues IssueList) LoadAttributes() error
- func (issues IssueList) LoadComments(ctx context.Context) error
- func (issues IssueList) LoadDiscussComments(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 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(labelIDs []int64) ([]*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) LoadSelectedLabelsAfterClick(currentSelectedLabels []int64, currentSelectedExclusiveScopes []string)
- type Milestone
- type MilestoneList
- func GetMilestones(opts GetMilestonesOption) (MilestoneList, int64, error)
- func GetMilestonesByRepoIDs(repoIDs []int64, page int, isClosed bool, sortType string) (MilestoneList, error)
- func SearchMilestones(repoCond builder.Cond, page int, isClosed bool, sortType, keyword string) (MilestoneList, error)
- type MilestonesStats
- type NewIssueOptions
- type PullRequest
- func GetAllUnmergedAgitPullRequestByPoster(ctx context.Context, uid int64) ([]*PullRequest, error)
- func GetLatestPullRequestByHeadInfo(repoID int64, branch 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(issueID int64) (*PullRequest, error)
- func GetPullRequestsByHeadBranch(ctx context.Context, headBranch string, headRepoID int64) ([]*PullRequest, error)
- func GetUnmergedPullRequest(ctx context.Context, headRepoID, baseRepoID int64, ...) (*PullRequest, error)
- func GetUnmergedPullRequestsByBaseInfo(repoID int64, branch string) ([]*PullRequest, error)
- func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequest, error)
- func PullRequests(baseRepoID int64, opts *PullRequestsOptions) ([]*PullRequest, int64, error)
- func (pr *PullRequest) CanAutoMerge() bool
- func (pr *PullRequest) GetApprovalCounts(ctx context.Context) ([]*ReviewCount, error)
- func (pr *PullRequest) GetApprovers() string
- func (pr *PullRequest) GetBaseBranchLink() string
- func (pr *PullRequest) GetGitHeadBranchRefName() string
- func (pr *PullRequest) GetGitRefName() string
- func (pr *PullRequest) GetHeadBranchLink() string
- func (pr *PullRequest) GetWorkInProgressPrefix(ctx context.Context) string
- 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() 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) Mergeable() bool
- func (pr *PullRequest) MustHeadUserName(ctx context.Context) string
- func (pr *PullRequest) ResolveCrossReferences(ctx context.Context) ([]*Comment, error)
- func (pr *PullRequest) SetMerged(ctx context.Context) (bool, error)
- func (pr *PullRequest) String() string
- func (pr *PullRequest) Update() error
- func (pr *PullRequest) UpdateCols(cols ...string) error
- func (pr *PullRequest) UpdateColsIfNotMerged(ctx context.Context, cols ...string) error
- func (pr *PullRequest) UpdateCommitDivergence(ctx context.Context, ahead, behind int) error
- type PullRequestFlow
- type PullRequestList
- type PullRequestStatus
- type PullRequestType
- type PullRequestsOptions
- type PushActionContent
- type Reaction
- type ReactionList
- 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 *Review, err error)
- func (r *Review) GetCodeCommentsCount() 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() string
- func (r *Review) LoadAttributes(ctx context.Context) (err error)
- func (r *Review) LoadCodeComments(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
- type ReviewCount
- type ReviewList
- func FindLatestReviews(ctx context.Context, opts FindReviewOptions) (ReviewList, error)
- func FindReviews(ctx context.Context, opts FindReviewOptions) (ReviewList, error)
- func GetReviewersFromOriginalAuthorsByIssueID(issueID int64) (ReviewList, error)
- func GetReviewsByIssueID(issueID int64) (ReviewList, error)
- type ReviewType
- type RoleDescriptor
- 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 )
Variables ¶
var ErrIssueMaxPinReached = util.NewInvalidArgumentErrorf("the max number of pinned issues has been readched")
Functions ¶
func AddDeletePRBranchComment ¶ added in v1.17.0
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 ¶ added in v1.17.0
BuildLabelNamesIssueIDsCondition returns a builder where get issue ids match label names
func CanMaintainerWriteToBranch ¶ added in v1.17.0
func CanMaintainerWriteToBranch(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 ¶ added in v1.17.0
func CanMarkConversation(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 , offfcial reviewer and poster can do it
func CancelStopwatch ¶ added in v1.17.0
func CancelStopwatch(user *user_model.User, issue *Issue) error
CancelStopwatch removes the given stopwatch and logs it into issue's timeline.
func ChangeIssueContent ¶ added in v1.17.0
func ChangeIssueContent(issue *Issue, doer *user_model.User, content string) (err error)
ChangeIssueContent changes issue content, as the given user.
func ChangeIssueRef ¶ added in v1.17.0
func ChangeIssueRef(issue *Issue, doer *user_model.User, oldRef string) (err error)
ChangeIssueRef changes the branch of this issue, as the given user.
func ChangeIssueTitle ¶ added in v1.17.0
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 ¶ added in v1.17.0
ChangeMilestoneStatus changes the milestone open/closed status.
func ChangeMilestoneStatusByRepoIDAndID ¶ added in v1.17.0
ChangeMilestoneStatusByRepoIDAndID changes a milestone open/closed status if the milestone ID is in the repo.
func ChangeProjectAssign ¶ added in v1.17.0
func ChangeProjectAssign(issue *Issue, doer *user_model.User, newProjectID int64) error
ChangeProjectAssign changes the project associated with an issue
func CheckIssueWatch ¶ added in v1.17.0
func CheckIssueWatch(user *user_model.User, issue *Issue) (bool, error)
CheckIssueWatch check if an user is watching an issue it takes participants and repo watch into account
func ClearIssueLabels ¶ added in v1.17.0
func ClearIssueLabels(issue *Issue, doer *user_model.User) (err error)
ClearIssueLabels removes all issue labels as the given user. Triggers appropriate WebHooks, if any.
func CommentHashTag ¶ added in v1.17.0
CommentHashTag returns unique hash tag for comment id.
func CommentTypeIsRef ¶ added in v1.17.0
func CommentTypeIsRef(t CommentType) bool
CommentTypeIsRef returns true if CommentType is a reference from another issue
func CountCommentTypeLabelWithEmptyLabel ¶ added in v1.17.0
CountCommentTypeLabelWithEmptyLabel count label comments with empty label
func CountCommentTypeLabelWithOutsideLabels ¶ added in v1.17.0
CountCommentTypeLabelWithOutsideLabels count label comments with outside label
func CountComments ¶ added in v1.17.0
func CountComments(opts *FindCommentsOptions) (int64, error)
CountComments count all comments according options by ignoring pagination
func CountIssueLabelWithOutsideLabels ¶ added in v1.17.0
CountIssueLabelWithOutsideLabels count label comments with outside label
func CountIssueWatchers ¶ added in v1.17.0
CountIssueWatchers count watchers/unwatchers of a given issue
func CountIssues ¶ added in v1.17.0
func CountIssues(ctx context.Context, opts *IssuesOptions) (int64, error)
CountIssues number return of issues by given conditions.
func CountIssuesByRepo ¶ added in v1.17.0
CountIssuesByRepo map from repoID to number of issues matching the options
func CountLabelsByOrgID ¶ added in v1.17.0
CountLabelsByOrgID count all labels that belong to given organization by ID.
func CountLabelsByRepoID ¶ added in v1.17.0
CountLabelsByRepoID count number of all labels that belong to given repository by ID.
func CountMilestones ¶ added in v1.17.0
func CountMilestones(ctx context.Context, opts GetMilestonesOption) (int64, error)
CountMilestones returns number of milestones in given repository with other options
func CountMilestonesByRepoCond ¶ added in v1.17.0
CountMilestonesByRepoCond map from repo conditions to number of milestones matching the options`
func CountMilestonesByRepoCondAndKw ¶ added in v1.17.0
func CountMilestonesByRepoCondAndKw(repoCond builder.Cond, keyword string, isClosed bool) (map[int64]int64, error)
CountMilestonesByRepoCondAndKw map from repo conditions and the keyword of milestones' name to number of milestones matching the options`
func CountOrphanedIssueLabels ¶ added in v1.17.0
CountOrphanedIssueLabels return count of IssueLabels witch have no label behind anymore
func CountOrphanedIssues ¶ added in v1.17.0
CountOrphanedIssues count issues without a repo
func CountOrphanedLabels ¶ added in v1.17.0
CountOrphanedLabels return count of labels witch are broken and not accessible via ui anymore
func CountReviews ¶ added in v1.17.0
func CountReviews(opts FindReviewOptions) (int64, error)
CountReviews returns count of reviews passing FindReviewOptions
func CountTrackedTimes ¶ added in v1.17.0
func CountTrackedTimes(opts *FindTrackedTimesOptions) (int64, error)
CountTrackedTimes returns count of tracked times that fit to the given options.
func CountUserStopwatches ¶ added in v1.17.0
CountUserStopwatches return count of all stopwatches of a user
func CreateIssueDependency ¶ added in v1.17.0
func CreateIssueDependency(user *user_model.User, issue, dep *Issue) error
CreateIssueDependency creates a new dependency for an issue
func CreateIssueStopwatch ¶ added in v1.17.0
CreateIssueStopwatch creates a stopwatch if not exist, otherwise return an error
func CreateOrStopIssueStopwatch ¶ added in v1.17.0
func CreateOrStopIssueStopwatch(user *user_model.User, issue *Issue) error
CreateOrStopIssueStopwatch create an issue stopwatch if it's not exist, otherwise finish it
func CreateOrUpdateIssueWatch ¶ added in v1.17.0
CreateOrUpdateIssueWatch set watching for a user and issue
func DeleteComment ¶ added in v1.17.0
DeleteComment deletes the comment
func DeleteCommentReaction ¶ added in v1.17.0
DeleteCommentReaction deletes a reaction on comment.
func DeleteInIssue ¶ added in v1.17.0
DeleteInIssue delete records in beans with external key issue_id = ?
func DeleteIssueLabel ¶ added in v1.17.0
DeleteIssueLabel deletes issue-label relation.
func DeleteIssueReaction ¶ added in v1.17.0
DeleteIssueReaction deletes a reaction on issue.
func DeleteIssueUserTimes ¶ added in v1.17.0
func DeleteIssueUserTimes(issue *Issue, user *user_model.User) error
DeleteIssueUserTimes deletes times for issue
func DeleteIssuesByRepoID ¶ added in v1.17.0
DeleteIssuesByRepoID deletes issues by repositories id
func DeleteLabel ¶ added in v1.17.0
DeleteLabel delete a label
func DeleteLabelsByRepoID ¶ added in v1.17.0
DeleteLabelsByRepoID deletes labels of some repository
func DeleteMilestoneByRepoID ¶ added in v1.17.0
DeleteMilestoneByRepoID deletes a milestone from a repository.
func DeleteOrphanedIssueLabels ¶ added in v1.17.0
DeleteOrphanedIssueLabels delete IssueLabels witch have no label behind anymore
func DeleteOrphanedIssues ¶ added in v1.17.0
DeleteOrphanedIssues delete issues without a repo
func DeleteOrphanedLabels ¶ added in v1.17.0
DeleteOrphanedLabels delete labels witch are broken and not accessible via ui anymore
func DeletePullsByBaseRepoID ¶ added in v1.17.0
DeletePullsByBaseRepoID deletes all pull requests by the base repository ID
func DeleteReaction ¶ added in v1.17.0
func DeleteReaction(ctx context.Context, opts *ReactionOptions) error
DeleteReaction deletes reaction for issue or comment.
func DeleteReview ¶ added in v1.17.0
DeleteReview delete a review and it's code comments
func DeleteTime ¶ added in v1.17.0
func DeleteTime(t *TrackedTime) error
DeleteTime delete a specific Time
func DismissReview ¶ added in v1.17.0
DismissReview change the dismiss status of a review
func FindAndUpdateIssueMentions ¶ added in v1.17.0
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 ¶ added in v1.17.0
FinishIssueStopwatch if stopwatch exist then finish it otherwise return an error
func FinishIssueStopwatchIfPossible ¶ added in v1.17.0
FinishIssueStopwatchIfPossible if stopwatch exist then finish it otherwise ignore
func FixCommentTypeLabelWithEmptyLabel ¶ added in v1.17.0
FixCommentTypeLabelWithEmptyLabel count label comments with empty label
func FixCommentTypeLabelWithOutsideLabels ¶ added in v1.17.0
FixCommentTypeLabelWithOutsideLabels count label comments with outside label
func FixIssueLabelWithOutsideLabels ¶ added in v1.17.0
FixIssueLabelWithOutsideLabels fix label comments with outside label
func GetAssigneeIDsByIssue ¶ added in v1.17.0
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 ¶ added in v1.17.0
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 ¶ added in v1.17.0
GetIssueIDsByRepoID returns all issue ids by repo id
func GetIssueWatchersIDs ¶ added in v1.17.0
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 GetLabelIDsInOrgByNames ¶ added in v1.17.0
GetLabelIDsInOrgByNames returns a list of labelIDs by names in a given organization.
func GetLabelIDsInRepoByNames ¶ added in v1.17.0
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 GetParticipantsIDsByIssueID ¶ added in v1.17.0
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 GetPullRequestIDsByCheckStatus ¶ added in v1.17.0
func GetPullRequestIDsByCheckStatus(status PullRequestStatus) ([]int64, error)
GetPullRequestIDsByCheckStatus returns all pull requests according the special checking status.
func GetRepoIDsForIssuesOptions ¶ added in v1.17.0
func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *user_model.User) ([]int64, error)
GetRepoIDsForIssuesOptions find all repo ids for the given options
func GetRepoIssueStats ¶ added in v1.17.0
GetRepoIssueStats returns number of open and closed repository issues by given filter mode.
func GetTrackedSeconds ¶ added in v1.17.0
func GetTrackedSeconds(ctx context.Context, opts FindTrackedTimesOptions) (trackedSeconds int64, err error)
GetTrackedSeconds return sum of seconds
func HasEnoughApprovals ¶ added in v1.17.0
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 ¶ added in v1.17.0
HasIssueLabel returns true if issue has been labeled.
func HasMilestoneByRepoID ¶ added in v1.17.0
HasMilestoneByRepoID returns if the milestone exists in the repository.
func HasUnmergedPullRequestsByHeadInfo ¶ added in v1.17.0
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 ¶ added in v1.17.0
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 ¶ added in v1.17.0
HasWorkInProgressPrefix determines if the given PR title has a Work In Progress prefix
func InsertReviews ¶ added in v1.17.0
InsertReviews inserts review and review comments
func IsContentEmptyErr ¶ added in v1.17.0
IsContentEmptyErr returns true if err is a ContentEmptyErr
func IsErrCircularDependency ¶ added in v1.17.0
IsErrCircularDependency checks if an error is a ErrCircularDependency.
func IsErrCommentNotExist ¶ added in v1.17.0
IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
func IsErrDependenciesLeft ¶ added in v1.17.0
IsErrDependenciesLeft checks if an error is a ErrDependenciesLeft.
func IsErrDependencyExists ¶ added in v1.17.0
IsErrDependencyExists checks if an error is a ErrDependencyExists.
func IsErrDependencyNotExists ¶ added in v1.17.0
IsErrDependencyNotExists checks if an error is a ErrDependencyExists.
func IsErrErrPullRequestHeadRepoMissing ¶ added in v1.17.0
IsErrErrPullRequestHeadRepoMissing checks if an error is a ErrPullRequestHeadRepoMissing.
func IsErrForbiddenIssueReaction ¶ added in v1.17.0
IsErrForbiddenIssueReaction checks if an error is a ErrForbiddenIssueReaction.
func IsErrIssueIsClosed ¶ added in v1.17.0
IsErrIssueIsClosed checks if an error is a ErrIssueNotExist.
func IsErrIssueMaxPinReached ¶ added in v1.20.0
IsErrIssueMaxPinReached returns if the error is, that the User can't pin more Issues
func IsErrIssueNotExist ¶ added in v1.17.0
IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
func IsErrIssueWasClosed ¶ added in v1.17.0
IsErrIssueWasClosed checks if an error is a ErrIssueWasClosed.
func IsErrLabelNotExist ¶ added in v1.17.0
IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
func IsErrMilestoneNotExist ¶ added in v1.17.0
IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
func IsErrNewIssueInsert ¶ added in v1.17.0
IsErrNewIssueInsert checks if an error is a ErrNewIssueInsert.
func IsErrNotValidReviewRequest ¶ added in v1.17.0
IsErrNotValidReviewRequest checks if an error is a ErrNotValidReviewRequest.
func IsErrOrgLabelNotExist ¶ added in v1.17.0
IsErrOrgLabelNotExist checks if an error is a OrgErrLabelNotExist.
func IsErrPullRequestAlreadyExists ¶ added in v1.17.0
IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
func IsErrPullRequestNotExist ¶ added in v1.17.0
IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
func IsErrPullWasClosed ¶ added in v1.17.0
IsErrPullWasClosed checks if an error is a ErrErrPullWasClosed.
func IsErrReactionAlreadyExist ¶ added in v1.17.0
IsErrReactionAlreadyExist checks if an error is a ErrReactionAlreadyExist.
func IsErrRepoLabelNotExist ¶ added in v1.17.0
IsErrRepoLabelNotExist checks if an error is a RepoErrLabelNotExist.
func IsErrReviewNotExist ¶ added in v1.17.0
IsErrReviewNotExist checks if an error is a ErrReviewNotExist.
func IsErrUnknownDependencyType ¶ added in v1.17.0
IsErrUnknownDependencyType checks if an error is ErrUnknownDependencyType
func IsNewPinAllowed ¶ added in v1.20.0
IsNewPinnedAllowed returns if a new Issue or Pull request can be pinned
func IsOfficialReviewer ¶ added in v1.17.0
func IsOfficialReviewer(ctx context.Context, issue *Issue, reviewers ...*user_model.User) (bool, error)
IsOfficialReviewer check if at least one of the provided reviewers can make official reviews in issue (counts towards required approvals)
func IsOfficialReviewerTeam ¶ added in v1.17.0
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 ¶ added in v1.17.0
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 ¶ added in v1.17.0
func IsUserParticipantsOfIssue(user *user_model.User, issue *Issue) bool
IsUserParticipantsOfIssue return true if user is participants of an issue
func IssueNoDependenciesLeft ¶ added in v1.17.0
IssueNoDependenciesLeft checks if issue can be closed
func KeepLimitedContentHistory ¶ added in v1.17.0
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 LoadIssuesFromBoardList ¶ added in v1.17.0
func LoadIssuesFromBoardList(ctx context.Context, bs project_model.BoardList) (map[int64]IssueList, error)
LoadIssuesFromBoardList load issues assigned to the boards
func LockIssue ¶ added in v1.17.0
func LockIssue(opts *IssueLockOptions) error
LockIssue locks an issue. This would limit commenting abilities to users with write access to the repo
func MakeIDsFromAPIAssigneesToAdd ¶ added in v1.17.0
func MakeIDsFromAPIAssigneesToAdd(ctx context.Context, oneAssignee string, multipleAssignees []string) (assigneeIDs []int64, err error)
MakeIDsFromAPIAssigneesToAdd returns an array with all assignee IDs
func MarkConversation ¶ added in v1.17.0
func MarkConversation(comment *Comment, doer *user_model.User, isResolve bool) (err error)
MarkConversation Add or remove Conversation mark for a code comment
func MarkReviewsAsNotStale ¶ added in v1.17.0
MarkReviewsAsNotStale marks existing reviews as not stale for a giving commit SHA
func MarkReviewsAsStale ¶ added in v1.17.0
MarkReviewsAsStale marks existing reviews as stale
func MergeBlockedByOfficialReviewRequests ¶ added in v1.17.0
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 ¶ added in v1.17.0
func MergeBlockedByOutdatedBranch(protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
MergeBlockedByOutdatedBranch returns true if merge is blocked by an outdated head branch
func MergeBlockedByRejectedReview ¶ added in v1.17.0
func MergeBlockedByRejectedReview(ctx context.Context, protectBranch *git_model.ProtectedBranch, pr *PullRequest) bool
MergeBlockedByRejectedReview returns true if merge is blocked by rejected reviews
func MoveIssueAcrossProjectBoards ¶ added in v1.17.0
func MoveIssueAcrossProjectBoards(issue *Issue, board *project_model.Board) error
MoveIssueAcrossProjectBoards move a card from one board to another
func NewIssue ¶ added in v1.17.0
func NewIssue(repo *repo_model.Repository, issue *Issue, labelIDs []int64, uuids []string) (err error)
NewIssue creates new issue with labels for repository.
func NewIssueLabel ¶ added in v1.17.0
func NewIssueLabel(issue *Issue, label *Label, doer *user_model.User) (err error)
NewIssueLabel creates a new issue-label relation.
func NewIssueLabels ¶ added in v1.17.0
func NewIssueLabels(issue *Issue, labels []*Label, doer *user_model.User) (err error)
NewIssueLabels creates a list of issue-label relations.
func NewIssueUsers ¶ added in v1.17.0
func NewIssueUsers(ctx context.Context, repo *repo_model.Repository, issue *Issue) error
NewIssueUsers inserts an issue related users
func NewIssueWithIndex ¶ added in v1.17.0
func NewIssueWithIndex(ctx context.Context, doer *user_model.User, opts NewIssueOptions) (err error)
NewIssueWithIndex creates issue with given index
func NewMilestone ¶ added in v1.17.0
NewMilestone creates new milestone of repository.
func NewPullRequest ¶ added in v1.17.0
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 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 ¶ added in v1.17.0
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 ¶ added in v1.19.0
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 ¶ added in v1.17.0
func RemoveIssueDependency(user *user_model.User, issue, dep *Issue, depType DependencyType) (err error)
RemoveIssueDependency removes a dependency from an issue
func RemoveIssueWatchersByRepoID ¶ added in v1.17.0
RemoveIssueWatchersByRepoID remove issue watchers by repoID
func ReplaceIssueLabels ¶ added in v1.17.0
func ReplaceIssueLabels(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 ¶ added in v1.17.0
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 ¶ added in v1.17.0
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 SearchIssueIDsByKeyword ¶ added in v1.17.0
func SearchIssueIDsByKeyword(ctx context.Context, kw string, repoIDs []int64, limit, start int) (int64, []int64, error)
SearchIssueIDsByKeyword search issues on database
func SoftDeleteIssueContentHistory ¶
SoftDeleteIssueContentHistory soft delete
func StopwatchExists ¶ added in v1.17.0
StopwatchExists returns true if the stopwatch exists
func SubmitReview ¶ added in v1.17.0
func SubmitReview(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 TotalTimes ¶ added in v1.17.0
func TotalTimes(options *FindTrackedTimesOptions) (map[*user_model.User]string, error)
TotalTimes returns the spent time for each user by an issue
func UnlockIssue ¶ added in v1.17.0
func UnlockIssue(opts *IssueLockOptions) error
UnlockIssue unlocks a previously locked issue.
func UpdateAllowEdits ¶ added in v1.17.0
func UpdateAllowEdits(ctx context.Context, pr *PullRequest) error
UpdateAllowEdits update if PR can be edited from maintainers
func UpdateComment ¶ added in v1.17.0
func UpdateComment(c *Comment, doer *user_model.User) error
UpdateComment updates information of comment.
func UpdateCommentInvalidate ¶ added in v1.18.4
UpdateCommentInvalidate updates comment invalidated column
func UpdateCommentsMigrationsByType ¶ added in v1.17.0
func UpdateCommentsMigrationsByType(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 ¶ added in v1.17.0
UpdateIssueAttachments update attachments by UUIDs for the issue
func UpdateIssueCols ¶ added in v1.17.0
UpdateIssueCols updates cols of issue
func UpdateIssueDeadline ¶ added in v1.17.0
func UpdateIssueDeadline(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 ¶ added in v1.17.0
UpdateIssueMentions updates issue-user relations for mentioned users.
func UpdateIssueUserByRead ¶ added in v1.17.0
UpdateIssueUserByRead updates issue-user relation for reading.
func UpdateIssueUsersByMentions ¶ added in v1.17.0
UpdateIssueUsersByMentions updates issue-user pairs by mentioning.
func UpdateIssuesMigrationsByType ¶ added in v1.17.0
func UpdateIssuesMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, posterID int64) error
UpdateIssuesMigrationsByType updates all migrated repositories' issues from gitServiceType to replace originalAuthorID to posterID
func UpdateLabel ¶ added in v1.17.0
UpdateLabel updates label information.
func UpdateMilestone ¶ added in v1.17.0
UpdateMilestone updates information of given milestone.
func UpdateMilestoneCounters ¶ added in v1.17.0
UpdateMilestoneCounters calculates NumIssues, NumClosesIssues and Completeness
func UpdateReactionsMigrationsByType ¶ added in v1.17.0
func UpdateReactionsMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, userID int64) error
UpdateReactionsMigrationsByType updates all migrated repositories' reactions from gitServiceType to replace originalAuthorID to posterID
func UpdateReviewsMigrationsByType ¶ added in v1.17.0
func UpdateReviewsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error
UpdateReviewsMigrationsByType updates reviews' migrations information via given git service type and original id and poster id
Types ¶
type CodeComments ¶ added in v1.17.0
CodeComments represents comments on code by using this structure: FILENAME -> LINE (+ == proposed; - == previous) -> COMMENTS
func FetchCodeComments ¶ added in v1.17.0
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 Comment ¶ added in v1.17.0
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 DependentIssue *Issue `xorm:"-"` CommitID int64 Line int64 // - previous line / + proposed line TreePath string Content string `xorm:"LONGTEXT"` RenderedContent string `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(40)"` 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 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 ¶ added in v1.17.0
func AddReviewRequest(ctx context.Context, issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
AddReviewRequest add a review request from one reviewer
func AddTeamReviewRequest ¶ added in v1.17.0
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 ChangeIssueStatus ¶ added in v1.17.0
func ChangeIssueStatus(ctx context.Context, issue *Issue, doer *user_model.User, isClosed bool) (*Comment, error)
ChangeIssueStatus changes issue status to open or closed.
func CreateAutoMergeComment ¶ added in v1.17.0
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 ¶ added in v1.17.0
func CreateComment(ctx context.Context, opts *CreateCommentOptions) (_ *Comment, err error)
CreateComment creates comment with context
func FetchCodeCommentsByLine ¶ added in v1.17.0
func FetchCodeCommentsByLine(ctx context.Context, issue *Issue, currentUser *user_model.User, treePath string, line int64, showOutdatedComments bool) ([]*Comment, error)
FetchCodeCommentsByLine fetches the code comments for a given treePath and line number
func GetCommentByID ¶ added in v1.17.0
GetCommentByID returns the comment by given ID.
func RemoveReviewRequest ¶ added in v1.17.0
func RemoveReviewRequest(ctx context.Context, issue *Issue, reviewer, doer *user_model.User) (*Comment, error)
RemoveReviewRequest remove a review request from one reviewer
func RemoveTeamReviewRequest ¶ added in v1.17.0
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 ToggleIssueAssignee ¶ added in v1.17.0
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 UpdateIssueByAPI ¶ added in v1.17.0
func UpdateIssueByAPI(issue *Issue, doer *user_model.User) (statusChangeComment *Comment, titleChanged bool, err error)
UpdateIssueByAPI updates all allowed fields of given issue. If the issue status is changed a statusChangeComment is returned similarly if the title is changed the titleChanged bool is set to true
func (*Comment) AddCrossReferences ¶ added in v1.17.0
func (c *Comment) AddCrossReferences(stdCtx context.Context, doer *user_model.User, removeOld bool) error
AddCrossReferences add cross references
func (*Comment) AfterDelete ¶ added in v1.17.0
func (c *Comment) AfterDelete()
AfterDelete is invoked from XORM after the object is deleted.
func (*Comment) AfterLoad ¶ added in v1.17.0
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*Comment) BeforeInsert ¶ added in v1.17.0
func (c *Comment) BeforeInsert()
BeforeInsert will be invoked by XORM before inserting a record
func (*Comment) BeforeUpdate ¶ added in v1.17.0
func (c *Comment) BeforeUpdate()
BeforeUpdate will be invoked by XORM before updating a record
func (*Comment) CodeCommentLink ¶ added in v1.19.0
CodeCommentLink returns the url to a comment in code
func (*Comment) DiffSide ¶ added in v1.17.0
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) GetExternalID ¶ added in v1.17.0
GetExternalID ExternalUserRemappable interface
func (*Comment) GetExternalName ¶ added in v1.17.0
GetExternalName ExternalUserRemappable interface
func (*Comment) HasOriginalAuthor ¶ added in v1.18.4
HasOriginalAuthor returns if a comment was migrated and has an original author.
func (*Comment) IsResolved ¶ added in v1.17.0
IsResolved check if an code comment is resolved
func (*Comment) LoadAssigneeUserAndTeam ¶ added in v1.17.0
LoadAssigneeUserAndTeam if comment.Type is CommentTypeAssignees, then load assignees
func (*Comment) LoadAttachments ¶ added in v1.17.0
LoadAttachments loads attachments (it never returns error, the error during `GetAttachmentsByCommentIDCtx` is ignored)
func (*Comment) LoadDepIssueDetails ¶ added in v1.17.0
LoadDepIssueDetails loads Dependent Issue Details
func (*Comment) LoadLabel ¶ added in v1.17.0
LoadLabel if comment.Type is CommentTypeLabel, then load Label
func (*Comment) LoadMilestone ¶ added in v1.17.0
LoadMilestone if comment.Type is CommentTypeMilestone, then load milestone
func (*Comment) LoadPoster ¶ added in v1.17.0
LoadPoster loads comment poster
func (*Comment) LoadProject ¶ added in v1.17.0
LoadProject if comment.Type is CommentTypeProject, then load project.
func (*Comment) LoadPushCommits ¶ added in v1.17.0
LoadPushCommits Load push commits
func (*Comment) LoadReactions ¶ added in v1.17.0
func (c *Comment) LoadReactions(repo *repo_model.Repository) error
LoadReactions loads comment reactions
func (*Comment) LoadRefComment ¶ added in v1.17.0
LoadRefComment loads comment that created this reference from database
func (*Comment) LoadRefIssue ¶ added in v1.17.0
LoadRefIssue loads comment that created this reference from database
func (*Comment) LoadResolveDoer ¶ added in v1.17.0
LoadResolveDoer if comment.Type is CommentTypeCode and ResolveDoerID not zero, then load resolveDoer
func (*Comment) LoadReview ¶ added in v1.17.0
LoadReview loads the associated review
func (*Comment) LoadTime ¶ added in v1.17.0
LoadTime loads the associated time for a CommentTypeAddTimeManual
func (*Comment) RefCommentLink ¶ added in v1.19.0
RefCommentLink returns the relative URL for the comment that created this reference
func (*Comment) RefIssueIdent ¶ added in v1.17.0
RefIssueIdent returns the user friendly identity (e.g. "#1234") of the issue where this reference was created
func (*Comment) RefIssueLink ¶ added in v1.19.0
RefIssueLink returns the relative URL of the issue where this reference was created
func (*Comment) RefIssueTitle ¶ added in v1.17.0
RefIssueTitle returns the title of the issue where this reference was created
func (*Comment) RemapExternalUser ¶ added in v1.17.0
RemapExternalUser ExternalUserRemappable interface
func (*Comment) UnsignedLine ¶ added in v1.17.0
UnsignedLine returns the LOC of the code comment without + or -
func (*Comment) UpdateAttachments ¶ added in v1.17.0
UpdateAttachments update attachments by UUIDs for the comment
type CommentList ¶ added in v1.17.0
type CommentList []*Comment
CommentList defines a list of comments
func FindComments ¶ added in v1.17.0
func FindComments(ctx context.Context, opts *FindCommentsOptions) (CommentList, error)
FindComments returns all comments according options
func (CommentList) Issues ¶ added in v1.17.0
func (comments CommentList) Issues() IssueList
Issues returns all the issues of comments
func (CommentList) LoadAttachments ¶ added in v1.17.0
func (comments CommentList) LoadAttachments(ctx context.Context) (err error)
LoadAttachments loads attachments
func (CommentList) LoadAttributes ¶ added in v1.17.0
func (comments CommentList) LoadAttributes() error
LoadAttributes loads attributes of the comments, except for attachments and comments
func (CommentList) LoadIssues ¶ added in v1.17.0
func (comments CommentList) LoadIssues(ctx context.Context) error
LoadIssues loads issues of comments
func (CommentList) LoadPosters ¶ added in v1.17.0
func (comments CommentList) LoadPosters(ctx context.Context) error
LoadPosters loads posters
type CommentType ¶ added in v1.17.0
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 CommentTypeProjectBoard // 31 Project board 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 CommentTypeUnpin // 37 unpin Issue )
const CommentTypeUndefined CommentType = -1
CommentTypeUndefined is used to search for comments of any type
func AsCommentType ¶ added in v1.19.0
func AsCommentType(typeName string) CommentType
func (CommentType) HasAttachmentSupport ¶ added in v1.19.2
func (t CommentType) HasAttachmentSupport() bool
func (CommentType) HasContentSupport ¶ added in v1.19.2
func (t CommentType) HasContentSupport() bool
func (CommentType) String ¶ added in v1.17.0
func (t CommentType) String() string
type ContentEmptyErr ¶ added in v1.17.0
type ContentEmptyErr struct{}
ContentEmptyErr represents an content empty error
func (ContentEmptyErr) Error ¶ added in v1.17.0
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, 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 ¶ added in v1.17.0
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 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 ¶ added in v1.17.0
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 ¶ added in v1.17.0
type DependencyInfo struct { Issue `xorm:"extends"` repo_model.Repository `xorm:"extends"` }
DependencyInfo represents high level information about an issue which is a dependency of another issue.
type DependencyType ¶ added in v1.17.0
type DependencyType int
DependencyType Defines Dependency Type Constants
const ( DependencyTypeBlockedBy DependencyType = iota DependencyTypeBlocking )
Define Dependency Types
type ErrCircularDependency ¶ added in v1.17.0
ErrCircularDependency represents a "DependencyCircular" kind of error.
func (ErrCircularDependency) Error ¶ added in v1.17.0
func (err ErrCircularDependency) Error() string
type ErrCommentNotExist ¶ added in v1.17.0
ErrCommentNotExist represents a "CommentNotExist" kind of error.
func (ErrCommentNotExist) Error ¶ added in v1.17.0
func (err ErrCommentNotExist) Error() string
func (ErrCommentNotExist) Unwrap ¶ added in v1.17.4
func (err ErrCommentNotExist) Unwrap() error
type ErrDependenciesLeft ¶ added in v1.17.0
type ErrDependenciesLeft struct {
IssueID int64
}
ErrDependenciesLeft represents an error where the issue you're trying to close still has dependencies left.
func (ErrDependenciesLeft) Error ¶ added in v1.17.0
func (err ErrDependenciesLeft) Error() string
type ErrDependencyExists ¶ added in v1.17.0
ErrDependencyExists represents a "DependencyAlreadyExists" kind of error.
func (ErrDependencyExists) Error ¶ added in v1.17.0
func (err ErrDependencyExists) Error() string
func (ErrDependencyExists) Unwrap ¶ added in v1.17.4
func (err ErrDependencyExists) Unwrap() error
type ErrDependencyNotExists ¶ added in v1.17.0
ErrDependencyNotExists represents a "DependencyAlreadyExists" kind of error.
func (ErrDependencyNotExists) Error ¶ added in v1.17.0
func (err ErrDependencyNotExists) Error() string
func (ErrDependencyNotExists) Unwrap ¶ added in v1.17.4
func (err ErrDependencyNotExists) Unwrap() error
type ErrForbiddenIssueReaction ¶ added in v1.17.0
type ErrForbiddenIssueReaction struct {
Reaction string
}
ErrForbiddenIssueReaction is used when a forbidden reaction was try to created
func (ErrForbiddenIssueReaction) Error ¶ added in v1.17.0
func (err ErrForbiddenIssueReaction) Error() string
func (ErrForbiddenIssueReaction) Unwrap ¶ added in v1.17.4
func (err ErrForbiddenIssueReaction) Unwrap() error
type ErrIssueContentHistoryNotExist ¶
type ErrIssueContentHistoryNotExist struct {
ID int64
}
ErrIssueContentHistoryNotExist not exist error
func (ErrIssueContentHistoryNotExist) Error ¶
func (err ErrIssueContentHistoryNotExist) Error() string
Error error string
func (ErrIssueContentHistoryNotExist) Unwrap ¶ added in v1.17.4
func (err ErrIssueContentHistoryNotExist) Unwrap() error
type ErrIssueIsClosed ¶ added in v1.17.0
ErrIssueIsClosed represents a "IssueIsClosed" kind of error.
func (ErrIssueIsClosed) Error ¶ added in v1.17.0
func (err ErrIssueIsClosed) Error() string
type ErrIssueNotExist ¶ added in v1.17.0
ErrIssueNotExist represents a "IssueNotExist" kind of error.
func (ErrIssueNotExist) Error ¶ added in v1.17.0
func (err ErrIssueNotExist) Error() string
func (ErrIssueNotExist) Unwrap ¶ added in v1.17.4
func (err ErrIssueNotExist) Unwrap() error
type ErrIssueStopwatchAlreadyExist ¶ added in v1.17.0
ErrIssueStopwatchAlreadyExist represents an error that stopwatch is already exist
func (ErrIssueStopwatchAlreadyExist) Error ¶ added in v1.17.0
func (err ErrIssueStopwatchAlreadyExist) Error() string
func (ErrIssueStopwatchAlreadyExist) Unwrap ¶ added in v1.17.4
func (err ErrIssueStopwatchAlreadyExist) Unwrap() error
type ErrIssueStopwatchNotExist ¶ added in v1.17.0
ErrIssueStopwatchNotExist represents an error that stopwatch is not exist
func (ErrIssueStopwatchNotExist) Error ¶ added in v1.17.0
func (err ErrIssueStopwatchNotExist) Error() string
func (ErrIssueStopwatchNotExist) Unwrap ¶ added in v1.17.4
func (err ErrIssueStopwatchNotExist) Unwrap() error
type ErrIssueWasClosed ¶ added in v1.17.0
ErrIssueWasClosed is used when close a closed issue
func (ErrIssueWasClosed) Error ¶ added in v1.17.0
func (err ErrIssueWasClosed) Error() string
type ErrLabelNotExist ¶ added in v1.17.0
type ErrLabelNotExist struct {
LabelID int64
}
ErrLabelNotExist represents a "LabelNotExist" kind of error.
func (ErrLabelNotExist) Error ¶ added in v1.17.0
func (err ErrLabelNotExist) Error() string
func (ErrLabelNotExist) Unwrap ¶ added in v1.17.4
func (err ErrLabelNotExist) Unwrap() error
type ErrMilestoneNotExist ¶ added in v1.17.0
ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
func (ErrMilestoneNotExist) Error ¶ added in v1.17.0
func (err ErrMilestoneNotExist) Error() string
func (ErrMilestoneNotExist) Unwrap ¶ added in v1.17.4
func (err ErrMilestoneNotExist) Unwrap() error
type ErrNewIssueInsert ¶ added in v1.17.0
type ErrNewIssueInsert struct {
OriginalError error
}
ErrNewIssueInsert is used when the INSERT statement in newIssue fails
func (ErrNewIssueInsert) Error ¶ added in v1.17.0
func (err ErrNewIssueInsert) Error() string
type ErrNotValidReviewRequest ¶ added in v1.17.0
ErrNotValidReviewRequest an not allowed review request modify
func (ErrNotValidReviewRequest) Error ¶ added in v1.17.0
func (err ErrNotValidReviewRequest) Error() string
func (ErrNotValidReviewRequest) Unwrap ¶ added in v1.17.4
func (err ErrNotValidReviewRequest) Unwrap() error
type ErrOrgLabelNotExist ¶ added in v1.17.0
ErrOrgLabelNotExist represents a "OrgLabelNotExist" kind of error.
func (ErrOrgLabelNotExist) Error ¶ added in v1.17.0
func (err ErrOrgLabelNotExist) Error() string
func (ErrOrgLabelNotExist) Unwrap ¶ added in v1.17.4
func (err ErrOrgLabelNotExist) Unwrap() error
type ErrPullRequestAlreadyExists ¶ added in v1.17.0
type ErrPullRequestAlreadyExists struct { ID int64 IssueID int64 HeadRepoID int64 BaseRepoID int64 HeadBranch string BaseBranch string }
ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error
func (ErrPullRequestAlreadyExists) Error ¶ added in v1.17.0
func (err ErrPullRequestAlreadyExists) Error() string
Error does pretty-printing :D
func (ErrPullRequestAlreadyExists) Unwrap ¶ added in v1.17.4
func (err ErrPullRequestAlreadyExists) Unwrap() error
type ErrPullRequestHeadRepoMissing ¶ added in v1.17.0
ErrPullRequestHeadRepoMissing represents a "ErrPullRequestHeadRepoMissing" error
func (ErrPullRequestHeadRepoMissing) Error ¶ added in v1.17.0
func (err ErrPullRequestHeadRepoMissing) Error() string
Error does pretty-printing :D
type ErrPullRequestNotExist ¶ added in v1.17.0
type ErrPullRequestNotExist struct { ID int64 IssueID int64 HeadRepoID int64 BaseRepoID int64 HeadBranch string BaseBranch string }
ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
func (ErrPullRequestNotExist) Error ¶ added in v1.17.0
func (err ErrPullRequestNotExist) Error() string
func (ErrPullRequestNotExist) Unwrap ¶ added in v1.17.4
func (err ErrPullRequestNotExist) Unwrap() error
type ErrPullWasClosed ¶ added in v1.17.0
ErrPullWasClosed is used close a closed pull request
func (ErrPullWasClosed) Error ¶ added in v1.17.0
func (err ErrPullWasClosed) Error() string
type ErrReactionAlreadyExist ¶ added in v1.17.0
type ErrReactionAlreadyExist struct {
Reaction string
}
ErrReactionAlreadyExist is used when a existing reaction was try to created
func (ErrReactionAlreadyExist) Error ¶ added in v1.17.0
func (err ErrReactionAlreadyExist) Error() string
func (ErrReactionAlreadyExist) Unwrap ¶ added in v1.17.4
func (err ErrReactionAlreadyExist) Unwrap() error
type ErrRepoLabelNotExist ¶ added in v1.17.0
ErrRepoLabelNotExist represents a "RepoLabelNotExist" kind of error.
func (ErrRepoLabelNotExist) Error ¶ added in v1.17.0
func (err ErrRepoLabelNotExist) Error() string
func (ErrRepoLabelNotExist) Unwrap ¶ added in v1.17.4
func (err ErrRepoLabelNotExist) Unwrap() error
type ErrReviewNotExist ¶ added in v1.17.0
type ErrReviewNotExist struct {
ID int64
}
ErrReviewNotExist represents a "ReviewNotExist" kind of error.
func (ErrReviewNotExist) Error ¶ added in v1.17.0
func (err ErrReviewNotExist) Error() string
func (ErrReviewNotExist) Unwrap ¶ added in v1.17.4
func (err ErrReviewNotExist) Unwrap() error
type ErrUnknownDependencyType ¶ added in v1.17.0
type ErrUnknownDependencyType struct {
Type DependencyType
}
ErrUnknownDependencyType represents an error where an unknown dependency type was passed
func (ErrUnknownDependencyType) Error ¶ added in v1.17.0
func (err ErrUnknownDependencyType) Error() string
func (ErrUnknownDependencyType) Unwrap ¶ added in v1.17.4
func (err ErrUnknownDependencyType) Unwrap() error
type FindCommentsOptions ¶ added in v1.17.0
type FindCommentsOptions struct { db.ListOptions RepoID int64 IssueID int64 ReviewID int64 Since int64 Before int64 Line int64 TreePath string Type CommentType IssueIDs []int64 Invalidated util.OptionalBool }
FindCommentsOptions describes the conditions to Find comments
func (*FindCommentsOptions) ToConds ¶ added in v1.18.4
func (opts *FindCommentsOptions) ToConds() builder.Cond
ToConds implements FindOptions interface
type FindReactionsOptions ¶ added in v1.17.0
type FindReactionsOptions struct { db.ListOptions IssueID int64 CommentID int64 UserID int64 Reaction string }
FindReactionsOptions describes the conditions to Find reactions
type FindReviewOptions ¶ added in v1.17.0
type FindReviewOptions struct { db.ListOptions Type ReviewType IssueID int64 ReviewerID int64 OfficialOnly bool Dismissed util.OptionalBool }
FindReviewOptions represent possible filters to find reviews
type FindTrackedTimesOptions ¶ added in v1.17.0
type FindTrackedTimesOptions struct { db.ListOptions IssueID int64 UserID int64 RepositoryID int64 MilestoneID int64 CreatedAfterUnix int64 CreatedBeforeUnix int64 }
FindTrackedTimesOptions represent the filters for tracked times. If an ID is 0 it will be ignored.
type GetMilestonesOption ¶ added in v1.17.0
type GetMilestonesOption struct { db.ListOptions RepoID int64 State api.StateType Name string SortType string }
GetMilestonesOption contain options to get milestones
type Issue ¶ added in v1.17.0
type Issue struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX UNIQUE(repo_index)"` Repo *repo_model.Repository `xorm:"-"` Index int64 `xorm:"UNIQUE(repo_index)"` // Index in one repository. PosterID int64 `xorm:"INDEX"` Poster *user_model.User `xorm:"-"` OriginalAuthor string OriginalAuthorID int64 `xorm:"index"` Title string `xorm:"name"` Content string `xorm:"LONGTEXT"` RenderedContent string `xorm:"-"` Labels []*Label `xorm:"-"` MilestoneID int64 `xorm:"INDEX"` Milestone *Milestone `xorm:"-"` Project *project_model.Project `xorm:"-"` Priority int AssigneeID int64 `xorm:"-"` Assignee *user_model.User `xorm:"-"` IsClosed bool `xorm:"INDEX"` IsRead bool `xorm:"-"` IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not. PullRequest *PullRequest `xorm:"-"` NumComments int Ref string PinOrder int `xorm:"DEFAULT 0"` DeadlineUnix timeutil.TimeStamp `xorm:"INDEX"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` ClosedUnix timeutil.TimeStamp `xorm:"INDEX"` Attachments []*repo_model.Attachment `xorm:"-"` Comments CommentList `xorm:"-"` Reactions ReactionList `xorm:"-"` TotalTrackedTime int64 `xorm:"-"` Assignees []*user_model.User `xorm:"-"` // IsLocked limits commenting abilities to users on an issue // with write access IsLocked bool `xorm:"NOT NULL DEFAULT false"` // For view issue page. ShowRole RoleDescriptor `xorm:"-"` }
Issue represents an issue or pull request of repository.
func GetIssueByID ¶ added in v1.17.0
GetIssueByID returns an issue by given ID.
func GetIssueByIndex ¶ added in v1.17.0
GetIssueByIndex returns raw issue without loading attributes by index in a repository.
func GetIssueWithAttrsByID ¶ added in v1.17.0
GetIssueWithAttrsByID returns an issue with attributes by given ID.
func GetIssueWithAttrsByIndex ¶ added in v1.17.0
GetIssueWithAttrsByIndex returns issue by index in a repository.
func GetPinnedIssues ¶ added in v1.20.0
GetPinnedIssues returns the pinned Issues for the given Repo and type
func Issues ¶ added in v1.17.0
func Issues(ctx context.Context, opts *IssuesOptions) ([]*Issue, error)
Issues returns a list of issues by given conditions.
func (*Issue) AddCrossReferences ¶ added in v1.17.0
func (issue *Issue) AddCrossReferences(stdCtx context.Context, doer *user_model.User, removeOld bool) error
AddCrossReferences add cross repositories references.
func (*Issue) BlockedByDependencies ¶ added in v1.17.0
func (issue *Issue) BlockedByDependencies(ctx context.Context, opts db.ListOptions) (issueDeps []*DependencyInfo, err error)
BlockedByDependencies finds all Dependencies an issue is blocked by
func (*Issue) BlockingDependencies ¶ added in v1.17.0
func (issue *Issue) BlockingDependencies(ctx context.Context) (issueDeps []*DependencyInfo, err error)
BlockingDependencies returns all blocking dependencies, aka all other issues a given issue blocks
func (*Issue) GetExternalID ¶ added in v1.17.0
GetExternalID ExternalUserRemappable interface
func (*Issue) GetExternalName ¶ added in v1.17.0
GetExternalName ExternalUserRemappable interface
func (*Issue) GetLastComment ¶ added in v1.17.0
GetLastComment return last comment for the current issue.
func (*Issue) GetLastEventLabel ¶ added in v1.17.0
GetLastEventLabel returns the localization label for the current issue.
func (*Issue) GetLastEventLabelFake ¶ added in v1.17.0
GetLastEventLabelFake returns the localization label for the current issue without providing a link in the username.
func (*Issue) GetLastEventTimestamp ¶ added in v1.17.0
GetLastEventTimestamp returns the last user visible event timestamp, either the creation of this issue or the close.
func (*Issue) GetParticipantIDsByIssue ¶ added in v1.17.0
GetParticipantIDsByIssue returns all userIDs who are participated in comments of an issue and issue author
func (*Issue) GetPullRequest ¶ added in v1.17.0
func (issue *Issue) GetPullRequest() (pr *PullRequest, err error)
GetPullRequest returns the issue pull request
func (*Issue) GetTasks ¶ added in v1.17.0
GetTasks returns the amount of tasks in the issues content
func (*Issue) GetTasksDone ¶ added in v1.17.0
GetTasksDone returns the amount of completed tasks in the issues content
func (*Issue) HasOriginalAuthor ¶ added in v1.18.4
HasOriginalAuthor returns if an issue was migrated and has an original author.
func (*Issue) IsTimetrackerEnabled ¶ added in v1.17.0
IsTimetrackerEnabled returns true if the repo enables timetracking
func (*Issue) LoadAssignees ¶ added in v1.17.0
LoadAssignees load assignees of this issue.
func (*Issue) LoadAttributes ¶ added in v1.17.0
LoadAttributes loads the attribute of this issue.
func (*Issue) LoadDiscussComments ¶ added in v1.17.0
LoadDiscussComments loads discuss comments
func (*Issue) LoadLabels ¶ added in v1.17.0
LoadLabels loads labels
func (*Issue) LoadMilestone ¶ added in v1.17.0
LoadMilestone load milestone of this issue.
func (*Issue) LoadPoster ¶ added in v1.17.0
LoadPoster loads poster
func (*Issue) LoadProject ¶ added in v1.17.0
LoadProject load the project the issue was assigned to
func (*Issue) LoadPullRequest ¶ added in v1.17.0
LoadPullRequest loads pull request info
func (*Issue) LoadTotalTimes ¶ added in v1.17.0
LoadTotalTimes load total tracked time
func (*Issue) PinOrUnpin ¶ added in v1.20.0
PinOrUnpin pins or unpins a Issue
func (*Issue) ProjectBoardID ¶ added in v1.17.0
ProjectBoardID return project board id if issue was assigned to one
func (*Issue) RemapExternalUser ¶ added in v1.17.0
RemapExternalUser ExternalUserRemappable interface
type IssueAssignees ¶ added in v1.17.0
type IssueAssignees struct { ID int64 `xorm:"pk autoincr"` AssigneeID int64 `xorm:"INDEX"` IssueID int64 `xorm:"INDEX"` }
IssueAssignees saves all issue assignees
type IssueContentListItem ¶
type IssueContentListItem struct { UserID int64 UserName string UserFullName string UserAvatarLink string HistoryID int64 EditedUnix timeutil.TimeStamp IsFirstCreated bool IsDeleted bool }
IssueContentListItem the list for web ui
func FetchIssueContentHistoryList ¶
func FetchIssueContentHistoryList(dbCtx context.Context, issueID, commentID int64) ([]*IssueContentListItem, error)
FetchIssueContentHistoryList fetch list
type IssueDependency ¶ added in v1.17.0
type IssueDependency struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"NOT NULL"` IssueID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL"` DependencyID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL"` CreatedUnix timeutil.TimeStamp `xorm:"created"` UpdatedUnix timeutil.TimeStamp `xorm:"updated"` }
IssueDependency represents an issue dependency
type IssueIndex ¶ added in v1.17.0
type IssueIndex db.ResourceIndex
IssueIndex represents the issue index table
type IssueLabel ¶ added in v1.17.0
type IssueLabel struct { ID int64 `xorm:"pk autoincr"` IssueID int64 `xorm:"UNIQUE(s)"` LabelID int64 `xorm:"UNIQUE(s)"` }
IssueLabel represents an issue-label relation.
type IssueList ¶ added in v1.17.0
type IssueList []*Issue
IssueList defines a list of issues
func GetIssuesByIDs ¶ added in v1.17.0
GetIssuesByIDs return issues with the given IDs.
func LoadIssuesFromBoard ¶ added in v1.17.0
LoadIssuesFromBoard load issues assigned to this board
func (IssueList) GetApprovalCounts ¶ added in v1.17.0
GetApprovalCounts returns a map of issue ID to slice of approval counts FIXME: only returns official counts due to double counting of non-official approvals
func (IssueList) LoadAttachments ¶ added in v1.17.0
LoadAttachments loads attachments
func (IssueList) LoadAttributes ¶ added in v1.17.0
LoadAttributes loads attributes of the issues, except for attachments and comments
func (IssueList) LoadComments ¶ added in v1.17.0
LoadComments loads comments
func (IssueList) LoadDiscussComments ¶ added in v1.17.0
LoadDiscussComments loads discuss comments
func (IssueList) LoadProjects ¶ added in v1.20.0
func (IssueList) LoadPullRequests ¶ added in v1.17.0
LoadPullRequests loads pull requests
func (IssueList) LoadRepositories ¶ added in v1.17.0
func (issues IssueList) LoadRepositories(ctx context.Context) (repo_model.RepositoryList, error)
LoadRepositories loads issues' all repositories
type IssueLockOptions ¶ added in v1.17.0
type IssueLockOptions struct { Doer *user_model.User Issue *Issue Reason string }
IssueLockOptions defines options for locking and/or unlocking an issue/PR
type IssueStats ¶ added in v1.17.0
type IssueStats struct {
OpenCount, ClosedCount int64
YourRepositoriesCount int64
AssignCount int64
CreateCount int64
MentionCount int64
ReviewRequestedCount int64
ReviewedCount int64
}
IssueStats represents issue statistic information.
func GetIssueStats ¶ added in v1.17.0
func GetIssueStats(opts *IssuesOptions) (*IssueStats, error)
GetIssueStats returns issue statistic information by given conditions.
func GetUserIssueStats ¶ added in v1.17.0
func GetUserIssueStats(filterMode int, opts IssuesOptions) (*IssueStats, error)
GetUserIssueStats returns issue statistic information for dashboard by given conditions.
type IssueUser ¶ added in v1.17.0
type IssueUser struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"INDEX"` // User ID. IssueID int64 IsRead bool IsMentioned bool }
IssueUser represents an issue-user relation.
type IssueWatch ¶ added in v1.17.0
type IssueWatch struct { ID int64 `xorm:"pk autoincr"` UserID int64 `xorm:"UNIQUE(watch) NOT NULL"` IssueID int64 `xorm:"UNIQUE(watch) NOT NULL"` IsWatching bool `xorm:"NOT NULL"` CreatedUnix timeutil.TimeStamp `xorm:"created NOT NULL"` UpdatedUnix timeutil.TimeStamp `xorm:"updated NOT NULL"` }
IssueWatch is connection request for receiving issue notification.
func GetIssueWatch ¶ added in v1.17.0
func GetIssueWatch(ctx context.Context, userID, issueID int64) (iw *IssueWatch, exists bool, err error)
GetIssueWatch returns all IssueWatch objects from db by user and issue the current Web-UI need iw object for watchers AND explicit non-watchers
type IssueWatchList ¶ added in v1.17.0
type IssueWatchList []*IssueWatch
IssueWatchList contains IssueWatch
func GetIssueWatchers ¶ added in v1.17.0
func GetIssueWatchers(ctx context.Context, issueID int64, listOptions db.ListOptions) (IssueWatchList, error)
GetIssueWatchers returns watchers/unwatchers of a given issue
type IssuesOptions ¶ added in v1.17.0
type IssuesOptions struct { db.ListOptions RepoIDs []int64 // overwrites RepoCond if the length is not 0 RepoCond builder.Cond AssigneeID int64 PosterID int64 MentionedID int64 ReviewRequestedID int64 ReviewedID int64 SubscriberID int64 MilestoneIDs []int64 ProjectID int64 ProjectBoardID int64 IsClosed util.OptionalBool IsPull util.OptionalBool LabelIDs []int64 IncludedLabelNames []string ExcludedLabelNames []string IncludeMilestones []string SortType string IssueIDs []int64 UpdatedAfterUnix int64 UpdatedBeforeUnix int64 // prioritize issues from this repo PriorityRepoID int64 IsArchived util.OptionalBool Org *organization.Organization // issues permission scope Team *organization.Team // issues permission scope User *user_model.User // issues permission scope }
IssuesOptions represents options of an issue.
type Label ¶ added in v1.17.0
type Label struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX"` OrgID int64 `xorm:"INDEX"` Name string Exclusive bool Description string Color string `xorm:"VARCHAR(7)"` NumIssues int NumClosedIssues int CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` NumOpenIssues int `xorm:"-"` NumOpenRepoIssues int64 `xorm:"-"` IsChecked bool `xorm:"-"` QueryString string `xorm:"-"` IsSelected bool `xorm:"-"` IsExcluded bool `xorm:"-"` }
Label represents a label of repository for issues.
func GetLabelByID ¶ added in v1.17.0
GetLabelByID returns a label by given ID.
func GetLabelInOrgByID ¶ added in v1.17.0
GetLabelInOrgByID returns a label by ID in given organization.
func GetLabelInOrgByName ¶ added in v1.17.0
GetLabelInOrgByName returns a label by name in given organization.
func GetLabelInRepoByID ¶ added in v1.17.0
GetLabelInRepoByID returns a label by ID in given repository.
func GetLabelInRepoByName ¶ added in v1.17.0
GetLabelInRepoByName returns a label by name in given repository.
func GetLabelsByIDs ¶ added in v1.17.0
GetLabelsByIDs returns a list of labels by IDs
func GetLabelsByIssueID ¶ added in v1.17.0
GetLabelsByIssueID returns all labels that belong to given issue by ID.
func GetLabelsByOrgID ¶ added in v1.17.0
func GetLabelsByOrgID(ctx context.Context, orgID int64, sortType string, listOptions db.ListOptions) ([]*Label, error)
GetLabelsByOrgID returns all labels that belong to given organization by ID.
func GetLabelsByRepoID ¶ added in v1.17.0
func GetLabelsByRepoID(ctx context.Context, repoID int64, sortType string, listOptions db.ListOptions) ([]*Label, error)
GetLabelsByRepoID returns all labels that belong to given repository by ID.
func GetLabelsInOrgByIDs ¶ added in v1.17.0
GetLabelsInOrgByIDs returns a list of labels by IDs in given organization, it silently ignores label IDs that do not belong to the organization.
func GetLabelsInRepoByIDs ¶ added in v1.17.0
GetLabelsInRepoByIDs returns a list of labels by IDs in given repository, it silently ignores label IDs that do not belong to the repository.
func RemoveDuplicateExclusiveLabels ¶ added in v1.19.0
Ensure only one label of a given scope exists, with labels at the end of the array getting preference over earlier ones.
func (*Label) BelongsToOrg ¶ added in v1.17.0
BelongsToOrg returns true if label is an organization label
func (*Label) BelongsToRepo ¶ added in v1.17.0
BelongsToRepo returns true if label is a repository label
func (*Label) CalOpenIssues ¶ added in v1.17.0
func (l *Label) CalOpenIssues()
CalOpenIssues sets the number of open issues of a label based on the already stored number of closed issues.
func (*Label) CalOpenOrgIssues ¶ added in v1.17.0
CalOpenOrgIssues calculates the open issues of a label for a specific repo
func (*Label) ExclusiveScope ¶ added in v1.19.0
Return scope substring of label name, or empty string if none exists
func (*Label) LoadSelectedLabelsAfterClick ¶ added in v1.17.0
func (l *Label) LoadSelectedLabelsAfterClick(currentSelectedLabels []int64, currentSelectedExclusiveScopes []string)
LoadSelectedLabelsAfterClick calculates the set of selected labels when a label is clicked
type Milestone ¶ added in v1.17.0
type Milestone struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX"` Repo *repo_model.Repository `xorm:"-"` Name string Content string `xorm:"TEXT"` RenderedContent string `xorm:"-"` IsClosed bool NumIssues int NumClosedIssues int NumOpenIssues int `xorm:"-"` Completeness int // Percentage(1-100). IsOverdue bool `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` DeadlineUnix timeutil.TimeStamp ClosedDateUnix timeutil.TimeStamp DeadlineString string `xorm:"-"` TotalTrackedTime int64 `xorm:"-"` }
Milestone represents a milestone of repository.
func GetMilestoneByRepoID ¶ added in v1.17.0
GetMilestoneByRepoID returns the milestone in a repository.
func GetMilestoneByRepoIDANDName ¶ added in v1.17.0
GetMilestoneByRepoIDANDName return a milestone if one exist by name and repo
func (*Milestone) AfterLoad ¶ added in v1.17.0
func (m *Milestone) AfterLoad()
AfterLoad is invoked from XORM after setting the value of a field of this object.
func (*Milestone) BeforeUpdate ¶ added in v1.17.0
func (m *Milestone) BeforeUpdate()
BeforeUpdate is invoked from XORM before updating this object.
func (*Milestone) LoadTotalTrackedTime ¶ added in v1.17.0
LoadTotalTrackedTime loads the tracked time for the milestone
type MilestoneList ¶ added in v1.17.0
type MilestoneList []*Milestone
MilestoneList is a list of milestones offering additional functionality
func GetMilestones ¶ added in v1.17.0
func GetMilestones(opts GetMilestonesOption) (MilestoneList, int64, error)
GetMilestones returns milestones filtered by GetMilestonesOption's
func GetMilestonesByRepoIDs ¶ added in v1.17.0
func GetMilestonesByRepoIDs(repoIDs []int64, page int, isClosed bool, sortType string) (MilestoneList, error)
GetMilestonesByRepoIDs returns a list of milestones of given repositories and status.
func SearchMilestones ¶ added in v1.17.0
func SearchMilestones(repoCond builder.Cond, page int, isClosed bool, sortType, keyword string) (MilestoneList, error)
SearchMilestones search milestones
func (MilestoneList) LoadTotalTrackedTimes ¶ added in v1.17.0
func (milestones MilestoneList) LoadTotalTrackedTimes() error
LoadTotalTrackedTimes loads for every milestone in the list the TotalTrackedTime by a batch request
type MilestonesStats ¶ added in v1.17.0
type MilestonesStats struct {
OpenCount, ClosedCount int64
}
MilestonesStats represents milestone statistic information.
func GetMilestonesStatsByRepoCond ¶ added in v1.17.0
func GetMilestonesStatsByRepoCond(repoCond builder.Cond) (*MilestonesStats, error)
GetMilestonesStatsByRepoCond returns milestone statistic information for dashboard by given conditions.
func GetMilestonesStatsByRepoCondAndKw ¶ added in v1.17.0
func GetMilestonesStatsByRepoCondAndKw(repoCond builder.Cond, keyword string) (*MilestonesStats, error)
GetMilestonesStatsByRepoCondAndKw returns milestone statistic information for dashboard by given repo conditions and name keyword.
func (MilestonesStats) Total ¶ added in v1.17.0
func (m MilestonesStats) Total() int64
Total returns the total counts of milestones
type NewIssueOptions ¶ added in v1.17.0
type NewIssueOptions struct { Repo *repo_model.Repository Issue *Issue LabelIDs []int64 Attachments []string // In UUID format. IsPull bool }
NewIssueOptions represents the options of a new issue.
type PullRequest ¶ added in v1.17.0
type PullRequest struct { ID int64 `xorm:"pk autoincr"` Type PullRequestType Status PullRequestStatus ConflictedFiles []string `xorm:"TEXT JSON"` CommitsAhead int CommitsBehind int ChangedProtectedFiles []string `xorm:"TEXT JSON"` IssueID int64 `xorm:"INDEX"` Issue *Issue `xorm:"-"` Index int64 RequestedReviewers []*user_model.User `xorm:"-"` HeadRepoID int64 `xorm:"INDEX"` HeadRepo *repo_model.Repository `xorm:"-"` BaseRepoID int64 `xorm:"INDEX"` BaseRepo *repo_model.Repository `xorm:"-"` HeadBranch string HeadCommitID string `xorm:"-"` BaseBranch string MergeBase string `xorm:"VARCHAR(40)"` AllowMaintainerEdit bool `xorm:"NOT NULL DEFAULT false"` HasMerged bool `xorm:"INDEX"` MergedCommitID string `xorm:"VARCHAR(40)"` MergerID int64 `xorm:"INDEX"` Merger *user_model.User `xorm:"-"` MergedUnix timeutil.TimeStamp `xorm:"updated INDEX"` Flow PullRequestFlow `xorm:"NOT NULL DEFAULT 0"` // contains filtered or unexported fields }
PullRequest represents relation between pull request and repositories.
func GetAllUnmergedAgitPullRequestByPoster ¶ added in v1.17.0
func GetAllUnmergedAgitPullRequestByPoster(ctx context.Context, uid int64) ([]*PullRequest, error)
GetAllUnmergedAgitPullRequestByPoster get all unmerged agit flow pull request By poster id.
func GetLatestPullRequestByHeadInfo ¶ added in v1.17.0
func GetLatestPullRequestByHeadInfo(repoID int64, branch string) (*PullRequest, error)
GetLatestPullRequestByHeadInfo returns the latest pull request (regardless of its status) by given head information (repo and branch).
func GetPullRequestByID ¶ added in v1.17.0
func GetPullRequestByID(ctx context.Context, id int64) (*PullRequest, error)
GetPullRequestByID returns a pull request by given ID.
func GetPullRequestByIndex ¶ added in v1.17.0
func GetPullRequestByIndex(ctx context.Context, repoID, index int64) (*PullRequest, error)
GetPullRequestByIndex returns a pull request by the given index
func GetPullRequestByIssueID ¶ added in v1.17.0
func GetPullRequestByIssueID(ctx context.Context, issueID int64) (*PullRequest, error)
GetPullRequestByIssueID returns pull request by given issue ID.
func GetPullRequestByIssueIDWithNoAttributes ¶ added in v1.17.0
func GetPullRequestByIssueIDWithNoAttributes(issueID int64) (*PullRequest, error)
GetPullRequestByIssueIDWithNoAttributes returns pull request with no attributes loaded by given issue ID.
func GetPullRequestsByHeadBranch ¶ added in v1.17.0
func GetPullRequestsByHeadBranch(ctx context.Context, headBranch string, headRepoID int64) ([]*PullRequest, error)
GetPullRequestsByHeadBranch returns all prs by head branch Since there could be multiple prs with the same head branch, this function returns a slice of prs
func GetUnmergedPullRequest ¶ added in v1.17.0
func GetUnmergedPullRequest(ctx context.Context, headRepoID, baseRepoID int64, headBranch, baseBranch string, flow PullRequestFlow) (*PullRequest, error)
GetUnmergedPullRequest returns a pull request that is open and has not been merged by given head/base and repo/branch.
func GetUnmergedPullRequestsByBaseInfo ¶ added in v1.17.0
func GetUnmergedPullRequestsByBaseInfo(repoID int64, branch string) ([]*PullRequest, error)
GetUnmergedPullRequestsByBaseInfo returns all pull requests that are open and has not been merged by given base information (repo and branch).
func GetUnmergedPullRequestsByHeadInfo ¶ added in v1.17.0
func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequest, error)
GetUnmergedPullRequestsByHeadInfo returns all pull requests that are open and has not been merged
func PullRequests ¶ added in v1.17.0
func PullRequests(baseRepoID int64, opts *PullRequestsOptions) ([]*PullRequest, int64, error)
PullRequests returns all pull requests for a base Repo by the given conditions
func (*PullRequest) CanAutoMerge ¶ added in v1.17.0
func (pr *PullRequest) CanAutoMerge() bool
CanAutoMerge returns true if this pull request can be merged automatically.
func (*PullRequest) GetApprovalCounts ¶ added in v1.17.0
func (pr *PullRequest) GetApprovalCounts(ctx context.Context) ([]*ReviewCount, error)
GetApprovalCounts returns the approval counts by type FIXME: Only returns official counts due to double counting of non-official counts
func (*PullRequest) GetApprovers ¶ added in v1.17.0
func (pr *PullRequest) GetApprovers() string
GetApprovers returns the approvers of the pull request
func (*PullRequest) GetBaseBranchLink ¶ added in v1.19.0
func (pr *PullRequest) GetBaseBranchLink() string
GetBaseBranchLink returns the relative URL of the base branch
func (*PullRequest) GetGitHeadBranchRefName ¶ added in v1.19.4
func (pr *PullRequest) GetGitHeadBranchRefName() string
func (*PullRequest) GetGitRefName ¶ added in v1.17.0
func (pr *PullRequest) GetGitRefName() string
GetGitRefName returns git ref for hidden pull request branch
func (*PullRequest) GetHeadBranchLink ¶ added in v1.19.0
func (pr *PullRequest) GetHeadBranchLink() string
GetHeadBranchLink returns the relative URL of the head branch
func (*PullRequest) GetWorkInProgressPrefix ¶ added in v1.17.0
func (pr *PullRequest) GetWorkInProgressPrefix(ctx context.Context) string
GetWorkInProgressPrefix returns the prefix used to mark the pull request as a work in progress. It returns an empty string when none were found
func (*PullRequest) IsAncestor ¶ added in v1.17.0
func (pr *PullRequest) IsAncestor() bool
IsAncestor returns true if the Head Commit of this PR is an ancestor of the Base Commit
func (*PullRequest) IsChecking ¶ added in v1.17.0
func (pr *PullRequest) IsChecking() bool
IsChecking returns true if this pull request is still checking conflict.
func (*PullRequest) IsEmpty ¶ added in v1.17.0
func (pr *PullRequest) IsEmpty() bool
IsEmpty returns true if this pull request is empty.
func (*PullRequest) IsFilesConflicted ¶ added in v1.17.0
func (pr *PullRequest) IsFilesConflicted() bool
IsFilesConflicted determines if the Pull Request has changes conflicting with the target branch.
func (*PullRequest) IsFromFork ¶ added in v1.19.0
func (pr *PullRequest) IsFromFork() bool
IsFromFork return true if this PR is from a fork.
func (*PullRequest) IsSameRepo ¶ added in v1.17.0
func (pr *PullRequest) IsSameRepo() bool
IsSameRepo returns true if base repo and head repo is the same
func (*PullRequest) IsWorkInProgress ¶ added in v1.17.0
func (pr *PullRequest) IsWorkInProgress() bool
IsWorkInProgress determine if the Pull Request is a Work In Progress by its title Issue must be set before this method can be called.
func (*PullRequest) LoadAttributes ¶ added in v1.17.0
func (pr *PullRequest) LoadAttributes(ctx context.Context) (err error)
LoadAttributes loads pull request attributes from database Note: don't try to get Issue because will end up recursive querying.
func (*PullRequest) LoadBaseRepo ¶ added in v1.17.0
func (pr *PullRequest) LoadBaseRepo(ctx context.Context) (err error)
LoadBaseRepo loads the target repository. ErrRepoNotExist may be returned.
func (*PullRequest) LoadHeadRepo ¶ added in v1.17.0
func (pr *PullRequest) LoadHeadRepo(ctx context.Context) (err error)
LoadHeadRepo loads the head repository, pr.HeadRepo will remain nil if it does not exist and thus ErrRepoNotExist will never be returned
func (*PullRequest) LoadIssue ¶ added in v1.17.0
func (pr *PullRequest) LoadIssue(ctx context.Context) (err error)
LoadIssue loads issue information from database
func (*PullRequest) LoadRequestedReviewers ¶ added in v1.20.0
func (pr *PullRequest) LoadRequestedReviewers(ctx context.Context) error
LoadRequestedReviewers loads the requested reviewers.
func (*PullRequest) Mergeable ¶ added in v1.17.0
func (pr *PullRequest) Mergeable() bool
Mergeable returns if the pullrequest is mergeable.
func (*PullRequest) MustHeadUserName ¶ added in v1.17.0
func (pr *PullRequest) MustHeadUserName(ctx context.Context) string
MustHeadUserName returns the HeadRepo's username if failed return blank
func (*PullRequest) ResolveCrossReferences ¶ added in v1.17.0
func (pr *PullRequest) ResolveCrossReferences(ctx context.Context) ([]*Comment, error)
ResolveCrossReferences will return the list of references to close/reopen by this PR
func (*PullRequest) SetMerged ¶ added in v1.17.0
func (pr *PullRequest) SetMerged(ctx context.Context) (bool, error)
SetMerged sets a pull request to merged and closes the corresponding issue
func (*PullRequest) String ¶ added in v1.18.4
func (pr *PullRequest) String() string
func (*PullRequest) Update ¶ added in v1.17.0
func (pr *PullRequest) Update() error
Update updates all fields of pull request.
func (*PullRequest) UpdateCols ¶ added in v1.17.0
func (pr *PullRequest) UpdateCols(cols ...string) error
UpdateCols updates specific fields of pull request.
func (*PullRequest) UpdateColsIfNotMerged ¶ added in v1.17.0
func (pr *PullRequest) UpdateColsIfNotMerged(ctx context.Context, cols ...string) error
UpdateColsIfNotMerged updates specific fields of a pull request if it has not been merged
func (*PullRequest) UpdateCommitDivergence ¶ added in v1.17.0
func (pr *PullRequest) UpdateCommitDivergence(ctx context.Context, ahead, behind int) error
UpdateCommitDivergence update Divergence of a pull request
type PullRequestFlow ¶ added in v1.17.0
type PullRequestFlow int
PullRequestFlow the flow of pull request
const ( // PullRequestFlowGithub github flow from head branch to base branch PullRequestFlowGithub PullRequestFlow = iota // PullRequestFlowAGit Agit flow pull request, head branch is not exist PullRequestFlowAGit )
type PullRequestList ¶ added in v1.17.0
type PullRequestList []*PullRequest
PullRequestList defines a list of pull requests
func (PullRequestList) GetIssueIDs ¶ added in v1.18.4
func (prs PullRequestList) GetIssueIDs() []int64
GetIssueIDs returns all issue ids
func (PullRequestList) LoadAttributes ¶ added in v1.17.0
func (prs PullRequestList) LoadAttributes() error
LoadAttributes load all the prs attributes
type PullRequestStatus ¶ added in v1.17.0
type PullRequestStatus int
PullRequestStatus defines pull request status
const ( PullRequestStatusConflict PullRequestStatus = iota PullRequestStatusChecking PullRequestStatusMergeable PullRequestStatusManuallyMerged PullRequestStatusError PullRequestStatusEmpty PullRequestStatusAncestor )
Enumerate all the pull request status
func (PullRequestStatus) String ¶ added in v1.18.4
func (status PullRequestStatus) String() string
type PullRequestType ¶ added in v1.17.0
type PullRequestType int
PullRequestType defines pull request type
const ( PullRequestGitea PullRequestType = iota PullRequestGit )
Enumerate all the pull request types
type PullRequestsOptions ¶ added in v1.17.0
type PullRequestsOptions struct { db.ListOptions State string SortType string Labels []string MilestoneID int64 }
PullRequestsOptions holds the options for PRs
type PushActionContent ¶ added in v1.17.0
type PushActionContent struct { IsForcePush bool `json:"is_force_push"` CommitIDs []string `json:"commit_ids"` }
PushActionContent is content of push pull comment
type Reaction ¶ added in v1.17.0
type Reaction struct { ID int64 `xorm:"pk autoincr"` Type string `xorm:"INDEX UNIQUE(s) NOT NULL"` IssueID int64 `xorm:"INDEX UNIQUE(s) NOT NULL"` CommentID int64 `xorm:"INDEX UNIQUE(s)"` UserID int64 `xorm:"INDEX UNIQUE(s) NOT NULL"` OriginalAuthorID int64 `xorm:"INDEX UNIQUE(s) NOT NULL DEFAULT(0)"` OriginalAuthor string `xorm:"INDEX UNIQUE(s)"` User *user_model.User `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` }
Reaction represents a reactions on issues and comments.
func CreateCommentReaction ¶ added in v1.17.0
CreateCommentReaction creates a reaction on comment.
func CreateIssueReaction ¶ added in v1.17.0
CreateIssueReaction creates a reaction on issue.
func CreateReaction ¶ added in v1.17.0
func CreateReaction(opts *ReactionOptions) (*Reaction, error)
CreateReaction creates reaction for issue or comment.
func (*Reaction) GetExternalID ¶ added in v1.17.0
GetExternalID ExternalUserRemappable interface
func (*Reaction) GetExternalName ¶ added in v1.17.0
GetExternalName ExternalUserRemappable interface
type ReactionList ¶ added in v1.17.0
type ReactionList []*Reaction
ReactionList represents list of reactions
func FindCommentReactions ¶ added in v1.17.0
func FindCommentReactions(issueID, commentID int64) (ReactionList, int64, error)
FindCommentReactions returns a ReactionList of all reactions from an comment
func FindIssueReactions ¶ added in v1.17.0
func FindIssueReactions(issueID int64, listOptions db.ListOptions) (ReactionList, int64, error)
FindIssueReactions returns a ReactionList of all reactions from an issue
func FindReactions ¶ added in v1.17.0
func FindReactions(ctx context.Context, opts FindReactionsOptions) (ReactionList, int64, error)
FindReactions returns a ReactionList of all reactions from an issue or a comment
func (ReactionList) GetFirstUsers ¶ added in v1.17.0
func (list ReactionList) GetFirstUsers() string
GetFirstUsers returns first reacted user display names separated by comma
func (ReactionList) GetMoreUserCount ¶ added in v1.17.0
func (list ReactionList) GetMoreUserCount() int
GetMoreUserCount returns count of not shown users in reaction tooltip
func (ReactionList) GroupByType ¶ added in v1.17.0
func (list ReactionList) GroupByType() map[string]ReactionList
GroupByType returns reactions grouped by type
func (ReactionList) HasUser ¶ added in v1.17.0
func (list ReactionList) HasUser(userID int64) bool
HasUser check if user has reacted
func (ReactionList) LoadUsers ¶ added in v1.17.0
func (list ReactionList) LoadUsers(ctx context.Context, repo *repo_model.Repository) ([]*user_model.User, error)
LoadUsers loads reactions' all users
type ReactionOptions ¶ added in v1.17.0
ReactionOptions defines options for creating or deleting reactions
type Review ¶ added in v1.17.0
type Review struct { ID int64 `xorm:"pk autoincr"` Type ReviewType Reviewer *user_model.User `xorm:"-"` ReviewerID int64 `xorm:"index"` ReviewerTeamID int64 `xorm:"NOT NULL DEFAULT 0"` ReviewerTeam *organization.Team `xorm:"-"` OriginalAuthor string OriginalAuthorID int64 Issue *Issue `xorm:"-"` IssueID int64 `xorm:"index"` Content string `xorm:"TEXT"` // Official is a review made by an assigned approver (counts towards approval) Official bool `xorm:"NOT NULL DEFAULT false"` CommitID string `xorm:"VARCHAR(40)"` Stale bool `xorm:"NOT NULL DEFAULT false"` Dismissed bool `xorm:"NOT NULL DEFAULT false"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` // CodeComments are the initial code comments of the review CodeComments CodeComments `xorm:"-"` Comments []*Comment `xorm:"-"` }
Review represents collection of code comments giving feedback for a PR
func CreateReview ¶ added in v1.17.0
func CreateReview(ctx context.Context, opts CreateReviewOptions) (*Review, error)
CreateReview creates a new review based on opts
func GetCurrentReview ¶ added in v1.17.0
func GetCurrentReview(ctx context.Context, reviewer *user_model.User, issue *Issue) (*Review, error)
GetCurrentReview returns the current pending review of reviewer for given issue
func GetReviewByID ¶ added in v1.17.0
GetReviewByID returns the review by the given ID
func GetReviewByIssueIDAndUserID ¶ added in v1.17.0
GetReviewByIssueIDAndUserID get the latest review of reviewer for a pull request
func GetTeamReviewerByIssueIDAndTeamID ¶ added in v1.17.0
func GetTeamReviewerByIssueIDAndTeamID(ctx context.Context, issueID, teamID int64) (review *Review, err error)
GetTeamReviewerByIssueIDAndTeamID get the latest review request of reviewer team for a pull request
func (*Review) GetCodeCommentsCount ¶ added in v1.17.0
GetCodeCommentsCount return count of CodeComments a Review has
func (*Review) GetExternalID ¶ added in v1.17.0
GetExternalID ExternalUserRemappable interface
func (*Review) GetExternalName ¶ added in v1.17.0
GetExternalName ExternalUserRemappable interface
func (*Review) HTMLTypeColorName ¶ added in v1.20.0
func (*Review) HTMLURL ¶ added in v1.17.0
HTMLURL formats a URL-string to the related review issue-comment
func (*Review) LoadAttributes ¶ added in v1.17.0
LoadAttributes loads all attributes except CodeComments
func (*Review) LoadCodeComments ¶ added in v1.17.0
LoadCodeComments loads CodeComments
func (*Review) LoadReviewer ¶ added in v1.17.0
LoadReviewer loads reviewer
func (*Review) LoadReviewerTeam ¶ added in v1.17.0
LoadReviewerTeam loads reviewer team
type ReviewCount ¶ added in v1.17.0
type ReviewCount struct { IssueID int64 Type ReviewType Count int64 }
ReviewCount represents a count of Reviews
type ReviewList ¶ added in v1.20.2
type ReviewList []*Review
func FindLatestReviews ¶ added in v1.20.2
func FindLatestReviews(ctx context.Context, opts FindReviewOptions) (ReviewList, error)
FindLatestReviews returns only latest reviews per user, passing FindReviewOptions
func FindReviews ¶ added in v1.17.0
func FindReviews(ctx context.Context, opts FindReviewOptions) (ReviewList, error)
FindReviews returns reviews passing FindReviewOptions
func GetReviewersFromOriginalAuthorsByIssueID ¶ added in v1.17.0
func GetReviewersFromOriginalAuthorsByIssueID(issueID int64) (ReviewList, error)
GetReviewersFromOriginalAuthorsByIssueID gets the latest review of each original authors for a pull request
func GetReviewsByIssueID ¶ added in v1.20.0
func GetReviewsByIssueID(issueID int64) (ReviewList, error)
GetReviewsByIssueID gets the latest review of each reviewer for a pull request
func (ReviewList) LoadIssues ¶ added in v1.20.2
func (reviews ReviewList) LoadIssues(ctx context.Context) error
func (ReviewList) LoadReviewers ¶ added in v1.20.2
func (reviews ReviewList) LoadReviewers(ctx context.Context) error
LoadReviewers loads reviewers
type ReviewType ¶ added in v1.17.0
type ReviewType int
ReviewType defines the sort of feedback a review gives
const ( // ReviewTypePending is a review which is not published yet ReviewTypePending ReviewType = iota // ReviewTypeApprove approves changes ReviewTypeApprove // ReviewTypeComment gives general feedback ReviewTypeComment // ReviewTypeReject gives feedback blocking merge ReviewTypeReject // ReviewTypeRequest request review from others ReviewTypeRequest )
const ReviewTypeUnknown ReviewType = -1
ReviewTypeUnknown unknown review type
func (ReviewType) Icon ¶ added in v1.17.0
func (rt ReviewType) Icon() string
Icon returns the corresponding icon for the review type
type RoleDescriptor ¶ added in v1.17.0
type RoleDescriptor int
RoleDescriptor defines comment tag type
const ( RoleDescriptorNone RoleDescriptor = iota RoleDescriptorPoster RoleDescriptorWriter RoleDescriptorOwner )
Enumerate all the role tags.
func (RoleDescriptor) HasRole ¶ added in v1.17.0
func (rd RoleDescriptor) HasRole(role string) bool
HasRole returns if a certain role is enabled on the RoleDescriptor.
func (RoleDescriptor) WithRole ¶ added in v1.17.0
func (rd RoleDescriptor) WithRole(role RoleDescriptor) RoleDescriptor
WithRole enable a specific tag on the RoleDescriptor.
type Stopwatch ¶ added in v1.17.0
type Stopwatch struct { ID int64 `xorm:"pk autoincr"` IssueID int64 `xorm:"INDEX"` UserID int64 `xorm:"INDEX"` CreatedUnix timeutil.TimeStamp `xorm:"created"` }
Stopwatch represents a stopwatch for time tracking.
func GetUserStopwatches ¶ added in v1.17.0
func GetUserStopwatches(userID int64, listOptions db.ListOptions) ([]*Stopwatch, error)
GetUserStopwatches return list of all stopwatches of a user
type TrackedTime ¶ added in v1.17.0
type TrackedTime struct { ID int64 `xorm:"pk autoincr"` IssueID int64 `xorm:"INDEX"` Issue *Issue `xorm:"-"` UserID int64 `xorm:"INDEX"` User *user_model.User `xorm:"-"` Created time.Time `xorm:"-"` CreatedUnix int64 `xorm:"created"` Time int64 `xorm:"NOT NULL"` Deleted bool `xorm:"NOT NULL DEFAULT false"` }
TrackedTime represents a time that was spent for a specific issue.
func AddTime ¶ added in v1.17.0
func AddTime(user *user_model.User, issue *Issue, amount int64, created time.Time) (*TrackedTime, error)
AddTime will add the given time (in seconds) to the issue
func GetTrackedTimeByID ¶ added in v1.17.0
func GetTrackedTimeByID(id int64) (*TrackedTime, error)
GetTrackedTimeByID returns raw TrackedTime without loading attributes by id
func (*TrackedTime) AfterLoad ¶ added in v1.17.0
func (t *TrackedTime) AfterLoad()
AfterLoad is invoked from XORM after setting the values of all fields of this object.
func (*TrackedTime) LoadAttributes ¶ added in v1.17.0
func (t *TrackedTime) LoadAttributes() (err error)
LoadAttributes load Issue, User
type TrackedTimeList ¶ added in v1.17.0
type TrackedTimeList []*TrackedTime
TrackedTimeList is a List of TrackedTime's
func GetTrackedTimes ¶ added in v1.17.0
func GetTrackedTimes(ctx context.Context, options *FindTrackedTimesOptions) (trackedTimes TrackedTimeList, err error)
GetTrackedTimes returns all tracked times that fit to the given options.
func (TrackedTimeList) LoadAttributes ¶ added in v1.17.0
func (tl TrackedTimeList) LoadAttributes() error
LoadAttributes load Issue, User
type UserStopwatch ¶ added in v1.17.0
UserIDCount is a simple coalition of UserID and Count
func GetUIDsAndStopwatch ¶ added in v1.17.0
func GetUIDsAndStopwatch() ([]*UserStopwatch, error)
GetUIDsAndNotificationCounts between the two provided times
Source Files ¶
- assignees.go
- comment.go
- comment_code.go
- comment_list.go
- content_history.go
- dependency.go
- issue.go
- issue_index.go
- issue_label.go
- issue_list.go
- issue_lock.go
- issue_project.go
- issue_search.go
- issue_stats.go
- issue_update.go
- issue_user.go
- issue_watch.go
- issue_xref.go
- label.go
- milestone.go
- pull.go
- pull_list.go
- reaction.go
- review.go
- review_list.go
- stopwatch.go
- tracked_time.go