Make failed jobs widget compatible with GraphQL pipelines response
Issue: Add Failed Jobs expandable widget to GraphQL MR... (#581323) • Sahil Sharma • 18.7 • On track
What does this MR do and why?
As part of MR Pipelines migration to GraphQL (&14144) • Sahil Sharma • 18.7, we need to implement the Failed Jobs expandable widget that currently exists in the REST-based MR Pipelines page. This widget displays a count badge showing the number of failed jobs for each pipeline, allowing users to quickly identify and expand pipelines with failures.
This MR ensures the pipeline failed jobs widget is compatible with GraphQL pipeline responses as part of the MR Pipelines migration to GraphQL.
- Added
failedJobsCountto GraphQL fragment - Modified to check both
failed_builds_count(REST) andfailedJobsCount(GraphQL) fields for backward compatibility - Changed
pipelineIidprop type fromNumbertoStringin the failed jobs widget components, as GraphQL returns IIDs as strings - Modified the logic that auto-expands pipelines with failed jobs to use the
failedJobsCountmethod instead of directly accessingfailed_builds_count
These changes ensure the failed jobs widget works seamlessly with both REST and GraphQL pipeline data sources during the migration period.
How to set up and validate locally
- Enable
Feature.enable(:mr_pipelines_graphql)feature flag - Navigate to a merge request with pipelines that have failed jobs
- Verify the failed jobs widget displays correctly and shows the count of failed jobs
- Expand the widget to see the list of failed jobs
- Ensure that you can retry this failed job
- Confirm the widget works for both feature flag enabled and disabled states
Edited by Sahil Sharma