Multiple discussions per line in merge request diffs
Problem to solve
Code review in GitLab should amplify best practices by making it easy to leave feedback on any line in any file, even multiple lines per file.
A single line of code may need multiple threads of discussion. For example, the first reviewer might point out an implementation error (incorrect regexp
or a option to use a better helper function), but a second reviewer identifies that the code would better be moved to a different location (new helper function, or removed entirely be refactoring the code etc). It's possible to start these discussions outside the diff, but not on the diff.
Further details
The backend/API already support multiple resolvable discussions per line. The discussions tab already renders multiple discussions correctly. You can see this by opening a merge request in two tabs and leaving feedback at the same time.
We only need to work out how make this work well in the Changes tab.
Proposal
When I'm adding diff comments in the Changes tab (one by one, or in a batch review) I should be able to add comments to an existing resolvable discussion thread, or start a new one on the same line.
Permissions and Security
No changes required.
Documentation
https://docs.gitlab.com/ee/user/discussions/#resolvable-comments-and-discussions
- Depending on the design, screenshots may need to be updated
- Update version information to indicate support for multiple discussions per line is added in 11.10
- Hopefully, no specific documentation is needed for this feature because the UI should be in line with leaving a single discussion thread and should be obvious
What does success look like, and how can we measure that?
Increased adoption of merge request features, which is metric that is already measured.
This feature helps improve merge request discussions and a problematic UX dilemma. Although a feature, this is also a per-requisite to making reviews (batch comments) more usable and providing an overview of the number of resolved discussions by reviewer.