summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-04-19 12:31:31 +0000
committerRémy Coutable <remy@rymai.me>2016-04-19 12:31:31 +0000
commitbfa16dbcfba2a3233209f6403a0074d42e664df6 (patch)
tree9d9724af20b64745d51f22a861296247ac32cdf0
parentfd13cd189fd360a637a61f852aed523705ff4689 (diff)
parent7fa3a1c05c9ab04d59c9000e69881cd1cbeeaf1d (diff)
downloadgitlab-ce-bfa16dbcfba2a3233209f6403a0074d42e664df6.tar.gz
Merge branch 'api-fix-annotated-tags' into 'master'
API: Present an array of Gitlab::Git::Tag instead of array of rugged tags The annotated message was always `null` because the wrong array was presented. The entity requires an array of `Gitlab::Git::Tags` instead an array of raw rugged tags was presented. Since a rugged tag does not respond to `message` to get the annotated message, this was always `null`. See merge request !3764
-rw-r--r--CHANGELOG1
-rw-r--r--lib/api/tags.rb2
-rw-r--r--spec/requests/api/tags_spec.rb2
3 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 5d941641aaf..c6fe19d5689 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -83,6 +83,7 @@ v 8.7.0 (unreleased)
- Diffs load at the correct point when linking from from number
- Selected diff rows highlight
- Fix emoji categories in the emoji picker
+ - API: Properly display annotated tags for GET /projects/:id/repository/tags (Robert Schilling)
- Add encrypted credentials for imported projects and migrate old ones
- Author and participants are displayed first on users autocompletion
- Show number sign on external issue reference text (Florent Baldino)
diff --git a/lib/api/tags.rb b/lib/api/tags.rb
index d1a10479e44..3e1ed3fe5c7 100644
--- a/lib/api/tags.rb
+++ b/lib/api/tags.rb
@@ -12,7 +12,7 @@ module API
# Example Request:
# GET /projects/:id/repository/tags
get ":id/repository/tags" do
- present user_project.repo.tags.sort_by(&:name).reverse,
+ present user_project.repository.tags.sort_by(&:name).reverse,
with: Entities::RepoTag, project: user_project
end
diff --git a/spec/requests/api/tags_spec.rb b/spec/requests/api/tags_spec.rb
index 9f9c3b1cf4c..edcb2bedbf7 100644
--- a/spec/requests/api/tags_spec.rb
+++ b/spec/requests/api/tags_spec.rb
@@ -32,9 +32,11 @@ describe API::API, api: true do
it "should return an array of project tags with release info" do
get api("/projects/#{project.id}/repository/tags", user)
+
expect(response.status).to eq(200)
expect(json_response).to be_an Array
expect(json_response.first['name']).to eq(tag_name)
+ expect(json_response.first['message']).to eq('Version 1.1.0')
expect(json_response.first['release']['description']).to eq(description)
end
end