2020-04-08 14:13:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module MergeRequests
|
|
|
|
class AfterCreateService < MergeRequests::BaseService
|
|
|
|
def execute(merge_request)
|
|
|
|
event_service.open_mr(merge_request, current_user)
|
|
|
|
notification_service.new_merge_request(merge_request, current_user)
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
create_pipeline_for(merge_request, current_user)
|
|
|
|
merge_request.update_head_pipeline
|
2020-04-08 14:13:33 +05:30
|
|
|
|
|
|
|
merge_request.diffs(include_stats: false).write_cache
|
|
|
|
merge_request.create_cross_references!(current_user)
|
2021-02-22 17:27:13 +05:30
|
|
|
|
|
|
|
NamespaceOnboardingAction.create_action(merge_request.target_project.namespace, :merge_request_created)
|
2020-04-08 14:13:33 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-10-24 23:57:45 +05:30
|
|
|
|
|
|
|
MergeRequests::AfterCreateService.prepend_if_ee('EE::MergeRequests::AfterCreateService')
|