Reviewing in GitLab#
Typically, before any changes to How-to Cards are accepted, it is required that they go through an informal review. Reviewing helps with discovering and fixing accidental mistakes and inconsistencies, and is generally considered a good practice.
If you have been desginated as the reviewer of a merge request, you will receive a notification from GitLab. Typically this means that someone wants to know your opinion on the given changes.
Starting the review#
To start, simply follow the link to the merge request where your review is requested. There, click the Changes tab:
Navigating the review interface#
On the left side, there is a list of the files impacted by the changes in this merge request:
- A red square next to a file means that the file has been removed.
- An orange one means that the file has been modified.
- A green one means that the file has been added.
When you choose a text file, you can see the individual changes in that file:
- Red sections have been deleted or modified
- Green sections are the modified version of the red sections or are newly added
Lines with no changes are hidden and/or collapsed. To uncollapse the lines, click the arrows:
For a more readable view with e.g. pictures integrated, click on the 3 dots on the right side, and select View files @ xxxxx:
Writing the review#
To make a comment on a line, place your mouse on the line number and click on the bubble that appears on the left side:
After writing the comment, click either Start a review or Add comment now. Choosing “Start a review” allows you to compile several comments before submitting the complete review at once. The review is finished by clicking Finish review, which also sends notifications to the authors. Choosing “Add comment now” sends the notifications immediately.
Suggesting changes#
Suggesting changes directly simplifies communication of the desired target state; authors may then commit they changes without having to re-type them into their computer.
To suggest changes, start adding a comment, then click the button on the left:
You may also suggest replacement of multiple lines – simple choose the desired line span using the dropdown on the top.
Submitting the review#
Once everything is commented, remember to “submit” the review using the Finish review button:
You are also given a choice to formally Approve the merge request. Repository maintainers may use the approval as a simple way to see if you think the changes are OK, and decide to start merging the changes if sufficient approvals are given by reviewers.