Create GraphQL Mutation: `BranchRuleExternalStatusCheckUpdate`
requested to merge 439399-edit-branch-rules-status-check-create-graphql-mutation-editexternalstatuscheck into master
What does this MR do and why?
This MR does the following:
- Creates a new mutation:
BranchRuleExternalStatusCheckUpdate
, which allows users to update external status checks from branch rules. - Creates a new service:
BranchRules::ExternalStatusChecks::UpdateService
, which handles the logic for updating external status checks. - 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.
Screenshots or screen recordings
How to set up and validate locally
- Create a protected branch and then create a branch rule.
- Create an
external_status_check
record using the API or directly in your Rails console. - Go to
https://<YOUR_GDK_HOST>:<YOUR_GDK_PORT>/-/graphql-explorer
- Apply the following query:
mutation UpdateMutation($id: MergeRequestsExternalStatusCheckID!, $branchRuleId: ProjectsBranchRuleID!, $name: String!, $externalUrl: String!) {
branchRuleExternalStatusCheckUpdate(input: {
id: $id
branchRuleId: $branchRuleId
name: $name
externalUrl: $externalUrl
}) {
externalStatusCheck {
id
name
externalUrl
}
errors
}
}
Your query variables could look like this:
{
"id": "gid://gitlab/MergeRequests::ExternalStatusCheck/1",
"branchRuleId": "gid://gitlab/Projects::BranchRule/36",
"name": "Updated name!",
"externalUrl": "http://my-external-url-test.com"
}
- An updated
ExternalStatusCheck
should appear:
Related to:
Edited by Javiera Tapia