summaryrefslogtreecommitdiff
path: root/app/services/auto_merge
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-06-06 14:25:06 +0700
committerShinya Maeda <shinya@gitlab.com>2019-06-12 13:20:49 +0700
commitb8c131715296dbd864bb7417ef04fc2ad7e18a53 (patch)
treec6d9ae7c27b30db1e20c04b5ca925401171ac0d1 /app/services/auto_merge
parent9baff6f6b58981ac1565d371b01948a286f7bffd (diff)
downloadgitlab-ce-b8c131715296dbd864bb7417ef04fc2ad7e18a53.tar.gz
Update merge options for auto merge strategies
Currently, merge options is updated on #execute method, however, we should have #update interface to make it explicit.
Diffstat (limited to 'app/services/auto_merge')
-rw-r--r--app/services/auto_merge/base_service.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/services/auto_merge/base_service.rb b/app/services/auto_merge/base_service.rb
index 7f0a41b3dfa..d726085b89a 100644
--- a/app/services/auto_merge/base_service.rb
+++ b/app/services/auto_merge/base_service.rb
@@ -20,6 +20,14 @@ module AutoMerge
strategy.to_sym
end
+ def update(merge_request)
+ merge_request.merge_params.merge!(params)
+
+ return :failed unless merge_request.save
+
+ strategy.to_sym
+ end
+
def cancel(merge_request)
if cancel_auto_merge(merge_request)
yield if block_given?