Welcome to mirror list, hosted at ThFree Co, Russian Federation.

add_todo_when_build_fails_worker.rb « merge_requests « ci « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8bcbe9d6c9f3635d4bb9f505102a2063d19f1f55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

module Ci
  module MergeRequests
    class AddTodoWhenBuildFailsWorker
      include ApplicationWorker

      data_consistency :always

      sidekiq_options retry: 3
      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(project: job.project).execute(job)
      end
    end
  end
end