2018-06-27 03:23:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 13:09:10 -05:00
|
|
|
class MergeWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2015-08-11 08:33:31 -04:00
|
|
|
|
2019-10-18 07:11:44 -04:00
|
|
|
feature_category :source_code_management
|
2020-03-02 13:07:42 -05:00
|
|
|
urgency :high
|
2020-01-24 13:09:00 -05:00
|
|
|
weight 5
|
2020-06-12 08:08:56 -04:00
|
|
|
loggable_arguments 2
|
2019-10-18 07:11:44 -04:00
|
|
|
|
2015-08-11 08:33:31 -04:00
|
|
|
def perform(merge_request_id, current_user_id, params)
|
|
|
|
params = params.with_indifferent_access
|
|
|
|
current_user = User.find(current_user_id)
|
|
|
|
merge_request = MergeRequest.find(merge_request_id)
|
|
|
|
|
2017-06-21 09:48:12 -04:00
|
|
|
MergeRequests::MergeService.new(merge_request.target_project, current_user, params)
|
|
|
|
.execute(merge_request)
|
2015-08-11 08:33:31 -04:00
|
|
|
end
|
|
|
|
end
|