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

  1. Create a group and project test-group/test-project

  2. Create a group-level protected branch:

    • Navigate to the group's Settings → Repository
    • Expand "Protected branches" section
    • Add a protected branch rule
  3. Create a project-level branch rule:

    • Navigate to the project's Settings → Repository
    • Expand "Branch rules" section
    • Add a protected branch rule
  4. Run graphql query:

    query {
      project(fullPath: "test-group/test-project") {
        branchRules {
          nodes {
            name
            branchProtection {
              isGroupLevel
            }
          }
        }
      }
    }
  5. Expected results:

    • Group-level rules should return isGroupLevel: true
    • Project-level rules should return isGroupLevel: false

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

Merge request reports

Loading