Merge request approval settings are not compliant
Control: MR approval settings must be compliantยท Config key: mergeRequestApprovalSettingsMustBeCompliant
๐ What is this?
The project's merge request approval settings do not meet the expectations you configured. Each expectation is optional: a setting you leave unset is not checked.
โ ๏ธ Impact
Approval settings apply above every approval rule. When authors or committers can approve, when rules can be overridden inside a merge request, or when approvals survive new commits, the review requirement can be satisfied without anyone reviewing the code that actually ships.
๐ง How to fix
Update the project's approval settings under Settings > Merge requests to match the expectations in your configuration.
# GitLab project settings - โ Approval settings violate the policy# Settings > Merge requests > Approvals:## Prevent approval by author: false โ Author can approve own MR# Prevent approvals by users who add commits: false# Remove all approvals when commits are added: false## These settings allow the MR author to approve their own changes,# and approvals remain valid even after new commits are pushed.# GitLab project settings - โ
Approval settings match the policy# Settings > Merge requests > Approvals:## Prevent approval by author: true# Prevent approvals by users who add commits: true# Remove all approvals when commits are added: true๐ก Tips
- Merge request approval settings require GitLab Premium or Ultimate. On Free the API returns defaults rather than an error, so the control cannot tell the tier apart from a genuinely unlocked project. It ships disabled for that reason. Enable it only on Premium or Ultimate projects.
- Set your expectations in
.plumber.yamlundermergeRequestApprovalSettingsMustBeCompliant. Each one is optional:preventApprovalByAuthor,preventApprovalsByCommitters,preventEditingApprovalRulesInMRandrequireReAuthToApproveare only checked when set totrue. behaviorWhenCommitIsAddedis a minimum on the ladderkeep_approvals<remove_approvals_by_code_owners<remove_all_approvals, so a stricter project than you asked for still passes.- Enable 'Prevent approval by author' to ensure code is reviewed by someone other than the author.
- These settings can also be enforced at the group level for consistency.
โ๏ธ Configuration
This control is configured in .plumber.yaml under the gitlab section:
gitlab:
controls:
mergeRequestApprovalSettingsMustBeCompliant:
enabled: trueSee the CLI documentation for the full configuration reference. On Plumber Platform, the same key is used in your policy configuration.