diff options
author | Giteabot <teabot@gitea.io> | 2023-09-29 21:35:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-29 13:35:01 +0000 |
commit | f13a294b47e901e22ec02d9b9d92ddd835155f53 (patch) | |
tree | 87bbe9736cda387bdcc129aca62db660849ff9f8 /services/pull | |
parent | 84ee02faa7086504f45cb1dc3ae01c4937653936 (diff) | |
download | gitea-f13a294b47e901e22ec02d9b9d92ddd835155f53.tar.gz gitea-f13a294b47e901e22ec02d9b9d92ddd835155f53.zip |
More `db.DefaultContext` refactor (#27265) (#27347)
Backport #27265 by @JakobDev
Part of #27065
This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.
Co-authored-by: JakobDev <jakobdev@gmx.de>
Diffstat (limited to 'services/pull')
-rw-r--r-- | services/pull/pull.go | 4 | ||||
-rw-r--r-- | services/pull/review.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/services/pull/pull.go b/services/pull/pull.go index 8e57aebe3d..5e76fac815 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -336,7 +336,7 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string, } if changed { // Mark old reviews as stale if diff to mergebase has changed - if err := issues_model.MarkReviewsAsStale(pr.IssueID); err != nil { + if err := issues_model.MarkReviewsAsStale(ctx, pr.IssueID); err != nil { log.Error("MarkReviewsAsStale: %v", err) } @@ -351,7 +351,7 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string, } } } - if err := issues_model.MarkReviewsAsNotStale(pr.IssueID, newCommitID); err != nil { + if err := issues_model.MarkReviewsAsNotStale(ctx, pr.IssueID, newCommitID); err != nil { log.Error("MarkReviewsAsNotStale: %v", err) } divergence, err := GetDiverging(ctx, pr) diff --git a/services/pull/review.go b/services/pull/review.go index c82d1341b6..64eea22eec 100644 --- a/services/pull/review.go +++ b/services/pull/review.go @@ -84,7 +84,7 @@ func CreateCodeComment(ctx context.Context, doer *user_model.User, gitRepo *git. if !pendingReview && replyReviewID != 0 { // It's not part of a review; maybe a reply to a review comment or a single comment. // Check if there are reviews for that line already; if there are, this is a reply - if existsReview, err = issues_model.ReviewExists(issue, treePath, line); err != nil { + if existsReview, err = issues_model.ReviewExists(ctx, issue, treePath, line); err != nil { return nil, err } } @@ -288,7 +288,7 @@ func SubmitReview(ctx context.Context, doer *user_model.User, gitRepo *git.Repos } } - review, comm, err := issues_model.SubmitReview(doer, issue, reviewType, content, commitID, stale, attachmentUUIDs) + review, comm, err := issues_model.SubmitReview(ctx, doer, issue, reviewType, content, commitID, stale, attachmentUUIDs) if err != nil { return nil, nil, err } |