-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Make gitea webhooks openproject compatible #28435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
6b2157c
99487dd
f0c74fb
635d411
b1fe6e5
7b7fa4f
8e50d3f
27312d0
2632a49
886337e
b3b694d
1e2399e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -430,6 +430,24 @@ func (pr *PullRequest) GetGitHeadBranchRefName() string { | |||
return fmt.Sprintf("%s%s", git.BranchPrefix, pr.HeadBranch) | ||||
} | ||||
|
||||
// GetReviewCommentsCount returns the number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR) | ||||
func (pr *PullRequest) GetReviewCommentsCount(ctx context.Context) int { | ||||
opts := FindCommentsOptions{ | ||||
Chief-Detektor marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
Type: CommentTypeReview, | ||||
IssueID: pr.IssueID, | ||||
} | ||||
conds := opts.ToConds() | ||||
if pr.ID == 0 { | ||||
conds = conds.And(builder.Eq{"invalidated": false}) | ||||
} | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks counter-intuitive. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I can't answer that question as I basically copied this function from here Line 995 in ea8e4ba
It could very well be that the entire check there is redundant and not needed for the function to work properly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ping @6543 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ping @6543 ~~~ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it doesn't need this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wxiaoguang it had it's reason back then i guess but I cant find one now
wxiaoguang marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
count, err := db.GetEngine(ctx).Where(conds).Count(new(Comment)) | ||||
if err != nil { | ||||
return 0 | ||||
} | ||||
return int(count) | ||||
} | ||||
|
||||
// IsChecking returns true if this pull request is still checking conflict. | ||||
func (pr *PullRequest) IsChecking() bool { | ||||
return pr.Status == PullRequestStatusChecking | ||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.