"Rebase" button does not appear if out-of-date MR has failing pipeline
Summary
When a repository is configured with these settings:
- Merge commit with semi-linear history
- Only allow merge requests to be merged if the pipeline succeeds
and there exists a merge request that:
- is one or more commits behind the target branch
- has a failing pipeline
the "Rebase" button does not appear on the MR.
This occurred in my (private) project because these things happened:
- While an MR had a passing pipeline, an external resource changed in a way that broke the pipeline on
master - A fix was pushed to
master - New commits were pushed to the MR branch, but the pipeline failed, because it was missing the fix on
master - The MR author could not click "Rebase" to get the fix from
master
Steps to reproduce
- Create a
.gitlab-ci.ymlfile onmasterwith a failing pipeline. - Create a branch and make the pipeline fail. Push the branch and create a merge request.
- Fix the failure on
masterand push. - Under Settings > General > Merge request settings, ensure these options are selected:
- Merge commit with semi-linear history
- Only allow merge requests to be merged if the pipeline succeeds
- Visit the MR. Note that the Merge button is disabled (expected), but no Rebase button appears (bug).
Example Project
Failing pipeline initially on master, fixed on master:
Failing pipeline only on MR branch:
- No merge conflict: brett.higgins/disabled-rebase-demo!2
- Merge conflict: brett.higgins/disabled-rebase-demo!1
What is the current bug behavior?
The Rebase button does not appear.
What is the expected correct behavior?
The Merge button is still disabled, but the Rebase button appears.
Output of checks
This bug happens on gitlab.com.