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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 21:09:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 21:09:21 +0300
commite0fa0638a422c3e20d4423c9bb69d79afc9c7d3d (patch)
tree9abb3c0706576bbda895fe9539a55556930606e2 /app/workers
parentf8d15ca65390475e356b06dedc51e10ccd179f86 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/all_queues.yml7
-rw-r--r--app/workers/pipeline_notification_worker.rb14
-rw-r--r--app/workers/pipeline_update_ci_ref_status_worker.rb17
3 files changed, 35 insertions, 3 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index e8682769720..0b7add65d94 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -668,6 +668,13 @@
:resource_boundary: :cpu
:weight: 3
:idempotent:
+- :name: pipeline_default:pipeline_update_ci_ref_status
+ :feature_category: :continuous_integration
+ :has_external_dependencies:
+ :latency_sensitive: true
+ :resource_boundary: :cpu
+ :weight: 3
+ :idempotent:
- :name: pipeline_hooks:build_hooks
:feature_category: :continuous_integration
:has_external_dependencies:
diff --git a/app/workers/pipeline_notification_worker.rb b/app/workers/pipeline_notification_worker.rb
index e9081cc416f..72663fa19ae 100644
--- a/app/workers/pipeline_notification_worker.rb
+++ b/app/workers/pipeline_notification_worker.rb
@@ -8,12 +8,20 @@ class PipelineNotificationWorker # rubocop:disable Scalability/IdempotentWorker
worker_resource_boundary :cpu
# rubocop: disable CodeReuse/ActiveRecord
- def perform(pipeline_id, recipients = nil)
- pipeline = Ci::Pipeline.find_by(id: pipeline_id)
+ def perform(pipeline_id, args = {})
+ case args
+ when Hash
+ ref_status = args[:ref_status]
+ recipients = args[:recipients]
+ else # TODO: backward compatible interface, can be removed in 12.10
+ recipients = args
+ ref_status = nil
+ end
+ pipeline = Ci::Pipeline.find_by(id: pipeline_id)
return unless pipeline
- NotificationService.new.pipeline_finished(pipeline, recipients)
+ NotificationService.new.pipeline_finished(pipeline, ref_status: ref_status, recipients: recipients)
end
# rubocop: enable CodeReuse/ActiveRecord
end
diff --git a/app/workers/pipeline_update_ci_ref_status_worker.rb b/app/workers/pipeline_update_ci_ref_status_worker.rb
new file mode 100644
index 00000000000..3d6a0d30e9c
--- /dev/null
+++ b/app/workers/pipeline_update_ci_ref_status_worker.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class PipelineUpdateCiRefStatusWorker # rubocop:disable Scalability/IdempotentWorker
+ include ApplicationWorker
+ include PipelineQueue
+
+ latency_sensitive_worker!
+ worker_resource_boundary :cpu
+
+ def perform(pipeline_id)
+ pipeline = Ci::Pipeline.find_by_id(pipeline_id)
+
+ return unless pipeline
+
+ Ci::UpdateCiRefStatusService.new(pipeline).call
+ end
+end