Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-06-26 15:24:09 +0300
committerShinya Maeda <shinya@gitlab.com>2019-07-05 09:19:30 +0300
commit587ffd11480db3ed492459ec2b6fac32a459ebaa (patch)
treef695dba44247ea39cf3cbd53b33943880cbb6659 /app/services/system_note_service.rb
parent9414a41f8390511005702ab4fec99239b6c3c6dd (diff)
Split AutoMergeService interfaces into two `cancel` and `abort`
Create explicit endpoint - abort.
Diffstat (limited to 'app/services/system_note_service.rb')
-rw-r--r--app/services/system_note_service.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index 4783417ad6d..005050ad08b 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -234,6 +234,16 @@ module SystemNoteService
create_note(NoteSummary.new(noteable, project, author, body, action: 'merge'))
end
+ # Called when 'merge when pipeline succeeds' is aborted
+ def abort_merge_when_pipeline_succeeds(noteable, project, author, reason)
+ body = "aborted the automatic merge because #{reason}"
+
+ ##
+ # TODO: Abort message should be sent by the system, not a particular user.
+ # See https://gitlab.com/gitlab-org/gitlab-ce/issues/63187.
+ create_note(NoteSummary.new(noteable, project, author, body, action: 'merge'))
+ end
+
def handle_merge_request_wip(noteable, project, author)
prefix = noteable.work_in_progress? ? "marked" : "unmarked"