Add mutations to update squash options
What does this MR do and why?
Support updating squash options for branch rules:
- Add mutation for updating/creating and deleting squash options for branch rules
- Validate name changes on protected branches with squash options
Example update request
mutation ($input: BranchRuleSquashOptionUpdateInput!) {
branchRuleSquashOptionUpdate(input: $input) {
errors
squashOption {
option
helpText
}
}
}
{
"input": {
"branchRuleId":"gid://gitlab/Projects::BranchRule/293",
"squashOption": "NEVER"
}
}
Example delete request
mutation ($input: BranchRuleSquashOptionDeleteInput!) {
branchRuleSquashOptionDelete(input: $input){
errors
}
}
{
"input": {
"branchRuleId": "gid://gitlab/Projects::BranchRule/318"
}
}
References
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
- Simulate Saas (https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-saas-instance)
- Enable the
branch_rule_squash_settingsfeature flag - Create a group and add a premium plan to the group
- Create a project in the group and add a protected branch
- Try the update mutation to create/update a squash option
- Try updating the protected branch to use a wildcard
- Try the delete mutation to delete the squash option
Related to #498700 (closed)
Edited by Joe Woodward