Loading
Draft: Return the persisted issue when updateIssue fails
What does this MR do and why?
When updateIssue fails, the payload now returns the issue as it is stored.
On a failed update, Mutations::Issues::Update returned the issue with the unsaved values still assigned in memory, so the payload showed values that were never saved, such as a rejected work item type or a new title. The mutation now resets the issue when the update has errors, as setConfidential, mergeRequestUpdate and updateSnippet already do.
This MR has no flag. It is a bug fix. The payload only changes on failed updates, where it now matches what is stored.
References
- Part of the split of !260607 (merged).
- No dependencies. Based on
master. - Merge before !261249. Without it,
updateIssuereturns the rejected type whenenforce_work_item_type_availabilityblocks a change.
How to set up and validate locally
- Call
updateIssuewith a new title and a type change that is rejected, for example changing an issue that has a child task to Task. - The mutation returns the error.
- The returned issue still has its original title and type.
Specs:
spec/requests/api/graphql/mutations/issues/update_spec.rb
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist.
Edited by Alexandru Croitor