Skip to content

Add external status checks failed MR widget

What does this MR do and why?

This MR adds a new message to the MergeChecksFailed widget that shows "Merge blocked: all status checks must pass." when a MR is blocked by failing external status checks.

Screenshot Video demo 1 Video demo 2
ksnip_20221107-225054 2022-11-07_22-52-25 2022-11-07_22-56-28

How to set up and validate locally

  1. Enable the only_allow_merge_if_all_status_checks_passed feature flag.
  2. Go to a project and enable the Status checks must succeed setting in Projects -> Settings -> Merge requests:
ksnip_20221107-230019
  1. Create some fake status checks on the same page. You can fill in anything for the fields:
ksnip_20221107-230151 ksnip_20221107-230249
  1. Create a MR, most easily done using the Web IDE. Verify that the status checks MR widget is shown, and that the merge blocked message is shown below it.

  2. Disable the Status checks must succeed setting and verify that the MR can now be merged despite pending status checks.

  3. To test the status checks themselves, you must first create an access token, then use a curl call to change the status check:

2022-11-07_23-26-05

curl --request POST 'http://localhost:3000/api/v4/projects/20/merge_requests/7/status_check_responses' --header 'Authorization: Bearer glpat-MMx2tg7QpJMVUQFETYNe' --data-raw '{ "id": 20, "merge_request_iid": 7, "sha": "6cb810d66d821883d0c6d08bc38571ce4874f69a", "external_status_check_id": 2, "status": "failed" }' --header 'Content-Type: application/json'

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #369861 (closed)

Edited by Daniel Tian

Merge request reports