Add group-level indicator to branch protection

What does this MR do and why?

Add group-level indicator to branch protection

New branch rule view was showing group level protections without a clear indication and with option to edit. Marking protected branches with their level helps show the rules is inherited and need editing on group level.

  • all four sections of protected branches now have a lock icon with popover explaining inheritance
  • clear message for users that can or cannot group level protection, on what to do to edit them
  • delete button is not rendered for inherited rules

References

Screenshots or screen recordings

Context Before After
cannot edit group level protection Screenshot_2025-08-25_at_18.11.33 Screenshot_2025-08-25_at_18.13.32
can edit group level protection Screenshot_2025-08-25_at_18.17.28 Screenshot_2025-08-25_at_17.51.42
project level protection, no changes expected Screenshot_2025-08-25_at_17.51.30 Screenshot_2025-08-25_at_17.51.30

Screen reader

Screenshot_2025-08-25_at_17.44.00

How to set up and validate locally

  1. Go to the group. Navigate to Settings / Repository / Protected branches. Example: http://gdk.test:8080/groups/flightjs/-/settings/repository#js-protected-branches-settings
  2. Set a group level protected branch. For example, for *-group-level wildcard.
  3. Go to a project within that group. Navigate to Settings / Repository / Branch rules / [YOUR_GROUP_LEVEL_PROTECTED_BRANCH]. For example: http://gdk.test:8080/flightjs/Flight/-/settings/repository/branch_rules?branch=*-group-level
  4. As the administrator you should have all controls in Protect branch section locked with a popover that includes a link to http://gdk.test:8080/groups/flightjs/-/settings/repository#js-protected-branches-settings.
  5. Now go to Admin / Users and select a user that has a maintainer role in your project. For example: http://gdk.test:8080/admin/users/thora. Impersonate that user.
  6. Go to a project within that group. Navigate to Settings / Repository / Branch rules / [YOUR_GROUP_LEVEL_PROTECTED_BRANCH]. For example: http://gdk.test:8080/flightjs/Flight/-/settings/repository/branch_rules?branch=*-group-level
  7. As the maintainer you should have all controls in Protect branch section locked with a popover that links to a documentation on group level protections.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #555424 (closed)

Edited by Paulina Sedlak-Jakubowska

Merge request reports

Loading