summaryrefslogtreecommitdiff
path: root/app/services/system_note_service.rb
diff options
context:
space:
mode:
authorMarcia Ramos <virtua.creative@gmail.com>2018-08-16 10:17:22 +0100
committerMarcia Ramos <virtua.creative@gmail.com>2018-08-16 10:17:22 +0100
commitbfc0c602072bd5b9bf73e117d0808043adc9465e (patch)
treeea55f6e86fdfdcccca9c593d5441c9d2c3efd441 /app/services/system_note_service.rb
parent1e23577417b3e4eb06b9aba1ec174dbe78b6b9be (diff)
parent0a666b2cb1020df4b8f7b71041b6bd109b49656a (diff)
downloadgitlab-ce-docs-processes.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into docs-processesdocs-processes
Diffstat (limited to 'app/services/system_note_service.rb')
-rw-r--r--app/services/system_note_service.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index 77494295f14..dda89830179 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -32,6 +32,21 @@ 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)
+ link = url_helpers.project_tag_url(project, id: tag_name)
+ body = "tagged commit #{noteable.sha} to [`#{tag_name}`](#{link})"
+
+ 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