Filter out duplicated downstreams in pipeline graph
What does this MR do and why?
When the FF ci_recreate_downstream_pipeline
is enabled, we need to filter out downstream pipelines which source job has been retried. This is to avoid seeing multiple downstreams related to a single trigger job as these pipelines are no longer the "latest". When the FF is off, it should not filter anything out and the behaviour should stay the same. Why? Because we base the filtering out on .retried
of the sourceJob data, and a trigger job cannot be retried unless the FF is on, so we are just going to not filter anything out if retried is false, which it will be for all downstream without the FF enabled.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- Enable
ci_recreate_downstream_pipeline
- Make sure you have enabled runners in your GDK https://docs.gitlab.com/runner/configuration/macos_setup.html
- Write a CI/CD configuration with at least one downstream pipeline. Given that you have another repository (let's call it
my-other-project
) and that your username isroot
, something like this will work (Also make sure that the other project also has a functioning runner.):
trigger_job1:
stage: build
trigger: 'root/my-other-project'
- Run a pipeline
- Go to the pipeline graph (Ci/CD => Pipelines => select one pipeline)
- Notice that
trigger_job1
is retryable - Notice there should be only one downstream card
- Click on retry
- Notice there is still only one downstream card
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.