Consider using mergeable boolean instead merge_status on Merge Request API

Why

Further explained on https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16626#note_55637857.

Currently we expose MergeRequest#merge_status on the Merge Request APIs, which is updated when an user opens a MR page by calling https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/projects/merge_requests_controller.rb#L32. Note that MergeRequest#merge_status is set back to unchecked when users push to the source_branch through the RefreshService, which makes the merge_status being reevaluated in the process.

This is not great mainly because:

  1. We depend on time (i.e. users accessing the Merge Request page) in order to update the state of merge_status
  2. It doesn't consider MRs not being open, or WIP, or the state of discussions, offering a limited information to API users

What

Although a breaking change, I'd rather expose MergeRequest#mergeable?, which:

  1. Considers other MR scenarios
  2. Updates MergeRequest#merge_status if needed

/cc @DouweM @toon @smcgivern

Edited Jun 19, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading