Merge train-enabled merge request fails with "Merge request is not mergeable", succeeds on retry without changes
Summary
One of our projects (premium SaaS customer) uses merge trains for merge requests.
Steps to reproduce
We have not created a reproducer at this time, as we're uncertain of the cause of the failure. An update will be provided if we determine the cause.
What is the current bug behavior?
A merge request added to a merge train fails to merge after the merge train has succeeded, without any user-visible unsatisfied conditions or history changes in the target branch. The error is generic removed this merge request from the merge train because failed to merge. Merge request is not mergeable
, and does not provide any actionable data to the user.
A retry (without any changes to the merge request or source branch) succeeds.
What is the expected correct behavior?
A merge request should be successfully merged if its merge train pipeline has succeeded.
If for whatever reason this is not possible, a detailed error should be supplied to the user if the condition preventing successful merge requires user action. If the condition preventing merge does not require user action, GitLab should retry automatically until the merge is successful.
Relevant logs and/or screenshots
Event history:
Note that there were no changes to the merge request or the source branch between the merge failure and the subsequent merge train pipeline creation and successful merge. This suggests that the cause of merge failure was not a missing prerequisite (such as a missing approval, unresolved discussion, unmerged merge request dependency, etc) or conflict, as nothing was modified prior to the successful merge.
I also confirmed that there were no pushes to the target branch (outside of a merge train) between the commit the merge train used as its first parent, and the time the merge failed.
Pipelines for merge request:
Note that the merge train pipelines were cancelled several times before a successful pipeline, due to merge train invalidation. Also note that there were two successful merge train pipelines. The failed merge happened after the first successful merge train pipeline. After the failure, the merge request remained unmerged until it was added to the merge train again.
Output of checks
This bug happens on GitLab.com