Commit db33021d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Make it clear that pipeline can process processables

parent 8850da27
...@@ -10,7 +10,7 @@ module Ci ...@@ -10,7 +10,7 @@ module Ci
update_retried update_retried
new_builds = new_builds =
stage_indexes_of_created_builds.map do |index| stage_indexes_of_created_processables.map do |index|
process_stage(index) process_stage(index)
end end
...@@ -27,7 +27,7 @@ module Ci ...@@ -27,7 +27,7 @@ module Ci
return if HasStatus::BLOCKED_STATUS.include?(current_status) return if HasStatus::BLOCKED_STATUS.include?(current_status)
if HasStatus::COMPLETED_STATUSES.include?(current_status) if HasStatus::COMPLETED_STATUSES.include?(current_status)
created_builds_in_stage(index).select do |build| created_processables_in_stage(index).select do |build|
Gitlab::OptimisticLocking.retry_lock(build) do |subject| Gitlab::OptimisticLocking.retry_lock(build) do |subject|
Ci::ProcessBuildService.new(project, @user) Ci::ProcessBuildService.new(project, @user)
.execute(build, current_status) .execute(build, current_status)
...@@ -43,18 +43,18 @@ module Ci ...@@ -43,18 +43,18 @@ module Ci
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def stage_indexes_of_created_builds def stage_indexes_of_created_processables
created_builds.order(:stage_idx).pluck('distinct stage_idx') created_processables.order(:stage_idx).pluck('distinct stage_idx')
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def created_builds_in_stage(index) def created_processables_in_stage(index)
created_builds.where(stage_idx: index) created_processables.where(stage_idx: index)
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
def created_builds def created_processables
pipeline.processables.created pipeline.processables.created
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment