Skip to content

Status checks widget shouldn't appear if no status checks match the branch

Summary

If status checks have been defined but no status checks match the branch the MR is using, the status checks widget still appears but only with the widget header:

image

Steps to reproduce

  1. Create a status check in [HOST]/[GROUP]/[PROJECT]/edit#js-merge-request-settings > Status checks
  2. Create a mergeable MR which uses a different branch from the defined status check
  3. In the MR see the status checks widget appear with only a header

What is the current bug behavior?

The status checks widget header appears even when there are no matching status checks

What is the expected correct behavior?

The status checks widget should not appear at all if there are no matching status checks

Possible fixes

Update the status_checks_report_app to hide the whole section if there are no status checks

Implementation plan (Draft)

backend - 1️⃣

  1. Update ee/app/presenters/ee/merge_request_presenter.rb:71 to filter out any status checks which don't match the MR's branch
  2. Update ee/spec/presenters/merge_request_presenter_spec.rb:184 to test this is the case
Edited by Robert Hunt