diff options
Diffstat (limited to 'app/workers/ci')
8 files changed, 40 insertions, 9 deletions
diff --git a/app/workers/ci/delete_objects_worker.rb b/app/workers/ci/delete_objects_worker.rb index d31d248597b..cbcad3e8838 100644 --- a/app/workers/ci/delete_objects_worker.rb +++ b/app/workers/ci/delete_objects_worker.rb @@ -10,7 +10,6 @@ module Ci include LimitedCapacity::Worker feature_category :continuous_integration - tags :exclude_from_kubernetes idempotent! def perform_work(*args) diff --git a/app/workers/ci/drop_pipeline_worker.rb b/app/workers/ci/drop_pipeline_worker.rb index f3672dba3fe..edb97c3cac5 100644 --- a/app/workers/ci/drop_pipeline_worker.rb +++ b/app/workers/ci/drop_pipeline_worker.rb @@ -9,8 +9,6 @@ module Ci sidekiq_options retry: 3 include PipelineQueue - tags :exclude_from_kubernetes - idempotent! def perform(pipeline_id, failure_reason) diff --git a/app/workers/ci/external_pull_requests/create_pipeline_worker.rb b/app/workers/ci/external_pull_requests/create_pipeline_worker.rb new file mode 100644 index 00000000000..211ea1f2990 --- /dev/null +++ b/app/workers/ci/external_pull_requests/create_pipeline_worker.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Ci + module ExternalPullRequests + class CreatePipelineWorker # rubocop:disable Scalability/IdempotentWorker + include ApplicationWorker + + data_consistency :always + queue_namespace :pipeline_creation + feature_category :pipeline_authoring + urgency :high + worker_resource_boundary :cpu + + def perform(project_id, user_id, external_pull_request_id) + user = User.find_by_id(user_id) + return unless user + + project = Project.find_by_id(project_id) + return unless project + + external_pull_request = project.external_pull_requests.find_by_id(external_pull_request_id) + return unless external_pull_request + + ::Ci::CreatePipelineService + .new(project, user, execute_params(external_pull_request)) + .execute(:external_pull_request_event, external_pull_request: external_pull_request) + end + + private + + def execute_params(pull_request) + { + ref: pull_request.source_ref, + source_sha: pull_request.source_sha, + target_sha: pull_request.target_sha + } + 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 index af042dc1e64..98bb259db0a 100644 --- 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 @@ -10,7 +10,6 @@ module Ci include PipelineQueue urgency :low - tags :exclude_from_kubernetes idempotent! def perform(job_id) diff --git a/app/workers/ci/pipeline_artifacts/create_quality_report_worker.rb b/app/workers/ci/pipeline_artifacts/create_quality_report_worker.rb index 06bc100c66a..bb0a81a0a17 100644 --- a/app/workers/ci/pipeline_artifacts/create_quality_report_worker.rb +++ b/app/workers/ci/pipeline_artifacts/create_quality_report_worker.rb @@ -11,7 +11,6 @@ module Ci queue_namespace :pipeline_background feature_category :code_testing - tags :exclude_from_kubernetes idempotent! diff --git a/app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb b/app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb index e4dc293353b..2af07cf6f93 100644 --- a/app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb +++ b/app/workers/ci/pipeline_artifacts/expire_artifacts_worker.rb @@ -15,7 +15,6 @@ module Ci deduplicate :until_executed, including_scheduled: true idempotent! feature_category :continuous_integration - tags :exclude_from_kubernetes def perform service = ::Ci::PipelineArtifacts::DestroyAllExpiredService.new diff --git a/app/workers/ci/schedule_delete_objects_cron_worker.rb b/app/workers/ci/schedule_delete_objects_cron_worker.rb index 06bf83ae0a7..55b23bbab62 100644 --- a/app/workers/ci/schedule_delete_objects_cron_worker.rb +++ b/app/workers/ci/schedule_delete_objects_cron_worker.rb @@ -12,7 +12,6 @@ module Ci # rubocop:enable Scalability/CronWorkerContext feature_category :continuous_integration - tags :exclude_from_kubernetes idempotent! def perform(*args) diff --git a/app/workers/ci/test_failure_history_worker.rb b/app/workers/ci/test_failure_history_worker.rb index b67797edf0b..e79ca50c8ce 100644 --- a/app/workers/ci/test_failure_history_worker.rb +++ b/app/workers/ci/test_failure_history_worker.rb @@ -9,8 +9,6 @@ module Ci sidekiq_options retry: 3 include PipelineBackgroundQueue - tags :exclude_from_kubernetes - idempotent! def perform(pipeline_id) |