diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2018-10-19 10:16:58 +0300 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2018-11-14 17:16:19 +0300 |
commit | 6b0ea951cac3905437abb2bbacaf422371f097e0 (patch) | |
tree | 55b61f7c3a5a4447fb70733780fca614ac1a73ef /app/services/system_note_service.rb | |
parent | f5e3ce5ed612c9b247e362ed7c667557331e5bfd (diff) |
Creates /create_merge_request quickaction
With this quick action the user can create a new MR starting from
the current issue using as `source_branch` the given `branch name` and
as `target_branch` the project default branch. If the `branch name` is
omitted a name is automatically created starting from the issue title.
Diffstat (limited to 'app/services/system_note_service.rb')
-rw-r--r-- | app/services/system_note_service.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index 729bc991294..ec6c306227b 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -407,11 +407,17 @@ module SystemNoteService def new_issue_branch(issue, project, author, branch) link = url_helpers.project_compare_url(project, from: project.default_branch, to: branch) - body = "created branch [`#{branch}`](#{link})" + body = "created branch [`#{branch}`](#{link}) to address this issue" create_note(NoteSummary.new(issue, project, author, body, action: 'branch')) end + def new_merge_request(issue, project, author, merge_request) + body = "created merge request #{merge_request.to_reference} to address this issue" + + create_note(NoteSummary.new(issue, project, author, body, action: 'merge')) + end + # Called when a Mentionable references a Noteable # # noteable - Noteable object being referenced |