Merge request reviews

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

Merge requests are the primary method of making changes to files in a GitLab project. Create and submit a merge request to propose changes. Your team leaves comments on your merge request, and makes Code Suggestions you can accept from the user interface. When your work is reviewed, your team members can choose to accept or reject it.

You can review merge requests from the GitLab interface. If you install the GitLab Workflow VS Code extension, you can also review merge requests in Visual Studio Code.

For an overview, see Merge request review.

GitLab Duo Suggested Reviewers

Tier: Ultimate Offering: GitLab.com
History

GitLab uses machine learning to suggest reviewers for your merge request.

For an overview, see GitLab Duo Suggested Reviewers.

To suggest reviewers, GitLab uses:

  • The changes in the merge request
  • The project’s contribution graph

GitLab Duo Suggested Reviewers also integrates with Code Owners, profile status, and merge request rules, helping you make a more informed decision when choosing reviewers that can meet your review criteria.

GitLab Duo Suggested Reviewers

For more information, see Data usage in GitLab Duo Suggested Reviewers.

Enable Suggested Reviewers

Enabling Suggested Reviewers triggers GitLab to create an ML model for your project that is used to generate reviewers. The larger your project, the longer this process can take. Usually, the model is ready to generate suggestions within a few hours.

Prerequisites:

  • You have the Owner or Maintainer role in the project.

To do this:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Settings > Merge requests.
  3. Scroll to Suggested reviewers, and select Enable suggested reviewers.
  4. Select Save changes.

After you enable the feature, no additional action is needed. After the model is ready, recommendations populate the Reviewer dropdown list in the right-hand sidebar of a merge request with new commits.

Review a merge request

When you review a merge request, you can create comments that are visible only to you. When you’re ready, you can publish them together in a single action. To start your review:

  1. Go to the merge request you want to review, and select the Changes tab. For more information about navigating the diffs displayed in this tab, see Changes in merge requests.
  2. Select Add a comment to this line ( ) in the gutter to expand the diff lines and display a comment box. In GitLab version 13.2 and later, you can select multiple lines.
  3. In the text area, write your first comment, then select Start a review below your comment.
  4. Continue adding comments to lines of code. After each comment, select Add to review. Comments made as part of a review are visible only to you until you submit your review.
  5. Optional. You can use quick actions inside review comments. The comment shows the actions to perform after publication, but does not perform them until you submit your review.
  6. When your review is complete, you can submit the review. Your comments are now visible, and any quick actions included in your comments are performed.

If you approve a merge request and are shown in the reviewer list, a green check mark displays next to your name.

Request a review

To assign a reviewer to a merge request, in a text area in the merge request, use the /assign_reviewer @user quick action. Alternatively:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Code > Merge requests and find your merge request.
  3. On the right sidebar, in the Reviewers section, select Edit.
  4. Search for the user you want to assign, and select the user.

The merge request is added to the user’s review requests.

From multiple users

Tier: Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

To assign multiple reviewers to a merge request, in a text area in the merge request, use the /assign_reviewer @user quick action. Alternatively:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Code > Merge requests and find your merge request.
  3. On the right sidebar, in the Reviewers section, select Edit.
  4. From the dropdown list, select all the users you want to assign to the merge request.

To remove a reviewer, clear the user from the same dropdown list.

Download merge request changes as a diff

To download the changes included in a merge request as a diff:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Code > Merge requests.
  3. Select your merge request.
  4. In the upper-right corner, select Code > Plain diff.

If you know the URL of the merge request, you can also download the diff from the command line by appending .diff to the URL. This example downloads the diff for merge request 000000:

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.diff

To download and apply the diff in a one-line CLI command:

curl "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.diff" | git apply

Download merge request changes as a patch file

To download the changes included in a merge request as a patch file:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Code > Merge requests.
  3. Select your merge request.
  4. In the upper-right corner, select Code > Patches.

