Filter duplicated downstreams in mini pipeline graph using REST
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 |
---|---|
MR Widget
Before | After |
---|---|
MR Pipelines Table
How to set up and validate locally
Setup
-
Enable the
ci_recreate_downstream_pipeline
feature flag. -
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. -
When committing the change, commit to a new branch and create a new merge request with this change.
-
Go to the pipeline graph for the pipeline triggered after saving the content.
bridge_job
should have a retry button. -
Click on the retry button to retry the trigger job. You can retry multiple times.
Validation
- 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).
- 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.
-
I have evaluated the MR acceptance checklist for this MR.