Skip to content

Create GraphQL Mutation: `BranchRuleExternalStatusCheckDestroy`

What does this MR do and why?

This MR does the following:

  • Creates a new mutation: BranchRuleExternalStatusCheckDestroy, which allows users to delete an external status check from branch rules.
  • Creates a new service: BranchRules::ExternalStatusChecks::DestroyService, which handles the logic for deleting an external status check.
  • Updates the documentation to reflect these changes.

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.

How to set up and validate locally

  1. Create a protected branch and then create a branch rule.
  2. Create an external_status_check record using the API or directly in your Rails console.
  3. Go to https://<YOUR_GDK_HOST>:<YOUR_GDK_PORT>/-/graphql-explorer
  4. Apply the following query:
mutation DestroyMutation($id: MergeRequestsExternalStatusCheckID!, $branchRuleId: ProjectsBranchRuleID!) {
  branchRuleExternalStatusCheckUpdate(input: {
    id: $id
    branchRuleId: $branchRuleId
  }) {
    errors
  }
}

Your query variables could look like this:

{
   "id": "gid://gitlab/MergeRequests::ExternalStatusCheck/1",
   "branchRuleId": "gid://gitlab/Projects::BranchRule/36",
}
  1. In the Rails console, validate that the external status check does not exist:
MergeRequests::ExternalStatusCheck.find(1)

Related to #439400 (closed)

Edited by Javiera Tapia

Merge request reports