diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/workers/ci | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/workers/ci')
-rw-r--r-- | app/workers/ci/daily_build_group_report_results_worker.rb | 2 | ||||
-rw-r--r-- | app/workers/ci/pipeline_artifacts/coverage_report_worker.rb (renamed from app/workers/ci/pipelines/create_artifact_worker.rb) | 8 | ||||
-rw-r--r-- | app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb | 23 |
3 files changed, 30 insertions, 3 deletions
diff --git a/app/workers/ci/daily_build_group_report_results_worker.rb b/app/workers/ci/daily_build_group_report_results_worker.rb index a6d3c485e24..687cadc6366 100644 --- a/app/workers/ci/daily_build_group_report_results_worker.rb +++ b/app/workers/ci/daily_build_group_report_results_worker.rb @@ -5,6 +5,8 @@ module Ci include ApplicationWorker include PipelineBackgroundQueue + feature_category :code_testing + idempotent! def perform(pipeline_id) diff --git a/app/workers/ci/pipelines/create_artifact_worker.rb b/app/workers/ci/pipeline_artifacts/coverage_report_worker.rb index 220df975503..4de56f54f44 100644 --- a/app/workers/ci/pipelines/create_artifact_worker.rb +++ b/app/workers/ci/pipeline_artifacts/coverage_report_worker.rb @@ -1,16 +1,18 @@ # frozen_string_literal: true module Ci - module Pipelines - class CreateArtifactWorker + module PipelineArtifacts + class CoverageReportWorker include ApplicationWorker include PipelineBackgroundQueue + feature_category :code_testing + idempotent! def perform(pipeline_id) Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline| - Ci::Pipelines::CreateArtifactService.new.execute(pipeline) + Ci::PipelineArtifacts::CoverageReportService.new.execute(pipeline) 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 new file mode 100644 index 00000000000..0bb911bc6c8 --- /dev/null +++ b/app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Ci + module PipelineArtifacts + class ExpireArtifactsWorker + include ApplicationWorker + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext + + deduplicate :until_executed, including_scheduled: true + idempotent! + feature_category :continuous_integration + + def perform + service = ::Ci::PipelineArtifacts::DestroyExpiredArtifactsService.new + artifacts_count = service.execute + log_extra_metadata_on_done(:destroyed_pipeline_artifacts_count, artifacts_count) + end + end + end +end |