Introduced in GitLab Premium 12.8.
Merge request approvals rules prevent users overriding certain settings on a project level. When configured, only administrators can change these settings on a project level if they are enabled at an instance level.
To enable merge request approval rules for an instance:
- Navigate to Admin Area > Push Rules and expand Merge requests approvals.
- Set the required rule.
- Click Save changes.
GitLab administrators can later override these settings in a project’s settings.
Merge request approval rules that can be set at an instance level are:
- Prevent approval of merge requests by merge request author. Prevents project maintainers from allowing request authors to merge their own merge requests.
- Prevent approval of merge requests by merge request committers. Prevents project maintainers from allowing users to approve merge requests if they have submitted any commits to the source branch.
- Can override approvers and approvals required per merge request. Allows project maintainers to modify the approvers list in individual merge requests.
Introduced in GitLab Premium 13.2.
Merge request approval rules can be further scoped to specific compliance frameworks.
When the compliance framework label is selected and the project is assigned the compliance label, the instance-level MR approval settings will take effect and the project-level settings is locked for modification.
When the compliance framework label is not selected or the project is not assigned the compliance label, the project-level MR approval settings will take effect and the users with Maintainer role and above can modify these.