diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /app/workers/ci | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'app/workers/ci')
4 files changed, 60 insertions, 1 deletions
diff --git a/app/workers/ci/drop_pipeline_worker.rb b/app/workers/ci/drop_pipeline_worker.rb new file mode 100644 index 00000000000..d19157a47e8 --- /dev/null +++ b/app/workers/ci/drop_pipeline_worker.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Ci + class DropPipelineWorker + include ApplicationWorker + include PipelineQueue + + idempotent! + + def perform(pipeline_id, failure_reason) + Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline| + Ci::DropPipelineService.new.execute(pipeline, failure_reason.to_sym) + end + end + end +end diff --git a/app/workers/ci/initial_pipeline_process_worker.rb b/app/workers/ci/initial_pipeline_process_worker.rb new file mode 100644 index 00000000000..f59726c87fb --- /dev/null +++ b/app/workers/ci/initial_pipeline_process_worker.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Ci + class InitialPipelineProcessWorker + include ApplicationWorker + include PipelineQueue + + queue_namespace :pipeline_processing + feature_category :continuous_integration + urgency :high + loggable_arguments 1 + idempotent! + + def perform(pipeline_id) + Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline| + Ci::ProcessPipelineService + .new(pipeline) + .execute + end + end + end +end diff --git a/app/workers/ci/merge_requests/add_todo_when_build_fails_worker.rb b/app/workers/ci/merge_requests/add_todo_when_build_fails_worker.rb new file mode 100644 index 00000000000..d5e097dc2b5 --- /dev/null +++ b/app/workers/ci/merge_requests/add_todo_when_build_fails_worker.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +module Ci + module MergeRequests + class AddTodoWhenBuildFailsWorker + include ApplicationWorker + include PipelineQueue + + urgency :low + idempotent! + + def perform(job_id) + job = ::CommitStatus.with_pipeline.find_by_id(job_id) + project = job&.project + + return unless job && project + + ::MergeRequests::AddTodoWhenBuildFailsService.new(job.project, nil).execute(job) + end + end + end +end diff --git a/app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb b/app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb index 0bb911bc6c8..fff979d95a9 100644 --- a/app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb +++ b/app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb @@ -14,7 +14,7 @@ module Ci feature_category :continuous_integration def perform - service = ::Ci::PipelineArtifacts::DestroyExpiredArtifactsService.new + service = ::Ci::PipelineArtifacts::DestroyAllExpiredService.new artifacts_count = service.execute log_extra_metadata_on_done(:destroyed_pipeline_artifacts_count, artifacts_count) end |