diff options
Diffstat (limited to 'app/workers/ci')
-rw-r--r-- | app/workers/ci/merge_requests/add_todo_when_build_fails_worker.rb | 21 |
1 files changed, 21 insertions, 0 deletions
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 |