loading...
MyCareersFuture

Code Review: Review labels in GitLab

shonoru profile image Andrey Bodoev ・2 min read

We use GitLab to host our code. One of the aspects of it is deal with code reviews on daily basis. 

In our team, we're about 10+ devs, it's quite difficult to have someone attention to code review, if it's product team and most of the time you focus on your own work and hoping if someone is review your changes. 

Initially, we have this,

GitLab without labels

Here's an issue, which is no way to tell if someone is reviewing your code, or if you have enough reviewers and etc. Number of comments are not gave you much, and 0 of 2 is not really helpful here.


In our code review guidelines we have few rules, one of them is to have your Merge Request (abbr. MR) to be reviewed by at least 2 person in team.

There's few concerns to address,

  • how to make it visible if someone is reviewing your MR;
  • who reviewing what, and have they done so;
  • do you have enough reviewers.

Gitlab has it's own approval system in place, and code review guidelines. It does work, but we decided to tweak this a bit to improve communication within a team.

GitLab with labels

There's few types of labels we introduces,

  • Review Me, label is used to have an attention to MR and stating that it's ready to be reviewed, otherwise it can be wip;
  • Review by Paul Atreides, each reviewer has it's own label assigned once they start commenting;
  • Approved by Padishah Emperor Shaddam IV, each reviewer has it's own label once review is done, and comments are addressed.

With this in practice, once you going to visit list of MRs waiting. You're not checking each of them in order to find out, if it's been reviewed by someone else and it's ready to be merged. And it's greatly improve visibility of state on each Merge Request.

Posted on by:

MyCareersFuture

Technical writings from the MyCareersFuture product team

Discussion

markdown guide