Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2738 - Adds the /git/tags API endpoint #7138

Merged
merged 27 commits into from
Jun 8, 2019

Conversation

richmahn
Copy link
Contributor

@richmahn richmahn commented Jun 5, 2019

Fixed #2738 (2nd part)

Read the issue above, especially the recent comment by the user (#2738 (comment)) on why I had to change a bit of stuff in how the tags API works.

Adds the {owner}/{repo}/git/tags API endpoint and properly identifies lightweight (commit) and annotated (tag) tags in the {owner}/{repo}/git/refs/tags API endpoint.

Fixes the API URLs that were not generating properly (no host name), e.g. "url:" of https://try.gitea.io/api/v1/repos/richmahn/test/tags

Fixes bug in /tags endpoint when there are multiple tags with the same commit ID (shows the same tag name over and over for each tag due to the caching, had to clone the cached struct)

@richmahn richmahn changed the title Fixes #2738 - Adds the git/tags API endpoint WIP: Fixes #2738 - Adds the git/tags API endpoint Jun 6, 2019
@richmahn richmahn changed the title WIP: Fixes #2738 - Adds the git/tags API endpoint WIP: Fixes #2738 - Adds the /git/tags API endpoint Jun 6, 2019
@richmahn richmahn changed the title WIP: Fixes #2738 - Adds the /git/tags API endpoint Fixes #2738 - Adds the /git/tags API endpoint Jun 6, 2019
@richmahn richmahn marked this pull request as ready for review June 6, 2019 03:57
@codecov-io
Copy link

codecov-io commented Jun 6, 2019

Codecov Report

Merging #7138 into master will increase coverage by 0.13%.
The diff coverage is 73.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7138      +/-   ##
==========================================
+ Coverage   41.62%   41.76%   +0.13%     
==========================================
  Files         448      448              
  Lines       60902    61061     +159     
==========================================
+ Hits        25352    25502     +150     
+ Misses      32262    32248      -14     
- Partials     3288     3311      +23
Impacted Files Coverage Δ
models/repo_tag.go 62.5% <ø> (ø) ⬆️
routers/api/v1/convert/convert.go 83.8% <100%> (+2.38%) ⬆️
modules/git/repo_ref.go 72.72% <100%> (+2.72%) ⬆️
routers/api/v1/repo/git_ref.go 91.11% <100%> (-0.1%) ⬇️
routers/api/v1/api.go 71.31% <100%> (+0.08%) ⬆️
modules/git/tag.go 73.91% <100%> (+63.04%) ⬆️
modules/git/repo_tag.go 59.47% <54.9%> (-3.9%) ⬇️
routers/api/v1/repo/tag.go 84.05% <82.05%> (-2.61%) ⬇️
modules/log/event.go 64.46% <0%> (-1.53%) ⬇️
modules/git/repo_commit.go 46.59% <0%> (-1.52%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23a2ee3...0aeec96. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 6, 2019
modules/git/repo_tag.go Outdated Show resolved Hide resolved
modules/git/repo_tag.go Outdated Show resolved Hide resolved
richmahn and others added 3 commits June 6, 2019 13:11
@lafriks lafriks added this to the 1.9.0 milestone Jun 7, 2019
@lafriks lafriks added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Jun 7, 2019
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 7, 2019
modules/git/repo_tag.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 8, 2019
@lafriks lafriks merged commit 8de0b0a into go-gitea:master Jun 8, 2019
jeffliu27 pushed a commit to jeffliu27/gitea that referenced this pull request Jul 18, 2019
* Fixes go-gitea#2738 - /git/tags API

* proper URLs

* Adds function comments

* Updates swagger

* Removes newline from tag message

* Removes trailing newline from commit message

* Adds integration test

* Removed debugging

* Adds tests

* Fixes bug where multiple tags of same commit show wrong tag name

* Fix formatting

* Removes unused varaible

* Fix to annotated tag function names and response

* Update modules/git/repo_tag.go

Co-Authored-By: Lauris BH <lauris@nix.lv>

* Uses TagPrefix

* Changes per review, better error handling for getting tag and commit IDs

* Fix to getting commit ID

* Fix to getting commit ID

* Fix to getting commit ID

* Fix to getting commit ID
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API support for listing tags and fetching tag details
5 participants