Skip to content

Update ResetSkippedJobsService to support multiple jobs input

Leaminn Ma requested to merge multiple-jobs-input-reset-skipped-jobs into master

What does this MR do and why?

This MR updates ResetSkippedJobsService so that it can take multiple jobs as input.

The purpose of this change is to make ResetSkippedJobsService more performant when processing the dependent jobs of multiple jobs. This feature is intended to be used as part of the fix for #388539 (closed).

Feature Flag: ci_support_reset_skipped_jobs_for_multiple_jobs

Updates include:

  • reset_source_bridge only runs once for all the jobs inputted.
  • needs_dependent_jobs gets all the jobs from the earliest stage of the inputted jobs.
  • needs_dependent_jobs uses a ::Ci::Processable relation that consists of multiple job IDs instead of just one.

Note that ResetSkippedJobsService continues to support a single processable input as well.

Resolves: #410223 (closed)

How to set up and validate locally

All processes that call ResetSkippedJobsService should behave as expected. There should be no visible change in the pipeline processing before and after the FF is turned on.

We can test with a simple pipeline example:

  1. Update your .gitlab-ci.yml file with the following contents: test.yml
  2. Run the pipeline and notice the skipped jobs.

Screenshot_2023-05-09_at_3.23.39_PM

  1. Play the manual job and observe that all the skipped jobs transition to "created" status.

Screenshot_2023-05-09_at_3.23.45_PM

  1. Turn on the feature flag: Feature.enable(:ci_support_reset_skipped_jobs_for_multiple_jobs).
  2. Repeat steps 2-3 and observe that the behaviour is the same.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #410223 (closed)

Edited by Leaminn Ma

Merge request reports

Loading