diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-02 00:09:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-02 00:09:22 +0300 |
commit | 1e0d9b713469904253f2452d8d34922d316a766a (patch) | |
tree | 11f46c168733068698e025bf440fc37afecb4bfc /app/workers/ci/merge_requests/add_todo_when_build_fails_worker.rb | |
parent | 1769b59b9fd05325e3016b1a53a82ae6cf56adb5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/ci/merge_requests/add_todo_when_build_fails_worker.rb')
-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 |