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.

  1. Added failedJobsCount to GraphQL fragment
  2. Modified to check both failed_builds_count (REST) and failedJobsCount (GraphQL) fields for backward compatibility
  3. Changed pipelineIid prop type from Number to String in the failed jobs widget components, as GraphQL returns IIDs as strings
  4. Modified the logic that auto-expands pipelines with failed jobs to use the failedJobsCount method instead of directly accessing failed_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

  1. Enable Feature.enable(:mr_pipelines_graphql) feature flag
  2. Navigate to a merge request with pipelines that have failed jobs
  3. Verify the failed jobs widget displays correctly and shows the count of failed jobs
  4. Expand the widget to see the list of failed jobs
  5. Ensure that you can retry this failed job
  6. Confirm the widget works for both feature flag enabled and disabled states
Edited by Sahil Sharma

Merge request reports

Loading