diff options
Diffstat (limited to 'app/workers/build_finished_worker.rb')
-rw-r--r-- | app/workers/build_finished_worker.rb | 58 |
1 files changed, 3 insertions, 55 deletions
diff --git a/app/workers/build_finished_worker.rb b/app/workers/build_finished_worker.rb index a3eaacec8a2..0d41f7b9438 100644 --- a/app/workers/build_finished_worker.rb +++ b/app/workers/build_finished_worker.rb @@ -1,61 +1,9 @@ # frozen_string_literal: true -class BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker - include ApplicationWorker +class BuildFinishedWorker < ::Ci::BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker + # DEPRECATED: Not triggered since https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64934/ - sidekiq_options retry: 3 - include PipelineQueue - - queue_namespace :pipeline_processing + # We need to explicitly specify these settings. They aren't inheriting from the parent class. urgency :high worker_resource_boundary :cpu - - ARCHIVE_TRACES_IN = 2.minutes.freeze - - # rubocop: disable CodeReuse/ActiveRecord - def perform(build_id) - Ci::Build.find_by(id: build_id).try do |build| - process_build(build) - end - end - # rubocop: enable CodeReuse/ActiveRecord - - private - - # Processes a single CI build that has finished. - # - # This logic resides in a separate method so that EE can extend it more - # easily. - # - # @param [Ci::Build] build The build to process. - def process_build(build) - # We execute these in sync to reduce IO. - build.parse_trace_sections! - build.update_coverage - Ci::BuildReportResultService.new.execute(build) - - # We execute these async as these are independent operations. - BuildHooksWorker.perform_async(build.id) - ChatNotificationWorker.perform_async(build.id) if build.pipeline.chat? - - if build.failed? - ::Ci::MergeRequests::AddTodoWhenBuildFailsWorker.perform_async(build.id) - end - - ## - # We want to delay sending a build trace to object storage operation to - # validate that this fixes a race condition between this and flushing live - # trace chunks and chunks being removed after consolidation and putting - # them into object storage archive. - # - # TODO This is temporary fix we should improve later, after we validate - # that this is indeed the culprit. - # - # See https://gitlab.com/gitlab-org/gitlab/-/issues/267112 for more - # details. - # - ArchiveTraceWorker.perform_in(ARCHIVE_TRACES_IN, build.id) - end end - -BuildFinishedWorker.prepend_mod_with('BuildFinishedWorker') |