Incorrect approval rules when updating target branch
Summary
To address the discussion in !22749 (comment 275470453).
#460 (closed) adds the ability to scope project-level approval rules to specific protected branches. So if the target branch of the merge request matches the scope set for an approval rule, that approval rule is applied.
In the merge request edit form, upon changing the target branch, the approval rules table shown in the form is not updated, only after submitting the form.
Steps to reproduce
- Add a project-level approval rule that is scoped to branch
A
- Create a merge request that targets branch
A
- In the create or edit form, change the target branch to
B
- The approval rules table in that form still show the approval rule that is scoped to branch
A
What is the current bug behavior?
In the new/edit merge request form, the approval rules table are not updated when the target branch is changed, and keep showing the rules that apply to the original target branch. This gives the false impression that these rules will be applied on save.
What is the expected correct behavior?
In the new/edit merge request form, the approval rules table should update right after the user changes the target branch.