summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Leitzen <pl@neopoly.de>2018-07-23 22:16:00 +0200
committerPeter Leitzen <pl@neopoly.de>2018-08-10 16:45:11 +0200
commit394107f5f6a5bc5d5df80ce1120ff3d3b8b5693e (patch)
treee2f6c7fa0aaeb57c9931aef01ed536c249730f19
parent7405a7ae5fd9155ef90cc62988214135503eb99b (diff)
downloadgitlab-ce-394107f5f6a5bc5d5df80ce1120ff3d3b8b5693e.tar.gz
Link to the tag in system note
-rw-r--r--app/services/system_note_service.rb3
-rw-r--r--spec/services/system_note_service_spec.rb6
2 files changed, 6 insertions, 3 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index 452b80b1bfa..dda89830179 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -41,7 +41,8 @@ module SystemNoteService
#
# Returns the created Note object
def tag_commit(noteable, project, author, tag_name)
- body = "tagged commit #{noteable.sha} to `#{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
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb
index cbe5668cf08..442de61f69b 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -112,7 +112,7 @@ describe SystemNoteService do
let(:noteable) do
project.commit
end
- let(:tag_name) { '1.2.3' }
+ let(:tag_name) { 'v1.2.3' }
subject { described_class.tag_commit(noteable, project, author, tag_name) }
@@ -121,7 +121,9 @@ describe SystemNoteService do
end
it 'sets the note text' do
- expect(subject.note).to eq "tagged commit #{noteable.sha} to `#{tag_name}`"
+ link = "http://localhost/#{project.full_path}/tags/#{tag_name}"
+
+ expect(subject.note).to eq "tagged commit #{noteable.sha} to [`#{tag_name}`](#{link})"
end
end