Page MenuHomePhabricator

Investigate code review in GitLab
Closed, ResolvedPublic8 Estimated Story PointsSpike

Description

See what support GitLab has for the following:

  • Mark a patch as work in progress.
  • Assign reviewers
  • Compare changes in the patch with parent.
  • Download patch to investigate and test locally.
  • Comment on the patch as a whole and on specific changes.
    • Including a way to discuss a change back and forth.
  • Request changes.
  • Close review as good to merge or not.
  • Merge patch manually.

Event Timeline

Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptMay 27 2026, 9:41 AM
Sebastian_Berlin-WMSE renamed this task from Investigate code review to Investigate code review in GitLab.May 28 2026, 12:45 PM
Sebastian_Berlin-WMSE updated the task description. (Show Details)

Workflow overview: Merge request workflows


Mark a patch as work in progress.

According to drafts, one can:

  • create an MR as draft
  • mark existing MR as draft
  • remove draft status later
  • Example: Add [Draft], Draft: or (Draft) to the beginning of the merge request’s title.

Assign reviewers

According to request reviews, one can:

  • Assign reviewers in any textfield using /assign_reviewer OR
  • To find a reviewer by name: in the right sidebar, in the Reviewers section, select Edit.

One related feature is Approval Rules, which can be used to require one or more approvals before a MR can be merged, and to define which users or groups are eligible approvers. However, approval rules require GitLab Premium.

Another related feature is CODEOWNERS which defines ownership of files or directories. However, it does not appear to automatically assign reviewers to MR's. Neither CODEOWNERS or approval rules seem to provide a workflow where the other developer is automatically added as a reviewer, so for our case, the simplest approach appears to be manually assigning the other developer as reviewer when creating a MR.


Compare changes in the patch with parent.

According to changes and compare revisions:

  • The Changes tab in a Merge Request shows the changes introduced by the Merge Request itself, i.e. the difference between the source branch and the target branch. This is the primary view used during code review.
  • Compare revisions is a more general comparison tool that can be used to compare any two branches, tags, or commits in a repository. Unlike the Changes tab, it is not tied to a specific Merge Request.

Download patch to investigate and test locally.

Merge Request changes can be downloaded from the Code menu as either Plain diff or Patches. The latter can be applied and tested locally.


Comment on the patch as a whole and on specific changes.

GitLab supports comments on the merge request as a whole as well as inline comments on specific changes, threaded discussions, replies, and resolving discussion threads.


Request changes.

Reviews can be submitted as Request changes.

image.png (672×647 px, 72 KB)


Close review as good to merge or not.

Reviews can be submitted as Approve.

I was initially confused about the difference between Approval Settings and Approval Rules, but my understanding is:

  • Approval Settings control how approvals work (for example whether authors can approve their own merge requests)
  • Approval Rules define who can approve a merge request and how many approvals are required before merging. Approval Rules require GitLab Premium.

Merge patch manually.
  • A Merge Request can be merged manually from the MR page by selecting the Merge button, provided that the user has permission to merge and all merge checks have passed.
  • GitLab also supports Auto-merge, where the MR is merged automatically once all requirements are met.

Regarding Request changes, I think it would be preferable to use review states (approve/request changes) rather than emoji reactions (thumbs up/down) to indicate whether a MR is ready to merge.

There is also a feature called inline suggestions that could be relevant when suggesting minor changes.

Another related feature is CODEOWNERS which defines ownership of files or directories. However, it does not appear to automatically assign reviewers to MR's. Neither CODEOWNERS or approval rules seem to provide a workflow where the other developer is automatically added as a reviewer, so for our case, the simplest approach appears to be manually assigning the other developer as reviewer when creating a MR.

I can see this as both good and bad. On one hand explicitly going "this is ready for review" could save you from accidentally messaging someone. On the other hand it's a thing that you may forget, leaving a patch unreviewed until you notice it.

Download patch to investigate and test locally.

Merge Request changes can be downloaded from the Code menu as either Plain diff or Patches. The latter can be applied and tested locally.

But you can also just fetch and checkout the branch, right?

But you can also just fetch and checkout the branch, right?

Yes!