Cannot rebase merge request that isn't 100% approved

Summary

For projects with the option "fast-forward only" or "semi-linear history" merge method, a rebase button is displayed if the merge branch is behind the target branch.

However, when clicking this button for a merge request that doesn't have the prerequisite number of approvals, a generic error message is shown. Further investigation shows that the approved? check is still in place on the backend

Steps to reproduce

  1. Create a MR on a project with the "semi-linear history" merge method
  2. Make sure that project does not have the required number of approvers
  3. Put a dummy commit on the target branch so the target branch is ahead of the merge branch.
  4. Click the rebase button

Expected behavior

The merge branch should be rebased

Actual behavior

A generic error message is displayed

Possible Fix

app/models/merge_request.rb line 808

Could probably add && approved? to that line to fix

Picture of issue

repro

Environment

GitLab 8.16.1-ee

GitLab Shell 4.1.1

GitLab Workhorse v1.3.0

GitLab API v3

Git 2.10.2

Ruby 2.3.3p222

Rails 4.2.7.1

PostgreSQL 9.2.18

Edited May 19, 2022 by Coung Ngo
Assignee Loading
Time tracking Loading