Create or mark task pending as soon the action happens
This commit is contained in:
parent
a57bf9bd39
commit
ce78813c2a
|
@ -181,6 +181,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
|
|||
return
|
||||
end
|
||||
|
||||
TaskService.new.merge_merge_request(merge_request, current_user)
|
||||
|
||||
@merge_request.update(merge_error: nil)
|
||||
|
||||
if params[:merge_when_build_succeeds].present? && @merge_request.ci_commit && @merge_request.ci_commit.active?
|
||||
|
|
|
@ -11,7 +11,6 @@ module MergeRequests
|
|||
create_merge_event(merge_request, current_user)
|
||||
create_note(merge_request)
|
||||
notification_service.merge_mr(merge_request, current_user)
|
||||
task_service.merge_merge_request(merge_request, current_user)
|
||||
execute_hooks(merge_request, 'merge')
|
||||
end
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ module Notes
|
|||
if note.save
|
||||
# Finish the harder work in the background
|
||||
NewNoteWorker.perform_in(2.seconds, note.id, params)
|
||||
TaskService.new.new_note(note, current_user)
|
||||
end
|
||||
|
||||
note
|
||||
|
|
|
@ -13,8 +13,6 @@ module Notes
|
|||
@note.create_cross_references!
|
||||
execute_note_hooks
|
||||
end
|
||||
|
||||
TaskService.new.new_note(note)
|
||||
end
|
||||
|
||||
def hook_data
|
||||
|
|
|
@ -20,7 +20,7 @@ describe Notes::PostProcessService, services: true do
|
|||
it do
|
||||
expect(project).to receive(:execute_hooks)
|
||||
expect(project).to receive(:execute_services)
|
||||
expect_any_instance_of(TaskService).to receive(:new_note).with(@note)
|
||||
|
||||
Notes::PostProcessService.new(@note).execute
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue