diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 21:08:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 21:08:05 +0300 |
commit | 184c2ced0761bd8dd7032619d16d3983fed7944a (patch) | |
tree | cc82b32ee7c1797509da3cf384617e4ffa2e1733 /doc/user/project/merge_requests/merge_request_approvals.md | |
parent | 238d22c07218adf2b8f3db630ee8b74ca6f29df5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/user/project/merge_requests/merge_request_approvals.md')
-rw-r--r-- | doc/user/project/merge_requests/merge_request_approvals.md | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/doc/user/project/merge_requests/merge_request_approvals.md b/doc/user/project/merge_requests/merge_request_approvals.md index 5474d0d6ff6..2aa92ba2316 100644 --- a/doc/user/project/merge_requests/merge_request_approvals.md +++ b/doc/user/project/merge_requests/merge_request_approvals.md @@ -101,7 +101,7 @@ any [eligible approver](#eligible-approvers) may approve. The following can approve merge requests: - Users being added as approvers at project or merge request level. -- [Code owners](../code_owners.md) related to the merge request ([introduced](https://gitlab.com/gitlab-org/gitlab/merge_requests/7933) in [GitLab Starter](https://about.gitlab.com/pricing/) 11.5). +- [Code owners](#code-owners-as-eligible-approvers-starter) to the files changed by the merge request. An individual user can be added as an approver for a project if they are a member of: @@ -119,6 +119,31 @@ if [**Prevent author approval**](#allowing-merge-request-authors-to-approve-thei and [**Prevent committers approval**](#prevent-approval-of-merge-requests-by-their-committers) (disabled by default) are enabled on the project settings. +### Code Owners as eligible approvers **(STARTER)** + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/merge_requests/7933) in [GitLab Starter](https://about.gitlab.com/pricing/) 11.5. + +Once you've added [Code Owners](../code_owners.md) to your +repository, the owners to the corresponding files will become +eligible approvers, together with members with Developer or +higher permissions. + +To enable this merge request approval rule: + +1. Navigate to your project's **Settings > General** and expand +**Merge request approvals**. +1. Locate **All members with Developer role or higher and code owners (if any)** and click **Edit** to choose the number of approvals required. + +![MR approvals by Code Owners](img/mr_approvals_by_code_owners_v12_4.png) + +Once set, merge requests can only be merged once approved by the +number of approvals you've set. GitLab will accept approvals from +users with Developer or higher permissions, as well as by Code Owners, +indistinguishably. + +Alternatively, you can **require** +[Code Owner's approvals for Protected Branches](../protected_branches.md#protected-branches-approval-by-code-owners-premium). **(PREMIUM)** + ### Implicit approvers If the number of required approvals is greater than the number of approvers, @@ -162,26 +187,6 @@ are other conditions that may block it, such as merge conflicts, [pending discussions](../../discussions/index.md#only-allow-merge-requests-to-be-merged-if-all-threads-are-resolved) or a [failed CI/CD pipeline](merge_when_pipeline_succeeds.md). -## Code Owners approvals **(PREMIUM)** - -> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/4418) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.9. - -It is possible to require at least one approval for each entry in the -[`CODEOWNERS` file](../code_owners.md) that matches a file changed in -the merge request. To enable this feature: - -1. Navigate to your project's **Settings > General** and expand - **Merge request approvals**. -1. Tick the **Require approval from code owners** checkbox. -1. Click **Save changes**. - -When this feature is enabled, all merge requests will need approval -from one code owner per matched rule before it can be merged. - -NOTE: **Note:** Only the `CODEOWNERS` file on the default branch is evaluated for -Merge Request approvals. If `CODEOWNERS` is changed on a non-default branch, those -changes will not affect approvals until merged to the default branch. - ## Overriding the merge request approvals default settings > Introduced in GitLab Enterprise Edition 9.4. |