Add status checks merge request widget extension
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 |
---|
Existing widget | New extension |
---|---|
Results summary
Success | Pending | Failed | Mixed |
---|---|---|---|
Failed
Failed new (top) vs existing (bottom) |
---|
How to set up and validate locally
Click to expand
- Enable the features
echo "Feature.enable(:external_status_checks);Feature.enable(:refactor_mr_widgets_extensions)" | rails c
- Add a status check, see docs to see how.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.