Rollback mutation of merge request on failed merge
What does this MR do?
The second call to the Gitaly UserMergeBranch RPC method can raise an
exception. Previously, if this were to happen, the merge request's
in_progress_merge_commit_sha
attribute would be set to a commit SHA
that didn't exist.
Repository#merge
now uses a transaction block in order to rollback
the setting of this attribute if any error occurs.
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation created/updated or follow-up review issue created
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Performance and testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
Closes #60720 (moved)
Edited by Luke Duncalfe