Skip to content

Draft: Add "Instance Admin" opt to Protected Branch/Tag

Joe Woodward requested to merge fix/12776-protected-branch-access into master

What does this MR do and why?

Related to #12776 (closed)

We are adding a new "Instance Admins" option to the Protected Branch "allowed to push" and "allowed to merge" dropdowns, and the Protected Tag "allowed to create" dropdown.

This changes how the other options function. Previously admins could always perform these actions regardless of the configurations. Now selecting "No one" will mean no one will be able to perform the action, including admins. Similarly, selecting "Developers + Maintainers" or "Maintainers" will exclude the admins (unless they have a developer or maintainer role assigned to them).

Screenshots or screen recordings

image image image

How to set up and validate locally

  1. Navigate to the Project > Settings > Respository > Protected Branch section
  2. Create a protected branch with no one assigned (first merge, then push and merge)
  3. Test that you cannot merge into that branch even when admin
  4. Test that you cannot push into that branch even when admin
  5. Modify the protected branch and assign instance admins
  6. Test that you cannot merge into that branch when non-admin
  7. Test that you cannot push into that branch when non-admin
  8. Test that you can merge into that branch when admin
  9. Test that you can push into that branch when admin
  10. Navigate to the Project > Settings > Repository > Protected Tag section
  11. Create a protected tag with no one can create
  12. Test you cannot create a tag even when admin
  13. Assign instance admins to the protected tag
  14. Test you can create a tag while admin

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports