Skip to content

Add status checks merge request widget extension

Jiaan Louw requested to merge jlouw-spike-extended-status-checks into master

What does this MR do and why?

This MR creates a merge request widget extension for status checks as described in #345502 (closed). It does not replace the existing status checks MR widget, and is hidden behind a development feature flag.

This MR also adds the Retry button when the fetch fails #345253 (closed).

Related epic: &7066 (closed)

Screenshots or screen recordings

Click to expand
Screen recording
Kapture_2021-12-02_at_14.00.01
Existing widget New extension
image image

Results summary

Success Pending Failed Mixed
image image image image

Failed

Failed new (top) vs existing (bottom)
image

How to set up and validate locally

Click to expand
  1. Enable the features echo "Feature.enable(:external_status_checks);Feature.enable(:refactor_mr_widgets_extensions)" | rails c
  2. Add a status check, see docs to see how.
  3. View a merge request in the project you created a status check.

Optional setup

You can approve a status check via the API !61300 (merged) or by using this code in rails c:

FactoryBot.definition_file_paths = [Rails.root.join('ee', 'spec', 'factories')]
FactoryBot.find_definitions

# Replace with your MR title
merge_request = MergeRequest.find_by_title('Excepturi culpa officia minus voluptatem maiores cumque autem voluptatum magni.')

# Create the status check
rule = FactoryBot.create(:external_status_check, project: merge_request.project)
# Approve the status check
FactoryBot.create(:status_check_response, external_status_check: rule, merge_request: merge_request, sha: merge_request.source_branch_sha)

Note on failed status checks

While the frontend supports failed status checks, they have yet to be implemented. To test these you need to use the Vue browser extension to copy one of the collapsedData results into the collapsedData.failed array, this will trigger the collapsed summary to update.

MR acceptance checklist

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

Edited by Jiaan Louw

Merge request reports