Skip to content

Expose ID in Types::Projects::BranchRuleType

Joe Woodward requested to merge feat/branch_rule_type-ids into master

What does this MR do and why?

Expose ID in Types::Projects::BranchRuleType

We are in the process of building mutations to update and delete branch rules. Currently there's no way to access the branch rule IDs.

This change exposes a global ID in the branch rule type.

Changelog: added

Closes #438284 (closed)

MR acceptance checklist

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

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Ensure the project you are querying has branches


query {
  project(fullPath: "flightjs/Flight") {
    branchRules {
      nodes {
        id
        isProtected
      }
    }
  }
}

Create a protected branch for one of the branches listed by visiting the repository settings for the project

Perform the query again and the branch should not show

You can also create a wildcard rule and ensure the targeted branches are still returned

Edited by Joe Woodward

Merge request reports