From 6290734c175845c9bd91c877ba1870d2abf9490a Mon Sep 17 00:00:00 2001 From: huzaifaiftikhar1 Date: Wed, 15 Mar 2023 16:33:22 +0530 Subject: [PATCH 1/3] Add documentation for group level protected branches --- doc/user/group/protected_branches.md | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/user/group/protected_branches.md diff --git a/doc/user/group/protected_branches.md b/doc/user/group/protected_branches.md new file mode 100644 index 00000000000000..f37099dd860b64 --- /dev/null +++ b/doc/user/group/protected_branches.md @@ -0,0 +1,35 @@ +--- +stage: Create +group: Source Code +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments +--- + +# Protected branches **(PREMIUM)** + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106532) in GitLab 15.9 behind a feature flag, disabled by default. + +Group owners can create [protected branches](../project/protected_branches.md) for a group. These protected +branches are inherited and enforced at the project level and cannot be edited from the project level settings. + +FLAG: +On self-managed GitLab, by default this feature is not available. +To make it available, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) +named `group_protected_branches`. + +## Create a protected branch for the group + +Prerequisite: + +- You must have the Owner role in the group. + +To protect a branch for all the projects inside a group: + +1. On the top bar, select **Main menu > Groups** and find your group. +1. On the left sidebar, select **Settings > Repository**. +1. Expand **Protected branches**. +1. In the **Branch** text box, type the branch name or a wildcard. +1. From the **Allowed to merge** list, select a role, group, or user that can merge into this branch. +1. From the **Allowed to push** list, select a role, group, or user that can push to this branch. +1. Select **Protect**. + +The protected branch displays in the list of protected branches. -- GitLab From 3f33845e624a39fb0c05ee1a7fe6051454515bfe Mon Sep 17 00:00:00 2001 From: huzaifaiftikhar1 Date: Thu, 16 Mar 2023 10:41:03 +0530 Subject: [PATCH 2/3] Merge group-level protected branches doc with project level doc --- doc/user/group/protected_branches.md | 35 -------------------------- doc/user/project/protected_branches.md | 30 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 35 deletions(-) delete mode 100644 doc/user/group/protected_branches.md diff --git a/doc/user/group/protected_branches.md b/doc/user/group/protected_branches.md deleted file mode 100644 index f37099dd860b64..00000000000000 --- a/doc/user/group/protected_branches.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -stage: Create -group: Source Code -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments ---- - -# Protected branches **(PREMIUM)** - -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106532) in GitLab 15.9 behind a feature flag, disabled by default. - -Group owners can create [protected branches](../project/protected_branches.md) for a group. These protected -branches are inherited and enforced at the project level and cannot be edited from the project level settings. - -FLAG: -On self-managed GitLab, by default this feature is not available. -To make it available, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) -named `group_protected_branches`. - -## Create a protected branch for the group - -Prerequisite: - -- You must have the Owner role in the group. - -To protect a branch for all the projects inside a group: - -1. On the top bar, select **Main menu > Groups** and find your group. -1. On the left sidebar, select **Settings > Repository**. -1. Expand **Protected branches**. -1. In the **Branch** text box, type the branch name or a wildcard. -1. From the **Allowed to merge** list, select a role, group, or user that can merge into this branch. -1. From the **Allowed to push** list, select a role, group, or user that can push to this branch. -1. Select **Protect**. - -The protected branch displays in the list of protected branches. diff --git a/doc/user/project/protected_branches.md b/doc/user/project/protected_branches.md index bbef12cd0e12ef..5f9d78a9b1138e 100644 --- a/doc/user/project/protected_branches.md +++ b/doc/user/project/protected_branches.md @@ -77,6 +77,36 @@ Administrators can set a default branch protection level in the ## Configure a protected branch +### Configure a protected branch for a group + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106532) in GitLab 15.9 behind a feature flag, disabled by default. + +Group owners can create protected branches for a group. These protected branches are inherited and enforced +at the project level and cannot be edited from the project level settings. + +FLAG: +On self-managed GitLab, by default this feature is not available. +To make it available, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) +named `group_protected_branches`. + +Prerequisite: + +- You must have the Owner role in the group. + +To protect a branch for all the projects inside a group: + +1. On the top bar, select **Main menu > Groups** and find your group. +1. On the left sidebar, select **Settings > Repository**. +1. Expand **Protected branches**. +1. In the **Branch** text box, type the branch name or a wildcard. +1. From the **Allowed to merge** list, select a role, group, or user that can merge into this branch. +1. From the **Allowed to push** list, select a role, group, or user that can push to this branch. +1. Select **Protect**. + +The protected branch displays in the list of protected branches. + +### Configure a protected branch for a project + Prerequisite: - You must have at least the Maintainer role. -- GitLab From c3b26fbcf1961aaf4e468931313633faffe14330 Mon Sep 17 00:00:00 2001 From: huzaifaiftikhar1 Date: Thu, 16 Mar 2023 14:28:24 +0530 Subject: [PATCH 3/3] Update protected_branches doc --- doc/user/project/protected_branches.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/user/project/protected_branches.md b/doc/user/project/protected_branches.md index 5f9d78a9b1138e..725818a7d2506d 100644 --- a/doc/user/project/protected_branches.md +++ b/doc/user/project/protected_branches.md @@ -77,23 +77,24 @@ Administrators can set a default branch protection level in the ## Configure a protected branch -### Configure a protected branch for a group +Configure protected branches for all projects in a group, or just for a project. + +### For all projects in a group > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106532) in GitLab 15.9 behind a feature flag, disabled by default. -Group owners can create protected branches for a group. These protected branches are inherited and enforced -at the project level and cannot be edited from the project level settings. +Group owners can create protected branches for a group. These settings are inherited by all projects in the group and can't be overridden by project settings. FLAG: On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) -named `group_protected_branches`. +named `group_protected_branches`. On GitLab.com, this feature is not available. Prerequisite: - You must have the Owner role in the group. -To protect a branch for all the projects inside a group: +To protect a branch for all the projects in a group: 1. On the top bar, select **Main menu > Groups** and find your group. 1. On the left sidebar, select **Settings > Repository**. @@ -103,9 +104,9 @@ To protect a branch for all the projects inside a group: 1. From the **Allowed to push** list, select a role, group, or user that can push to this branch. 1. Select **Protect**. -The protected branch displays in the list of protected branches. +The protected branch is added to the list of protected branches. -### Configure a protected branch for a project +### For a project Prerequisite: -- GitLab