summaryrefslogtreecommitdiffstats
path: root/routers/repo/pull_review.go
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2020-01-09 02:47:45 +0100
committerzeripath <art27@cantab.net>2020-01-09 01:47:45 +0000
commit25531c71a78b98af91f25d5e6eaa362e5fc54a86 (patch)
tree3dc44abba51f55f66020755d31fa909a9c56990e /routers/repo/pull_review.go
parent5b2d9333f1d06a15f11906b39c4867cc5d1c9448 (diff)
downloadgitea-25531c71a78b98af91f25d5e6eaa362e5fc54a86.tar.gz
gitea-25531c71a78b98af91f25d5e6eaa362e5fc54a86.zip
Mark PR reviews as stale at push and allow to dismiss stale approvals (#9532)
Fix #5997. If a push causes the patch/diff of a PR towards target branch to change, all existing reviews for the PR will be set and shown as stale. New branch protection option to dismiss stale approvals are added. To show that a review is not based on the latest PR changes, an hourglass is shown
Diffstat (limited to 'routers/repo/pull_review.go')
-rw-r--r--routers/repo/pull_review.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/repo/pull_review.go b/routers/repo/pull_review.go
index b596d2578b..558473eb08 100644
--- a/routers/repo/pull_review.go
+++ b/routers/repo/pull_review.go
@@ -37,12 +37,14 @@ func CreateCodeComment(ctx *context.Context, form auth.CodeCommentForm) {
comment, err := pull_service.CreateCodeComment(
ctx.User,
+ ctx.Repo.GitRepo,
issue,
signedLine,
form.Content,
form.TreePath,
form.IsReview,
form.Reply,
+ form.LatestCommitID,
)
if err != nil {
ctx.ServerError("CreateCodeComment", err)
@@ -95,7 +97,7 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {
}
}
- _, comm, err := pull_service.SubmitReview(ctx.User, issue, reviewType, form.Content)
+ _, comm, err := pull_service.SubmitReview(ctx.User, ctx.Repo.GitRepo, issue, reviewType, form.Content, form.CommitID)
if err != nil {
if models.IsContentEmptyErr(err) {
ctx.Flash.Error(ctx.Tr("repo.issues.review.content.empty"))