If you know the URL of the merge request, you can also download the patch from the command line by appending .patch to the URL. This example downloads the patch file for merge request 000000:

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.patch

To download and apply the patch in a one-line CLI command using git am:

curl "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.patch" | git am

Submit a review

You can submit your completed review in multiple ways:

  • Use the /submit_review quick action in the text of a non-review comment.
  • Select Finish review, then select Submit review at the bottom of the modal window. In the modal window, you can supply a Summary comment, approve the merge request, and include quick actions:

    Finish review with comment

When you submit your review, GitLab:

  • Publishes the comments in your review.
  • Sends a single email to every notifiable user of the merge request, with your review comments attached. Replying to this email creates a new comment on the merge request.
  • Perform any quick actions you added to your review comments.
  • Optional. Shows whether you have also approved or requested changes:
    • Comment: Leave general feedback without explicit approval.
    • Approve: Leave feedback and approve the changes.
    • Request changes: Leave feedback that should be addressed before merging.

Resolve or unresolve thread with a comment

Review comments can also resolve or unresolve resolvable threads. To resolve or unresolve a thread when replying to a comment:

  1. In the comment text area, write your comment.
  2. Select or clear Resolve thread.
  3. Select Add comment now or Add to review.

Pending comments display information about the action to be taken when the comment is published:

  • Thread is resolved.
  • Thread stays unresolved.

Add a new comment

If you have a review in progress, you can also add a comment from the Overview tab by selecting Add to review:

New thread

Approval Rule information for Reviewers

Tier: Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

When editing the Reviewers field in a new or existing merge request, GitLab displays the name of the matching approval rule below the name of each reviewer. Code Owners are displayed as Codeowner without group detail.

This example shows reviewers and approval rules when creating a new merge request:

Reviewer approval rules in new/edit form

This example shows reviewers and approval rules in a merge request sidebar:

Reviewer approval rules in sidebar

Request a new review

After a reviewer completes their merge request reviews, the author of the merge request can request a new review from the reviewer:

  1. If the right sidebar in the merge request is collapsed, select the Expand Sidebar icon to expand it.
  2. In the Reviewers section, select the Re-request a review icon ( ) next to the reviewer’s name.

GitLab creates a new to-do item for the reviewer, and sends them a notification email.

Comment on multiple lines

When commenting on a diff, you can select which lines of code your comment refers to by either:

  • Dragging Add a comment to this line ( ) in the gutter to highlight lines in the diff. GitLab expands the diff lines and displays a comment box.
  • After starting a comment by selecting Add a comment to this line ( ) in the gutter, select the first line number your comment refers to in the Commenting on lines select box. New comments default to single-line comments, unless you select a different starting line.

Comment on any diff file line

Multiline comments display the comment’s line numbers above the body of the comment:

Multiline comment selection displayed above comment

Bulk edit merge requests at the project level

Users with at least the Developer role can manage merge requests.

When bulk-editing merge requests in a project, you can edit the following attributes:

  • Status (open/closed)
  • Assignee
  • Milestone
  • Labels
  • Subscriptions

To update multiple project merge requests at the same time:

  1. In a project, go to Code > Merge requests.
  2. Select Bulk edit. A sidebar on the right-hand side of your screen appears with editable fields.
  3. Select the checkboxes next to each merge request you want to edit.
  4. Select the appropriate fields and their values from the sidebar.
  5. Select Update all.

Bulk edit merge requests at the group level

Tier: Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

Users with at least the Developer role can manage merge requests.

When bulk editing merge requests in a group, you can edit the following attributes:

  • Milestone
  • Labels

To update multiple group merge requests at the same time:

  1. In a group, go to Code > Merge requests.
  2. Select Bulk edit. A sidebar on the right-hand side of your screen appears with editable fields.
  3. Select the checkboxes next to each merge request you want to edit.
  4. Select the appropriate fields and their values from the sidebar.
  5. Select Update all.

Associated features

These features are associated with merge requests: