doc/user/project/merge_requests/approvals/settings.md
{{< details >}}
{{< /details >}}
You can configure the settings for merge request approvals to ensure the approval rules meet your use case. You can also configure approval rules, which define the number and type of users who must approve work before it's merged. Merge request approval settings define how to apply those rules as a merge request moves toward completion.
Use any combination of these settings to configure approval limits for merge requests:
To view or edit merge request approval settings for a single project:
To simplify the management of approval rule settings, configure the approval rules at the broadest possible level. Rules created:
If a group or project inherits settings, you can't change them in the inheriting group or project. You must change the settings where they originated: the top-level group or instance.
By default, the creator of a merge request (author) cannot approve it. To change this setting:
Merge request creators can edit the approval rule in an individual merge request and override this setting, unless you configure one of these options:
{{< history >}}
keep_merge_commits_for_approvals added in GitLab 16.3 to also include merge commits in this check.keep_merge_commits_for_approvals removed in GitLab 16.5. This check now includes merge commits.{{< /history >}}
By default, users who commit to a merge request (the committers) can still approve it. To prevent committers in your project (or your instance) from approving merge requests that are partially their own:
Code owners who commit to a merge request cannot approve it, if the merge request affects files they own.
For more information, see the official Git documentation.
[!warning] If a merge request is rebased by someone other than the user who originally committed the changes, the commit history is rewritten with a new committer. This might enable users who previously committed changes in a merge request to now approve changes in it, as they are no longer a committer.
See also approving after rebase
By default, users can override the approval rules you create for a project on a per-merge-request basis. If you don't want users to change approval rules on merge requests, you can disable this setting:
This change affects all open merge requests.
When you change this field, it can affect all open merge requests depending on the setting:
{{< history >}}
ff_require_saml_auth_to_approve. Disabled by default.ff_require_saml_auth_to_approve. Disabled by default.ff_require_saml_auth_to_approve by default in GitLab 16.8 for GitLab.com and GitLab Self-Managed instances.{{< /history >}}
[!flag] On GitLab Self-Managed, by default requiring re-authentication by using SAML authentication is available. To hide the feature, an administrator can disable the feature flag named
ff_require_saml_auth_to_approve. On GitLab.com and GitLab Dedicated, this feature is available.
You can force potential approvers to first authenticate with SAML or a password. This permission enables an electronic signature for approvals, such as the one defined by Code of Federal Regulations (CFR) Part 11.
Prerequisites:
{{< details >}}
{{< /details >}}
By default, an approval on a merge request is removed when you add more changes after the approval.
GitLab uses git patch-id to identify diffs
in merge requests. This value is a reasonably stable and unique identifier, and it enables
smarter decisions about resetting approvals inside a merge request. When you push new changes
to a merge request, the patch-id is evaluated against the previous patch-id to determine
if the approvals should be reset. This enables GitLab to make better reset decisions when
you perform commands like git rebase or git merge <target> on a feature branch.
To keep existing approvals after more changes are added to a merge request:
If you automate the creation and approval of merge requests, build in logic to ensure commits are processed fully before approving the merge request. This prevents an unintentional approval reset. For more information, see handle timing issues with automated approvals.
To remove approvals only from Code Owners whose files change in a new commit:
Prerequisites:
To do this: