Skip to content

Implement mergeabilityChecks GraphQL field

Patrick Bajao requested to merge 423110-merge-checks-graphql into master

What does this MR do and why?

Frontend will need to display failed merge checks on the merge widget. In order for frontend to be able to do that, they need to be able to query mergeability checks status via GraphQL and determine which ones failed or not.

This adds a new mergeabilityChecks field for the MergeRequest type which can be queried by something like:

mergeRequest(iid: 1) {
  mergeabilityChecks {
    identifier
    status
  }
}

identifier is the name of the mergeability check and status can be success, failed or inactive. inactive status means that the mergeability check didn't get executed for the merge request due to a setting being disabled. Implementation of inactive checks will be in a separate merge request.

Since we want to show all checks when mergeabilityChecks is queried, this also adds support for RunChecksService#execute to accept an execute_all param. If it's set to true, all checks will run even if a check fails (by default, we return early when a check fails and we don't run succeeding checks).

A separate MR is also created to add failureReason field to keep this MR small: !132721 (closed).

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

Edited by Patrick Bajao

Merge request reports