diff --git a/app/assets/javascripts/projects/settings/branch_rules/components/edit/branch_dropdown.vue b/app/assets/javascripts/projects/settings/branch_rules/components/edit/branch_dropdown.vue index 3dcacf9eb349f435e7df5dd19378ad75c13369a8..6494456d56000e772f43ffd508b39f691c95532a 100644 --- a/app/assets/javascripts/projects/settings/branch_rules/components/edit/branch_dropdown.vue +++ b/app/assets/javascripts/projects/settings/branch_rules/components/edit/branch_dropdown.vue @@ -55,7 +55,7 @@ export default { }, searchInputDelay: 250, wildcardsHelpPath: helpPagePath('user/project/protected_branches', { - anchor: 'configure-multiple-protected-branches-by-using-a-wildcard', + anchor: 'protect-multiple-branches-with-wildcard-rules', }), props: { projectPath: { diff --git a/app/assets/javascripts/projects/settings/branch_rules/components/view/constants.js b/app/assets/javascripts/projects/settings/branch_rules/components/view/constants.js index b71c33d2b91de070390abdadd9991844ee3805a5..a45ed5c68afee269a1231f4e9c7beb1a7b0149d8 100644 --- a/app/assets/javascripts/projects/settings/branch_rules/components/view/constants.js +++ b/app/assets/javascripts/projects/settings/branch_rules/components/view/constants.js @@ -49,7 +49,7 @@ export const BRANCH_PARAM_NAME = 'branch'; export const ALL_BRANCHES_WILDCARD = '*'; export const WILDCARDS_HELP_PATH = - 'user/project/protected_branches#configure-multiple-protected-branches-by-using-a-wildcard'; + 'user/project/protected_branches#protect-multiple-branches-with-wildcard-rules'; export const PROTECTED_BRANCHES_HELP_PATH = 'user/project/protected_branches'; diff --git a/app/views/protected_branches/shared/_create_protected_branch.html.haml b/app/views/protected_branches/shared/_create_protected_branch.html.haml index 62cf81a59d427add055b70b45a9d9c685fec5bc6..d97347b89dec580a4bea384c9a131b8e4b19f1e0 100644 --- a/app/views/protected_branches/shared/_create_protected_branch.html.haml +++ b/app/views/protected_branches/shared/_create_protected_branch.html.haml @@ -13,7 +13,7 @@ - else = render partial: "protected_branches/shared/dropdown", locals: { f: f, toggle_classes: 'gl-w-full! gl-form-input-lg' } .form-text.text-muted - - wildcards_url = help_page_url('user/project/protected_branches', anchor: 'configure-multiple-protected-branches-by-using-a-wildcard') + - wildcards_url = help_page_url('user/project/protected_branches', anchor: 'protect-multiple-branches-with-wildcard-rules') - wildcards_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: wildcards_url } - placeholders = { wildcards_link_start: wildcards_link_start, wildcards_link_end: '</a>', code_tag_start: '<code>', code_tag_end: '</code>' } - if protected_branch_entity.is_a?(Group) diff --git a/doc/api/protected_branches.md b/doc/api/protected_branches.md index d3091cb1e15c5fa3b524e03da6e34fe69a6d342b..4a82fab125d8a6c6e251570db0126880e5a6d0f6 100644 --- a/doc/api/protected_branches.md +++ b/doc/api/protected_branches.md @@ -21,7 +21,9 @@ The access levels are defined in the `ProtectedRefAccess.allowed_access_levels` > Deploy key information [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116846) in GitLab 16.0. -Gets a list of protected branches from a project as they are defined [in the UI](../user/project/protected_branches.md#configure-a-protected-branch). If a wildcard is set, it is returned instead of the exact name of the branches that match that wildcard. +Gets a list of [protected branches](../user/project/protected_branches.md) from a project +as they are defined in the UI. If a wildcard is set, it is returned instead of the exact name +of the branches that match that wildcard. ```plaintext GET /projects/:id/protected_branches diff --git a/doc/ci/pipelines/schedules.md b/doc/ci/pipelines/schedules.md index e5a2eb86f14b78f8f622a8dffed13b2c389c001b..d08a511515fcff3444de8743038cff22b85428f5 100644 --- a/doc/ci/pipelines/schedules.md +++ b/doc/ci/pipelines/schedules.md @@ -14,7 +14,7 @@ Use scheduled pipelines to run GitLab CI/CD [pipelines](index.md) at regular int For a scheduled pipeline to run: - The schedule owner must have the Developer role. For pipelines on protected branches, - the schedule owner must be [allowed to merge](../../user/project/protected_branches.md#configure-a-protected-branch) + the schedule owner must be [allowed to merge](../../user/project/protected_branches.md#add-protection-to-existing-branches) to the branch. - The [CI/CD configuration](../yaml/index.md) must be valid. diff --git a/doc/user/project/deploy_keys/index.md b/doc/user/project/deploy_keys/index.md index 13ee07097e160e8ef3d5dd653edde630ac4f6ddd..f7dc8079af8fe9216617a047b4b28fbba16ea7a1 100644 --- a/doc/user/project/deploy_keys/index.md +++ b/doc/user/project/deploy_keys/index.md @@ -160,7 +160,7 @@ There are a few scenarios where a deploy key fails to push to a - The owner associated to a deploy key does not have access to the protected branch. - The owner associated to a deploy key does not have [membership](../members/index.md) to the project of the protected branch. -- **No one** is selected in [the **Allowed to push and merge** section](../protected_branches.md#configure-a-protected-branch) of the protected branch. +- **No one** is selected in [the **Allowed to push and merge** section](../protected_branches.md#add-protection-to-existing-branches) of the protected branch. All deploy keys are associated to an account. Since the permissions for an account can change, this might lead to scenarios where a deploy key that was working is suddenly unable to push to a protected branch. diff --git a/doc/user/project/import/github.md b/doc/user/project/import/github.md index 068663af0c99e5d8e813e587618370077d2acdd7..118e7caf123939899ae8545d4c6884e3b94f5fc2 100644 --- a/doc/user/project/import/github.md +++ b/doc/user/project/import/github.md @@ -282,11 +282,11 @@ When they are imported, supported GitHub branch protection rules are mapped to e | GitHub rule | GitLab rule | Introduced in | | :---------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------ | | **Require conversation resolution before merging** for the project's default branch | **All threads must be resolved** [project setting](../../discussions/index.md#prevent-merge-unless-all-threads-are-resolved) | [GitLab 15.5](https://gitlab.com/gitlab-org/gitlab/-/issues/371110) | -| **Require a pull request before merging** | **No one** option in the **Allowed to push and merge** list of [branch protection settings](../protected_branches.md#configure-a-protected-branch) | [GitLab 15.5](https://gitlab.com/gitlab-org/gitlab/-/issues/370951) | +| **Require a pull request before merging** | **No one** option in the **Allowed to push and merge** list of [branch protection settings](../protected_branches.md#add-protection-to-existing-branches) | [GitLab 15.5](https://gitlab.com/gitlab-org/gitlab/-/issues/370951) | | **Require signed commits** for the project's default branch | **Reject unsigned commits** GitLab [push rule](../repository/push_rules.md#prevent-unintended-consequences) **(PREMIUM)** | [GitLab 15.5](https://gitlab.com/gitlab-org/gitlab/-/issues/370949) | | **Allow force pushes - Everyone** | **Allowed to force push** [branch protection setting](../protected_branches.md#allow-force-push-on-a-protected-branch) | [GitLab 15.6](https://gitlab.com/gitlab-org/gitlab/-/issues/370943) | | **Require a pull request before merging - Require review from Code Owners** | **Require approval from code owners** [branch protection setting](../protected_branches.md#require-code-owner-approval-on-a-protected-branch) **(PREMIUM)** | [GitLab 15.6](https://gitlab.com/gitlab-org/gitlab/-/issues/376683) | -| **Require a pull request before merging - Allow specified actors to bypass required pull requests** | List of users in the **Allowed to push and merge** list of [branch protection settings](../protected_branches.md#configure-a-protected-branch) **(PREMIUM)**. Without a **Premium** subscription, the list of users that are allowed to push and merge is limited to roles. | [GitLab 15.8](https://gitlab.com/gitlab-org/gitlab/-/issues/384939) | +| **Require a pull request before merging - Allow specified actors to bypass required pull requests** | List of users in the **Allowed to push and merge** list of [branch protection settings](../protected_branches.md#add-protection-to-existing-branches) **(PREMIUM)**. Without a **Premium** subscription, the list of users that are allowed to push and merge is limited to roles. | [GitLab 15.8](https://gitlab.com/gitlab-org/gitlab/-/issues/384939) | Mapping GitHub rule **Require status checks to pass before merging** to [external status checks](../merge_requests/status_checks.md) was considered in issue diff --git a/doc/user/project/protected_branches.md b/doc/user/project/protected_branches.md index 3255c38fd253e2bb834fa78f4612241ec872487e..94f454c5c2dae6bf2b8ba2fb05371edbef2a9a9d 100644 --- a/doc/user/project/protected_branches.md +++ b/doc/user/project/protected_branches.md @@ -42,7 +42,7 @@ When a branch is protected, the default behavior enforces these restrictions on When a branch matches multiple rules, the **most permissive rule** determines the level of protection for the branch. For example, consider these rules, which include -[wildcards](#configure-multiple-protected-branches-by-using-a-wildcard): +[wildcards](#protect-multiple-branches-with-wildcard-rules): | Branch name pattern | Allowed to merge | Allowed to push and merge | |---------------------|------------------------|-----------------| @@ -77,11 +77,11 @@ that matches `v1.x` must set `Allowed to push and merge` to `No one`, like this: Administrators can set a default branch protection level in the [Admin Area](../project/repository/branches/default.md#instance-level-default-branch-protection). -## Configure a protected branch +## Add protection to existing branches Configure protected branches for all projects in a group, or just for a project. -### For a project +### For one project Prerequisites: @@ -133,7 +133,7 @@ To protect a branch for all the projects in a group: The protected branch is added to the list of protected branches. -## Configure multiple protected branches by using a wildcard +## Protect multiple branches with wildcard rules If both a specific rule and a wildcard rule apply to the same branch, the most permissive rule controls how the branch behaves. For merge controls to work properly, @@ -165,13 +165,13 @@ To protect multiple branches at the same time: The protected branch displays in the list of protected branches. -## Create a protected branch +## Create a new branch with protections -Users with at least the Developer role can create a protected branch. +Users with at least the Developer role can create new protected branches. Prerequisites: -- **Allowed to push and merge** is set to **No one** +- **Allowed to push and merge** is set to **No one**. - **Allowed to merge** is set to **Developers**. You can create a protected branch by using the UI or API only.