Expose group_level field for BranchProtectionType
What does this MR do and why?
What
Expose group_level field for BranchProtectionType.
Why
Enables frontend to determine if the edit option should be available for the rule at project level.
References
Related to Group branch rule update fails with permission ... (#555424 - closed)
How to set up and validate locally
-
Create a group and project
test-group/test-project -
Create a group-level protected branch:
- Navigate to the group's Settings → Repository
- Expand "Protected branches" section
- Add a protected branch rule
-
Create a project-level branch rule:
- Navigate to the project's Settings → Repository
- Expand "Branch rules" section
- Add a protected branch rule
-
Run graphql query:
query { project(fullPath: "test-group/test-project") { branchRules { nodes { name branchProtection { isGroupLevel } } } } } -
Expected results:
- Group-level rules should return
isGroupLevel: true - Project-level rules should return
isGroupLevel: false
- Group-level rules should return
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.
Edited by Gavin Hinfey