2014-04-02 14:51:17 -04:00
|
|
|
module MergeRequests
|
|
|
|
class ReopenService < MergeRequests::BaseService
|
|
|
|
def execute(merge_request)
|
2016-08-09 11:51:40 -04:00
|
|
|
return merge_request unless can?(current_user, :update_merge_request, merge_request)
|
|
|
|
|
2014-04-02 14:51:17 -04:00
|
|
|
if merge_request.reopen
|
|
|
|
event_service.reopen_mr(merge_request, current_user)
|
|
|
|
create_note(merge_request)
|
2015-01-26 01:49:05 -05:00
|
|
|
notification_service.reopen_mr(merge_request, current_user)
|
2015-01-17 19:34:34 -05:00
|
|
|
execute_hooks(merge_request, 'reopen')
|
2017-05-21 16:38:33 -04:00
|
|
|
merge_request.reload_diff(current_user)
|
2014-04-02 14:51:17 -04:00
|
|
|
merge_request.mark_as_unchecked
|
2017-05-26 09:29:42 -04:00
|
|
|
invalidate_cache_counts(merge_request.assignees, merge_request)
|
2014-04-02 14:51:17 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
merge_request
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|