Skip to content

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
Screenshot_2023-01-31_at_2.05.58_PM Screenshot_2023-01-31_at_1.05.18_PM

How to set up and validate locally

  1. Enable ci_recreate_downstream_pipeline
  2. Make sure you have enabled runners in your GDK https://docs.gitlab.com/runner/configuration/macos_setup.html
  3. 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 is root, 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'
  1. Run a pipeline
  2. Go to the pipeline graph (Ci/CD => Pipelines => select one pipeline)
  3. Notice that trigger_job1 is retryable
  4. Notice there should be only one downstream card
  5. Click on retry
  6. 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.

Merge request reports