"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:

  1. While an MR had a passing pipeline, an external resource changed in a way that broke the pipeline on master
  2. A fix was pushed to master
  3. New commits were pushed to the MR branch, but the pipeline failed, because it was missing the fix on master
  4. The MR author could not click "Rebase" to get the fix from master

Steps to reproduce

  1. Create a .gitlab-ci.yml file on master with a failing pipeline.
  2. Create a branch and make the pipeline fail. Push the branch and create a merge request.
  3. Fix the failure on master and push.
  4. 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
  1. 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:

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.