Use merged MR object for security cherry-picking
Previously, the MergeRequestsMerger would loop over a list of merge requests, attempt to merge them, and then map that list to an Array of arrays:
[merge_status, merge_request]
Where merge_status
is a Boolean indicating whether or not it was
merged, and merge_request
was the thing it attempted to merge.
That list was then passed to MergeResult
to separate them based on
merge_status
into either merged
or not_merged
. The cherry-picker
would grab the list of merged
MRs and then attempt to cherry-pick into
the auto-deploy branch using its merge_commit_sha
attribute.
However! Way back at the time of merging, we were storing the merge
status and the original merge request object, which has no
merge_commit_sha
attribute.
We now merge and return the status with the updated merge request object, which has the attribute we need later.
Closes https://gitlab.com/gitlab-org/release-tools/-/issues/414