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 |
---|---|---|
2022-11-07_22-52-25 | 2022-11-07_22-56-28 |
How to set up and validate locally
- Enable the
only_allow_merge_if_all_status_checks_passed
feature flag. - Go to a project and enable the
Status checks must succeed
setting in Projects -> Settings -> Merge requests:
- Create some fake status checks on the same page. You can fill in anything for the fields:
-
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.
-
Disable the
Status checks must succeed
setting and verify that the MR can now be merged despite pending status checks. -
To test the status checks themselves, you must first create an access token, then use a curl call to change the status check:
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #369861 (closed)
Edited by Daniel Tian