Show warning for too many draft notes in MR review
requested to merge gitlab-community/gitlab:433461-gerardo-navarro-submit-review-performance-issue-many-draft-notes-warning-for-users into master
What does this MR do and why?
- This MR add a warning to the user when an MR review contains more than 50 draft notes
- Why? A large number of draft notes (batched comments) can cause additional load on the backend when the review is submitted, see Submitting code review with 64 notes to MR can ... (#433461 - closed) ; to mitigate this risk of an overwhelmed backend, we believe that showing a warning to the reviewer (user) will make users aware that a smaller number of draft notes is recommended => #433461 (comment 1778136440)
- Why? We hope that showing the warning is a quick win / "low hanging fruit" / low-effort solution to reduce the performance impact on the backend server
- Possible addition: Allow customizing the recommend limit for draft notes in MR reviews; ATM, the number is static
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
MR Checklist (@gerardo-navarro)
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the javascript style guides -
Conforms to the database guides -
Add tests for the alert
Screenshots or screen recordings
Short screencast: https://www.loom.com/share/3092e598bb9c4ff1b1f0f42b5f083547
Before | After |
---|---|
How to set up and validate locally
- Create a new merge request for a project
- Add more than 50 draft notes to the MR review
(1..51).each do |i| DraftNote.create(merge_request: MergeRequest.find(id),
note: "Comment #{i}",
author: User.find(1))
end
- Go to the merge request and click and wait for the page to load
- Click on "Finish review" on the bottom of the screen
Related to #433461 (closed)
Edited by Gerardo Navarro