[go: up one dir, main page]

Skip to content

Reorder pending comments in a merge request review

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

As a reviewer, I use the merge request "Review" feature as a way to draft out all of my comments while I jump around from file to file over the course of a review. Oftentimes, this leads to adding some comments to an earlier file, and some comments to a later file, before going back to the earlier file and adding more comments. When I submit my Review, the comments are added to the merge request "Overview" tab in the order in which I added them to the Review. For larger merge requests, this can lead to forcing the code author to have to jump back and forth between files as they try to follow along with your comments.

Intended users

Reviewers and developers

User experience goal

The reviewer should be able to define the order in which their comments will be added to the merge request "Overview" tab before they submit their Review, allowing the developer to easily follow along without having to bounce back and forth between the same files.

Proposal

This problem can be solved in one or more ways:

  1. Allow for drag-and-drop reordering of the comments in the "Pending comments" list that pops up from the "Finish review" button.
  2. Have a checkbox in the "Pending comments" list to enable automatic reordering, grouped by file.
    • Upon submission of the Review, comments would automatically be placed in the same order that the files appear in the "Changes" tab of the merge request — first sorted by file, then sorted by line number within the file.

Implementing both suggestions would give the reviewer a full array of options for submitting their review — no sorting, manual sorting, or automatic sorting.

Further details

As a simplified mock example, see the screenshot below:

image

In this review, I first found a defect on line 77 of suggestions_spec.rb, then one on line 613 of apply_service_spec.rb, and finally one more back in suggestions_spec.rb on line 136. Being able to swap the order of the last two comments before submitting my Review would provide the developer with an easier to follow list of defects to address.

Links / references

Complementary issue: #15265 (closed) — Just as code changes should tell a story, the review of those changes could also tell a story.

Edited by 🤖 GitLab Bot 🤖