From fa7d99ebd4cd86134e33f9f79e2b92f50de3af6c Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Sat, 16 Apr 2016 10:23:36 +0200 Subject: [PATCH 1/2] API: Present an array of Gitlab::Git::Tag instead of array of rugged tags --- CHANGELOG | 1 + lib/api/tags.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d8fbfafb72..7fa1fce1f2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -73,6 +73,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 diff --git a/lib/api/tags.rb b/lib/api/tags.rb index d1a10479e4..3e1ed3fe5c 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 From 7fa3a1c05c9ab04d59c9000e69881cd1cbeeaf1d Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Mon, 18 Apr 2016 20:01:32 +0200 Subject: [PATCH 2/2] Ensure that annoation is presented properly --- spec/requests/api/tags_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/requests/api/tags_spec.rb b/spec/requests/api/tags_spec.rb index 9f9c3b1cf4..edcb2bedbf 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