Altering number of approvals required for MR rule changes rule target
Summary
When a merge request approval rule is created with a Target branch of "All protected branches" changing the number of Approvals required after the rule is created will result in the Target branch for the rule automatically changing from "All protected branches" to "All branches."
Steps to reproduce
- Navigate to
Settings > Merge Request > Merge request approvalsin any project - Create a new merge request approval rule with a Target branch of "All protected branches" and save the rule.
- Once the rule has been created change the number of Approvals required via the increment arrows on the number box (not by editing the rule and saving changes)
- The Target branch will change to "All branches" automatically within seconds of changing the number of approvals.
Example Project
https://gitlab.com/rcastro6/rcastro-issue-list/
What is the current bug behavior?
The Target branch setting of the rule changes automatically after adjusting the number of approvals.
What is the expected correct behavior?
The Target branch setting should not change without being initiated by a user.
Relevant logs and/or screenshots
New rule targeting All Protected branches.
Rule is created.
Change the number of approvals required via the increment arrows on the number of approvals box.
Target branch changes automatically
Output of checks
This bug happens on GitLab.com
Reproduced on 17.5.4 and 17.6.1 as well.



