Resolve change approval configuration" API not allowing to change "approvals_required".
What does this MR do?
Currently, the legacy PUT approvals
API endpoint still allows user to change approvals_required
setting. However this only updates the merge request model's approvals_before_merge
column. This value, after the new approval rule system is in operation, would only be used when approval rules are absent. If approval rule is present, the rule's own approvals_required
is used.
So when approval rules are present, the user will be surprised to see after update, the approvals_required
field returned by the API has no changed.
To hide this quirk, the merge request would try to simulate the affect of updating approvals_required
as much as we can. It would instead update the rule's approvals_required
if a MR rule is present.
In the case when project rule is present but MR rule is absent, the project rule will be copied over as MR rule, then the MR rule's approvals_required
would be updated.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Closes #11887 (closed)