Loading
Add GraphQL mutation for merge request request changes
What does this MR do and why?
Adds a new GraphQL mutation mergeRequestRequestChanges that allows reviewers to request changes on a merge request programmatically.
Previously, requesting changes was only available via the /request_changes slash command, which required creating a note. This mutation provides a more explicit and direct API for requesting changes.
Usage
mutation {
mergeRequestRequestChanges(input: {
projectPath: "gitlab-org/gitlab"
iid: "12345"
}) {
mergeRequest {
id
title
}
errors
}
}
Implementation details
The mutation uses the existing MergeRequests::UpdateReviewerStateService which handles:
- Updating reviewer state to
requested_changes - Creating a system note for the change
- Removing any existing approval from the user
- Triggering appropriate GraphQL subscriptions
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.
Related issues
Closes: N/A (Feature improvement)