Skip to content

Show warning for too many draft notes in MR review

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

🛠 with at Siemens

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)

Screenshots or screen recordings

Short screencast: https://www.loom.com/share/3092e598bb9c4ff1b1f0f42b5f083547

Before After
grafik grafik

How to set up and validate locally

  1. Create a new merge request for a project
  2. 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
  1. Go to the merge request and click and wait for the page to load
  2. Click on "Finish review" on the bottom of the screen

grafik

Related to #433461 (closed)

Edited by Gerardo Navarro

Merge request reports