Skip to content

Filter duplicated downstreams in mini pipeline graph using REST

Mireya Andres requested to merge update-rest-mini-pipeline-graph into master

What does this MR do and why?

For #367547 (closed)

Retrying a trigger job will create a new downstream pipeline, which means the pipeline graphs can show multiple outdated downstream pipelines.

This MR removes the duplicate circles in the mini pipeline graph of the pipelines table and the MR widget. To show the latest downstream pipeline, source_job.retried is exposed in the API and this is used to filter out outdated pipelines.

Since the retry trigger job feature is not yet available, this should not affect how we render existing pipeline graphs today.

Screenshots or screen recordings

Pipelines Table

Before After
before after

MR Widget

Before After
mr_widget_before mr_widget_after

MR Pipelines Table

mr_widget_pipelines_table

How to set up and validate locally

Setup

  1. Enable the ci_recreate_downstream_pipeline feature flag.

  2. Go to the pipeline editor and add the following to your .gitlab-ci.yml file.

    bridge_job:
      trigger:
        include: child-pipeline.yml

    child-pipeline.yml can have any simple script.

  3. When committing the change, commit to a new branch and create a new merge request with this change.

  4. Go to the pipeline graph for the pipeline triggered after saving the content. bridge_job should have a retry button.

  5. Click on the retry button to retry the trigger job. You can retry multiple times.

Validation

  1. Go to the pipelines table (CI/CD > Pipelines). The mini pipeline graph for the latest pipeline should only show the latest downstream pipeline (only shows one circle for the downstream pipelines no matter how many times we've retried the trigger job).
  2. Go to the MR you just created. The mini pipeline graph in the MR widget should also show only the latest downstream pipeline. This should also be seen in the Pipelines tab of the MR.

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 Mireya Andres

Merge request reports