Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up a code review using Gitlab?

How does one set up a code review using Gitlab? I see it listed as a feature on the Gitlab website, but I can't seem to find instructions on how to set one up (For that matter, any link to a Gitlab user manual would be most appreciated).

Some of my searching has indicated that 'Merge Requests' are the way to go... but I'm finding them limiting. An issued merge request shows all of the commits between one branch and the other. I seem to only be able to view diffs generated for each individual commit. For example, let's say I have a file I want to review. It is a new file but I've submitted changes to it over 10 commits on a dev branch. If I issue a merge request for that dev branch from integration I see 10 commits each of which show the incremental changes made to the file... I want to review the entire thing. It is new!

Am I barking up the wrong tree here? Is there an actual code-review tool I can use in GitLab, or are merge requests the way to go, and if they are am I using them incorrectly? what's the best way to set up a proper code review here?

like image 597
djc6535 Avatar asked Jul 09 '13 22:07

djc6535


People also ask

Does GitLab have code review?

With GitLab, reviews are baked into every part of the development process - so that teams can collaborate together to improve the overall quality of code and implement controls to ensure requirements are adequately implemented in the code. Every code review starts with a merge request.

How do I assign a reviewer in GitLab?

To request a review of a merge request, expand the Reviewers select box in the right-hand sidebar. Search for the users you want to request a review from. When selected, GitLab creates a to-do list item for each reviewer. To learn more, read Review a merge request.


1 Answers

Note: since GitLab 6.4, side-by-side diff view is available: see "pull request 5308".

(July 2013)There is no possibility yet to comment on each line though, only at the file level.
Daniel Sokolowski mentions in the comments that Per line comments are now supported (09/2014):

Your team members can comment on the merge request in general or on specific lines with line comments.

That still can help for code review activity.

https://f.cloud.github.com/assets/4224518/1558702/e0fe633a-4fa3-11e3-9388-3f3e445cb6d4.png


6 years later, for GitLab 13.1 (June 2020):

Merge Request Reviews moved to Core

Originally introduced in GitLab 11.4 as a GitLab Premium feature, Merge Request Reviews allow merge request reviewers to:

  • submit multiple comments at once,
  • cutting down on notification noise for the merge request author, and
  • allowing for a more cohesive and streamlined review process.

https://about.gitlab.com/images/13_1/batch_comments.png

Since its introduction, we’ve re-evaluated its place in our buyer-based pricing model and as part of 13.1 we’re excited to announce this feature has now moved to GitLab Core.

See Documentation and Issue


With GitLab 13.9 (February 2021), you also have:

Request a follow-up review from a Reviewer

Merge request authors receive feedback from reviewers. Often, this feedback needs to be re-reviewed to make sure all issues have been appropriately addressed. As the author of the contribution, you need to communicate the need for a follow-up to your reviewer.

For reviewers who have already reviewed a merge request, you can now request a re-review. This request triggers a To-Do item and email notification to alert the user that you need a follow-up review of your contribution.

https://about.gitlab.com/images/13_9/create_code_review-request-re-review.png -- Request a follow-up review from a Reviewer

See Documentation and Issue.


With GitLab 13.11 (April 2021)

Add standalone comments to merge request reviews

When you’re reviewing changes, you may want to summarize your feedback, or comment on something unrelated to the specific changes. Reviews in GitLab only allowed commenting on the changes or replying to existing comments, which meant that other kinds of comments had to be made after submitting the review.

As part of your review process, you can now submit a general comment along with your replies or change-specific comments. General comments make it simple to provide feedback to the author and use quick actions to update items across the merge request.

Thanks to Lee Tickett for the contribution!

https://about.gitlab.com/images/13_11/code-review-add-comment-mr-review.png -- Add standalone comments to merge request reviews

See Documentation and Issue.

like image 114
VonC Avatar answered Oct 08 '22 18:10

VonC