Transition MR to preparing state when suggestions are applied
Issue: Race condition between auto merge and suggestio... (#571737)
What does this MR do and why?
Transition MR to "preparing" state when suggestions are applied
We can run into a state where an MR that has diffs pending regeneration is merged because suggestions applied on the UI triggers thread resolution, causing auto-merge. This change updates the MR merge_status
to reflect the MR state of preparing
, meaning it is pending a diffs update. MRs in preparing
state will not be automerged.
References
Screenshots or screen recordings
Before | After |
---|---|
bad-auto-merge | auto-merge-fix |
How to set up and validate locally
This is the same as the bug reproduction steps in the linked issue, but without the bug:
- Have an MR with auto-merge enabled
- All approvers have approved
- CI is passing
- One thread is open with a suggestion
- Apply the Suggestion
- Auto-merge is blocked until the changes are reviewed
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Safwan Ahmed