Filter latest downstream pipelines for the pipeline editor mini graph
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 creates a util function for filtering out the outdated downstream pipelines via the sourceJob.retried
property. If the the source job (trigger job) has retried = false
, this means that it is the latest trigger job, which means the pipeline associated to it will be rendered.
This is tested on the mini pipeline graph for the pipeline editor, which uses GraphQL. Updates for other mini pipeline graphs (some of which use REST or Rails injection) will be done in future MRs.
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
Before | After |
---|---|
Main Pipeline Graph (for comparison)
How to set up and validate locally
-
Enable the
ci_recreate_downstream_pipeline
feature flag. -
Add the following to your
.gitlab-ci.yml
file.bridge_job: trigger: include: child-pipeline.yml
child-pipeline.yml
can have any simple script. -
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. You'll notice that the main pipeline graph will show ALL the downstream pipelines.
-
Go back to the pipeline editor. Notice that the mini pipeline graph on the status bar only shows the LATEST downstream pipeline (only shows one circle, as opposed to the multiple downstream pipelines shown in the main pipeline graph).
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.