Skip to content

List all external status checks and their statuses

Max Woolf requested to merge 328211-list-mr-external-approvals into master

What does this MR do?

  • Adds a sha column to the external_status_checks table of type bytea.
  • Adds a REST API endpoint [GET] /projects/:id/merge_requests/:merge_request_iid/status_checks that returns a list of all external approval rules (soon to be renamed external status checks) and whether or not the latest SHA for that merge request has received an approval for it.
  • Adds a method approved? to check if a particular external approval rule has received an approval for a particular SHA in an MR.

Database Review

Migrate

== 20210510083845 AddShaToStatusCheckResponse: migrating ======================
-- add_column(:status_check_responses, :sha, :binary, {:null=>false, :default=>""})
   -> 0.0041s
== 20210510083845 AddShaToStatusCheckResponse: migrated (0.0042s) =============

Rollback

== 20210510083845 AddShaToStatusCheckResponse: reverting ======================
-- remove_column(:status_check_responses, :sha)
   -> 0.0029s
== 20210510083845 AddShaToStatusCheckResponse: reverted (0.0030s) =============

Walkthrough video

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #328211 (closed)

Edited by Max Woolf

Merge request reports