Review
Finishing the review and approving
4 min read
After commenting on the lines, you finish the review: a summary and the verdict, published at once with all the pending comments. The verdict can be just a comment, an approval or, on GitHub, a request for changes. To approve without writing anything, there's also the Approval card on the Actions tab.
- MR review › to the right of the tabs › Review… (without pending comments) or Finish review (2) (with 2 pending comments).
The button only appears with the MR open.
- Comment on the lines with Start review / Add to review (see Comments).
- Click Finish review (2).
- The Finish reviewing !42 dialog says how many comments go along: "2 pending comments go with it, all in one go." (with none: "No pending comments: the review carries only the summary and the verdict.").
- Write the summary, if you want.
- Choose the verdict.
- Click Submit review (or Ctrl+Enter in the summary field). The bar shows "Submitting the review…".
- At the end: "Review submitted.", "Review submitted and merge request approved." or "Review submitted, requesting changes.".
| Verdict | What it does | Service |
|---|---|---|
| Comment | "Publishes the comments without a verdict." | both |
| Approve | "Publishes the comments and approves the merge request." | both |
| Request changes | "Publishes the comments and requests changes before merging." | GitHub only |
Approve is disabled, with the reason in parentheses, when "you already approved", when "the author can't approve their own pull request" (GitHub) or when "GitLab won't let you approve".
On GitLab there's no "request changes" through the review: ask with a comment, or from the MR page.
The field is Summary (optional) in most cases. It becomes Summary (required) when:
- the verdict is Request changes; or
- the verdict is Comment and there are no pending comments (the review would be empty).
With the required summary empty, Submit review is disabled.
- "Includes 3 comments from the review you started in the browser.": on GitHub, pending comments you left on the pull request page go along.
- "Heads up: 1 comment was written on an earlier version of the merge request; the line may have moved.": the MR received a push after you commented. Check the comment before submitting.
To give up on the pending comments, click Discard review in the dialog. The Discard the review? confirmation warns: "The 2 pending comments will be deleted. This can't be undone." On GitHub, with a review started in the browser, it's deleted too ("…including those from the pending review open in the browser."). Confirm with Discard.
To remove just one comment, use Delete on the pending comment.
To approve (or revoke the approval) without going through the dialog.
- MR review › Actions tab › Approval card.
| Text | Meaning |
|---|---|
| "You haven't approved yet." | You can approve: Approve is enabled. |
| "You approved this merge request." | Approved by you: the button becomes Revoke approval. |
| "GitHub doesn't let the author approve their own pull request." | You're the author, on GitHub. |
| "GitLab won't let you approve: you may be the author (and the project doesn't allow it), or you may not be among the approvers." | GitLab doesn't allow your approval. |
| "The merge request isn't open." | Closed or merged. |
- On the Actions tab, click Approve. The bar shows "Approving…".
- At the end: "!42 approved.".
- To go back, click Revoke approval ("Revoking approval…"; at the end, "Approval revoked.").
On GitHub, revoking the approval dismisses your approving review, and that requires write permission on the repository ("On GitHub this dismisses your approving review (requires write permission)"). The dismissed review carries the message "Approval withdrawn by the reviewer.".
Nothing in the local repository. The review is published through the API: on GitLab, the drafts are published together, the summary becomes a comment and the approval is done separately; on GitHub, the review goes as a pull request review, with the comments and the verdict.
The published review stays on the server; Ctrl+Z doesn't undo it. The approval is undone with Revoke approval. A published comment is deleted from the MR page.
- "Write a summary (or comment on a line) before submitting the review.": the review is empty.
- "The comments were published, but the summary wasn't: …": publish the summary as a general comment.
- "The review was published, but the approval failed: …": try Approve on the Approval card.
- "GitLab didn't allow the approval (HTTP 403): you may not be among the approvers, be the author (and the project doesn't let authors approve), or have already approved.".
- "You have no approval to revoke (404). Refresh the review.".
- "The source branch got new commits after you opened the review (409). Refresh the screen and check the new changes before continuing.": look at what changed before approving (see Changed since your last review).
- "On GitLab, request changes with a comment (or on the merge request page).".
Who can approve and how many approvals are required are project rules on the server (and, on GitLab, also CODEOWNERS rules, per section). See CODEOWNERS.