diff options
author | Peter Leitzen <pl@neopoly.de> | 2018-07-21 14:57:52 +0200 |
---|---|---|
committer | Peter Leitzen <pl@neopoly.de> | 2018-08-10 16:45:11 +0200 |
commit | 7a4b288ec96e64bd9eaf1296d319a39401901df4 (patch) | |
tree | e8b488873903d3ec07a5dd0df0cdf006efcde088 /app/services/system_note_service.rb | |
parent | d6eaf38be4fa1785b6e47eeb76f4ca2cb20a144d (diff) | |
download | gitlab-ce-7a4b288ec96e64bd9eaf1296d319a39401901df4.tar.gz |
Create a system note after tagging a commit
Diffstat (limited to 'app/services/system_note_service.rb')
-rw-r--r-- | app/services/system_note_service.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index 77494295f14..452b80b1bfa 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -32,6 +32,20 @@ module SystemNoteService create_note(NoteSummary.new(noteable, project, author, body, action: 'commit', commit_count: total_count)) end + # Called when a commit was tagged + # + # noteable - Noteable object + # project - Project owning noteable + # author - User performing the tag + # tag_name - The created tag name + # + # Returns the created Note object + def tag_commit(noteable, project, author, tag_name) + body = "tagged commit #{noteable.sha} to `#{tag_name}`" + + create_note(NoteSummary.new(noteable, project, author, body, action: 'tag')) + end + # Called when the assignee of a Noteable is changed or removed # # noteable - Noteable object |