Class: MergeRequests::PostMergeService

Inherits:
BaseService show all
Defined in:
app/services/merge_requests/post_merge_service.rb

Overview

PostMergeService class

Mark existing merge request as merged and execute all hooks and notifications

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#create_note, #create_title_change_note, #execute_hooks, #hook_data

Methods inherited from BaseService

#abilities, #can?, #deny_visibility_level, #event_service, #initialize, #log_info, #notification_service, #repository, #system_hook_service, #todo_service

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Constructor Details

This class inherits a constructor from BaseService

Instance Method Details

#execute(merge_request) ⇒ Object


8
9
10
11
12
13
14
15
# File 'app/services/merge_requests/post_merge_service.rb', line 8

def execute(merge_request)
  close_issues(merge_request)
  merge_request.mark_as_merged
  create_merge_event(merge_request, current_user)
  create_note(merge_request)
  notification_service.merge_mr(merge_request, current_user)
  execute_hooks(merge_request, 'merge')
end