Merge request fails to merge if another MR is merged at the same time
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
We quite often experience issues on our Gitlab.com projects where multiple MR are merged around the same time +/- 2 seconds and randomly fail.
These MR are created from trigger jobs with the setting Auto-merge enabled
. The pipelines are successful and the merge event is triggered but then fails for one out of three MR with the error message <User> restored source branch <Branch name>
.
The changes in these MR are not related, different files are edited and it fails with the following error:
There is no conflicts and manually merging works without an issue but our process is meant to be automated.
Steps to reproduce
Create multiple MR with unrelated changes to avoid conflicts using the following flags:
git push -o merge_request.create -o merge_request.merge_when_pipeline_succeeds -o merge_request.remove_source_branch -o merge_request.target=main --set-upstream origin "trigger/$(date +%s%N)"
What is the current bug behavior?
One or more of the MR fail to merge with the above error message.
What is the expected correct behavior?
All MR should be merged either immediately or added to a queue of some kind.
Output of checks
This bug happens on GitLab.com