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:
- We depend on time (i.e. users accessing the Merge Request page) in order to update the state of
merge_status - 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:
- Considers other MR scenarios
- Updates
MergeRequest#merge_statusif needed
/cc @DouweM @toon @smcgivern
Edited by 🤖 GitLab Bot 🤖