Automerge not working when rebase is needed.
Summary
Automerge option conflicts with Rebase.
Steps to reproduce
On a project with "Merge commit with semi-linear history" option enabled, select a merge request to "Merge when pipeline succeeds" while it's pipeline is still running.
If another merge request gets merged while the pipeline is running, this MR will need a Rebase, but the Automerge option will be still enabled and displaying the message Set by {} to be merged automatically when the pipeline succeeds even if the pipeline has already finished.
Only once you cancel the Automatic Merge, the Rebase button appears.
What is the current bug behavior?
When a Merge Request is selected for Automerge, and the project has "Merge commit with semi-linear history" option enabled, if the MR is marked for merging when the pipeline succeeds but new commits make it to the target branch before the pipeline ends, the "Merged automatically when pipeline succeeds" message won't dissappear.
What is the expected correct behavior?
The automatic merge should be canceled or something. Its not intuitive.
Where.
This happens on my instance, running 11.4, and has always happened since we enabled the "semi-linear history" option a few releases ago.