Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 50,429
    • Issues 50,429
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,547
    • Merge requests 1,547
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #340401
Closed
Open
Issue created Sep 08, 2021 by Sam Kerr@stkerr🎙Developer

Replace the dropdown selection for default branch protection with a form that matches protected branches

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.

Problem to solve

See full context in the parent epic

The 4 options that are currently available for default branch protections do not cover all the variations of the protected branch.

Proposal

Replace the form-select with a form-group that matches protected branch options.

Admin area

Not protected Protected (Default)
Admin_Area__Not_protected_ Admin_Area__Protected_

Group

Allow owners to make changes Only administrators can make a change
Group__Allowed_
Admins always have control
Group__Prevent_
Disable the group

References

Open Figma →

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.

Implementation plan

frontend weight estimated at 2️⃣

  1. Update app/views/shared/_default_branch_protection.html.haml to show the new options.
  2. Update specs.

backend complete 8️⃣

It looks like there has recently been new work done to allow these type of protected branch settings at the group level(!107792 (merged))

I am currently thinking that this change will be broken in 2 phases

  1. refactor the existing code to use the ProtectedBranch model rather than the hardcoded settings in access.rb 5️⃣
  2. Once the existing code is using ProtectedBranch, support the new options via that model 3️⃣

I am still trying to wrap my head around how application settings generally, and protected branches specifically, are implemented. It is possible that only phase 1 is needed, and we'd get phase 2 automatically, making the overall effort a 5️⃣. Erring on the side of a higher estimate for the time being

documentation

  1. Update the documentation for default branch protection.
Edited Mar 07, 2023 by Michael Becker
Assignee
Assign to
Time tracking