Skip to content

Add support for failing status checks

Max Woolf requested to merge 329636-failed-status-external-status-checks into master

What does this MR do and why?

  • Previously, it was only possible to approve an external status check. The existence of a StatusCheckResponse was implicitly an approval.
  • This MR adds support for a failing status without creating breaking changes.

API Changes

  • [POST] projects/:id/merge_requests/:iid/status_check_responses now accepts an optional status parameter which can be approved or failed. When no value is passed, it is assumed the response is approved. This is to avoid introducing a breaking change.
  • [GET] projects/:id/merge_requests/:iid/status_checks returns passed instead of approved in the status field.
  • Documentation has been updated.

Frontend changes

  • Updates text (using : instead of ,)
  • Shows failure icons if any status checks fail
  • More useful test showing total numbers of failing, pending and approved checks

Backend and database changes

  • Adds a new column (status) to external_status_checks
  • Updates API responses to show all 3 potential statuses.
  • Reasoning for no index: !81005 (comment 849423603)
  • Places the breaking changes in this MR behind a default-off feature flag.

Migration

Up

== 20220217113058 AddStatusToStatusCheckResponses: migrating ==================
-- add_column(:status_check_responses, :status, :integer, {:default=>0, :null=>false, :limit=>2})
   -> 0.0080s
== 20220217113058 AddStatusToStatusCheckResponses: migrated (0.0080s) =========

Down

== 20220217113058 AddStatusToStatusCheckResponses: reverting ==================
-- remove_column(:status_check_responses, :status, :integer, {:default=>0, :null=>false})
   -> 0.0108s
== 20220217113058 AddStatusToStatusCheckResponses: reverted (0.0129s) =========

Screenshots or screen recordings

Flag on Flag off
All pending flag-on-all-pending flag-off-all-pending1
All passed flag-on-all-passed flag-off-all-passed
Mixed statuses flag-on-mixed-status Not possible. All statuses are passing.

How to set up and validate locally

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 #329636 (closed)

Edited by Max Woolf

Merge request reports