Skip to content

Merge default branch protection and default initial branch together under repository & update the section header and description

This issue and linked pages contain information related to upcoming products, features, and functionality. It is important to note that the information presented is for informational purposes only. Please do not rely on this information for purchasing or planning purposes. As with all projects, the items mentioned in this video and linked pages are subject to change or delay. The development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Release notes

Problem to solve

See full context in the parent epic

The settings that pertain to the default branch are split between two places. This creates a confusing experience when looking for similarly describe features protections & name.

Proposal

1️⃣ Merge default branch protection and default initial branch together under repository

Admin Area Group/Subgroup
Admin_Area__After____Dropdown__Allow_ Subgroup__After____Dropdown__Unlocked_Owner_

2️⃣ Update the section header and description

Admin Area

- Default initial branch name 
+ Default branch
- The default name for the initial branch of new repositories created in the group.  
+ Set the initial name and protections for the default branch of new repositories created in the instance.

Group/Subgroup

- Default initial branch name 
+ Default branch
- The default name for the initial branch of new repositories created in the instance. 
+ Set the initial name and protections for the default branch of new repositories created in the group.

3️⃣ Update form labels

- Default initial branch name
+ Initial default branch name
- Default branch protection
+ Initial default branch protection

4️⃣ Add help text to Allow owners checkbox

+ Affects all new and existing groups.
Existing logic that is not changing
  • Admin Area defaults to Fully protected
  • Allow owners to manage default branch protection per group
    ↳ Hides the field from view in groups for owners, but it's still visible for administrators
  • Allow owners to manage default branch protection per group
    ↳ Shows the field in groups for owners & administrators

Resources

Open Figma →

Implementation plan

frontend estimated weight of 3️⃣ because of all the files that need to be changed.

  1. Move Default branch protection to Repository settings
:

    1. Remove Default branch protection from app/views/admin/application_settings/_visibility_and_access.html.haml.
    2. Add Default branch protection to Admin > Repository > Default Branch.
    3. Remove Default branch protection from app/views/groups/settings/_default_branch_protection.html.haml.
    4. Add Default branch protection to Groups > Repository > Default Branch.
    • Note: The design shows the Default branch protection as a dropdown, but it has recently been converted to radio inputs !72721 (merged) and we should keep it that way. See the comment #340403 (comment 837721641) for more context.
  2. Move Allow owners to manage default branch protection per group to Repository settings
:

    1. Remove the setting from app/views/admin/application_settings/_visibility_and_access.html.haml.
    2. Add the setting to Admin > Repository > Default Branch.
    3. Add the help text as described above in this issue's description.
  3. Update setting text as described above in:

    1. Admin > Repository > Default Branch
    2. Groups > Repository > Default Branch
    • Note: Project-level settings already conform.
  4. Update any existing links to the settings to point to their new locations.

  5. Update any potentially failing specs.

  6. Update documentation to reflect the changes:

    1. https://docs.gitlab.com/ee/user/admin_area/settings/visibility_and_access_controls.html#protect-default-branches
    2. https://docs.gitlab.com/ee/user/group/#change-the-default-branch-protection-of-a-group

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by Jiaan Louw