diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-30 15:07:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-30 15:07:29 +0300 |
commit | 96e4317f73c749841cc1d808b788d43aa3407a4a (patch) | |
tree | 65b8eaff9de051b5cf377ab99b057160401f22c1 /app/services | |
parent | ef144889c1bb80372e25f38fc89c7832ce84417a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/ci/reset_skipped_jobs_service.rb | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/app/services/ci/reset_skipped_jobs_service.rb b/app/services/ci/reset_skipped_jobs_service.rb index cb793eb3e06..9e5c887b31b 100644 --- a/app/services/ci/reset_skipped_jobs_service.rb +++ b/app/services/ci/reset_skipped_jobs_service.rb @@ -7,7 +7,6 @@ module Ci def execute(processables) @processables = Array.wrap(processables) @pipeline = @processables.first.pipeline - @processable = @processables.first # Remove with FF `ci_support_reset_skipped_jobs_for_multiple_jobs` process_subsequent_jobs reset_source_bridge @@ -43,27 +42,17 @@ module Ci end def stage_dependent_jobs - if ::Feature.enabled?(:ci_support_reset_skipped_jobs_for_multiple_jobs, project) - # Get all jobs after the earliest stage of the inputted jobs - min_stage_idx = @processables.map(&:stage_idx).min - @pipeline.processables.after_stage(min_stage_idx) - else - @pipeline.processables.after_stage(@processable.stage_idx) - end + # Get all jobs after the earliest stage of the inputted jobs + min_stage_idx = @processables.map(&:stage_idx).min + @pipeline.processables.after_stage(min_stage_idx) end def needs_dependent_jobs - if ::Feature.enabled?(:ci_support_reset_skipped_jobs_for_multiple_jobs, project) - # We must include the hierarchy base here because @processables may include both a parent job - # and its dependents, and we do not want to exclude those dependents from being processed. - ::Gitlab::Ci::ProcessableObjectHierarchy.new( - ::Ci::Processable.where(id: @processables.map(&:id)) - ).base_and_descendants - else - ::Gitlab::Ci::ProcessableObjectHierarchy.new( - ::Ci::Processable.where(id: @processable.id) - ).descendants - end + # We must include the hierarchy base here because @processables may include both a parent job + # and its dependents, and we do not want to exclude those dependents from being processed. + ::Gitlab::Ci::ProcessableObjectHierarchy.new( + ::Ci::Processable.where(id: @processables.map(&:id)) + ).base_and_descendants end def ordered_by_dag(jobs) |