Fix missing sha default in merge trains API
What does this MR do and why?
MergeRequests::MergeService
requires
merge_request.merge_params['sha']
to be present and up-to-date in
order to merge. Otherwise it fails with an error stating that the branch
is out of date.
See #409339 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Create a project with merge trains enabled
- Open a merge request
- With
GDK_TOKEN
,PROJECT_ID
andMR_IID
set in your environment, run:curl --request POST --header "PRIVATE-TOKEN: $GDK_TOKEN" \ "https://gdk.test:3000/api/v4/projects/$PROJECT_ID/merge_trains/merge_requests/$MR_IID"
- On the MR page, observe that a merge train starts and the merge request gets merged.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Hordur Freyr Yngvason