Skip to content

Identify a clearer message when the merge request is considered 'broken'

What does this MR do and why?

The current check is not cohesive, and can fail for multiple reasons, while we also have another mergeability check which checks if there is a conflict.

The current broken checks, checks the broken? method, this will check:

has_no_commits? || branch_missing? || cannot_be_merged?

In the more specific conflict check, we check for can_be_merged? (https://gitlab.com/gitlab-org/gitlab/-/blob/4c43e319b3bed672dc38b79bddc9e7381a1444c7/app/services/merge_requests/mergeability/check_conflict_status_service.rb#L10)

So, therefore, we could remove the cannot_be_merged check, and use only the other two parts of the broken? method call right ?

Related: #385910 (closed)

To Test:

  • Enable switch_broken_status feature flag
  • Create an MR with a conflict (Conflict
  • Create an MR with no commits
  • Create an MR with no source branch
  • Create a mergeable MR
  • Check statuses for each

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to

Edited by Marc Shaw

Merge request reports