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:
authorShinya Maeda <shinya@gitlab.com>2019-05-27 15:21:36 +0300
committerShinya Maeda <shinya@gitlab.com>2019-06-04 06:51:32 +0300
commit197a3d053359e66535c41935eac065ee424cbb07 (patch)
tree65b2010d5446fe8c41a378c0f9c7f359ae1eab69 /app/models
parent9a9c947b145e6a43ae49687aa398d1154d07a25b (diff)
Introduce sidekiq worker for auto merge process
As we have a central domain for auto merge process today, we should use a single worker for any auto merge process.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/pipeline.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 80401ca0a1e..3727a9861aa 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -166,6 +166,16 @@ module Ci
end
end
+ after_transition any => ::Ci::Pipeline.completed_statuses do |pipeline|
+ pipeline.run_after_commit do
+ pipeline.all_merge_requests.each do |merge_request|
+ next unless merge_request.auto_merge_enabled?
+
+ AutoMergeProcessWorker.perform_async(merge_request.id)
+ end
+ end
+ end
+
after_transition any => [:success, :failed] do |pipeline|
pipeline.run_after_commit do
PipelineNotificationWorker.perform_async(pipeline.id)