Skip to content

Define global identifiers for branch rules

Joe Woodward requested to merge feat/global-id-branch_rules into master

What does this MR do and why?

Define global identifiers for branch rules

We are implementing graphql mutations to update and delete branch rules. To do this we need identifiers that we can pass to the mutations. This change uses the ProtectedBranch ID to identify Projects::BranchRule objects and Project ID to identify Projects::AllBranchesRule and Projects::AllProtectedBranchesRule objects.

This change also adds a ::find(id) method to the BranchRule classes allowing us to use global ids to find/intialize the objects.

The Global IDs will take the following formats

  • gid://gitlab/Projects::BranchRule/#{protected_branch.id}
  • gid://gitlab/Projects::AllBranchesRule/#{project.id}
  • gid://gitlab/Projects::AllProtectedBranchesRule/#{project.id}

Closes #438282 (closed)

Changelog: added

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

Numbered steps to set up and validate the change are strongly suggested.

Merge request reports