diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /app/services/ci/after_requeue_job_service.rb | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'app/services/ci/after_requeue_job_service.rb')
-rw-r--r-- | app/services/ci/after_requeue_job_service.rb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/app/services/ci/after_requeue_job_service.rb b/app/services/ci/after_requeue_job_service.rb index 2b611c857c7..b422e57baad 100644 --- a/app/services/ci/after_requeue_job_service.rb +++ b/app/services/ci/after_requeue_job_service.rb @@ -10,8 +10,16 @@ module Ci private def process_subsequent_jobs(processable) - processable.pipeline.processables.skipped.after_stage(processable.stage_idx).find_each do |processable| - process(processable) + if Feature.enabled?(:ci_same_stage_job_needs, processable.project, default_enabled: :yaml) + (stage_dependent_jobs(processable) | needs_dependent_jobs(processable)) + .each do |processable| + process(processable) + end + else + skipped_jobs(processable).after_stage(processable.stage_idx) + .find_each do |job| + process(job) + end end end @@ -24,5 +32,17 @@ module Ci processable.process(current_user) end end + + def skipped_jobs(processable) + processable.pipeline.processables.skipped + end + + def stage_dependent_jobs(processable) + skipped_jobs(processable).scheduling_type_stage.after_stage(processable.stage_idx) + end + + def needs_dependent_jobs(processable) + skipped_jobs(processable).scheduling_type_dag.with_needs([processable.name]) + end end end |