47

First time GitLab user and I'm a bit confused when reviewing someone's merge request. Whenever I add a comment I get prompted with 2 options [Submit review] and [Add comment now].

GitLab merge request discussion

What's the difference between the 2? Why is there a need for 2 options?

1
  • I imagine that Add comment now lets you add more comments to your existing, ongoing review, whereas submit review will submit it
    – Paolo
    Mar 9, 2022 at 10:37

2 Answers 2

47

Just heard this from my colleagues, so not sure if this is 100% accurate:

Add comment now: instantly adds the comment to the review and notifies the reviewer that a comment has been added. So if you choose this option X times, the reviewer receives X notifications.

Submit review: You can add as many comments as you want in as many files as you want. If you choose this option at the end of your review, the reviewer will receive only 1 notification containing all of your comments.

1
  • This is correct. GitLab writes: "In the text area, write your first comment, then select Start a review below your comment. 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." Mar 18 at 8:22
8

An additional difference: the submit review now (Aug. 2022) comes with a summary.

See GitLab 15.3 (August 2022)

Submit merge request review with summary comment

When you finish reviewing a merge request, there are probably some common things that you do, like summarizing your review for others or approving the changes if they look good to you.

Those common tasks are now quicker and easier: when you submit your review, you can add a summary comment along with any quick actions like /approve.

https://about.gitlab.com/images/15_3/create-mr-review-summary.png -- Submit merge request review with summary comment

See Documentation and Issue.


And if your review is a simple "LGTM", you now have with See GitLab 16.0 (May 2023):

Comment templates

When you’re commenting in issues, epics, or merge requests you might repeat yourself and need to write the same comment over and over. Maybe you always need to ask for more information about a bug report. Maybe you’re applying labels via a quick action as part of a triage process. Or maybe you just like to finish all your code reviews with a funny gif or appropriate emoji. 🎉

Comment templates enable you to create saved responses that you can apply in comment boxes around GitLab to speed up your workflow.

To create a comment template, go to User settings > Comment templates and then fill out your template. After it’s saved, select the Insert comment template icon on any text area, and your saved response will be applied.

This is a great way to standardize your replies and save you time!

https://about.gitlab.com/images/16_0/create-comment-templates.gif -- Comment templates

See Documentation and Epic.


And GitLab 16.1 (June 2023) adds:

Comment on whole file in merge requests

Merge requests now support commenting on an entire file, because not all merge request feedback is line-specific. If a file is deleted, you might want more information about why. You might also want to provide feedback about a filename, or general comments about structure.

https://about.gitlab.com/images/16_1/create-comment-on-file-in-mr.png -- Comment on whole file in merge requests

See Documentation and Issue.

Not the answer you're looking for? Browse other questions tagged or ask your own question.