-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
API support for listing tags and fetching tag details #2738
Comments
note that on github's api, it is undocumented, but as long as there is a way to get a list of tags, get a tag by name and get push notification of tags then I can implement jenkinsci/gitea-plugin#6 |
@lafriks any ETA? |
sorry, currently no one is on this at the moment but we are one step closer to this as all tag data are already in database so this should be easy enough to implement. |
This got serious: the new vgo experiment needs an API to parse versions (https://godoc.org/golang.org/x/vgo/vendor/cmd/go/internal/modfetch#Repo), so this will be required. Any directions? Which API endpoint should we start copying for this? |
@tgulacsi |
I'd like to help, just point me in the right direction. An API endpoint to
copy would be a good start.
Lunny Xiao <[email protected]> ezt írta (időpont: 2018. febr. 25.,
V, 14:45):
… @tgulacsi <https://github.com/tgulacsi> vgo will be released at least
about six month I think. Maybe we have enough time to resolve this issue if
someone would like to send a PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2738 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPoSpWNHY64xTab2yI95yxNAujX8mndks5tYWQHgaJpZM4P-fRm>
.
|
You can look at merged PR related to API : https://github.com/go-gitea/gitea/pulls?utf8=%E2%9C%93&q=is%3Apr+label%3Akind%2Fapi+is%3Aclosed+ |
For example a simple API added endpoint : #2047 |
PTAL on https://github.com/tgulacsi/gitea/tree/api-tags esp. https://github.com/tgulacsi/gitea/blob/api-tags/models/tag.go - it compiles, but that's all. I don't know how should I test it, or whether it is moderately acceptable at all. |
For design of path and response format we generally try to follow github format for compat. For testing try to write integrations tests like in #2047 and try to run them with https://github.com/go-gitea/gitea/tree/master/integrations#integrations-tests. When you start to have something working submit a PR so that we can review it. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
github.com/gomods/athens works as a GOPROXY and no need for the go mod
specific API.
Stephen Connolly <[email protected]> ezt írta (időpont: 2018. szept.
4., K, 22:55):
… Ping!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2738 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPoSvspSzxosW0ktJpIp0nn09u9iwgeks5uXujWgaJpZM4P-fRm>
.
|
@thulacsi I suspect you don’t understand what this ticket is looking for as your answer does not make any sense to me. What has GOPROXY got to do with an API exposed in the gitea webapp that allows listing the git tags in a git repo hosted on a gitea server? |
@stephenc so, but why close this one? |
@lunny sorry hit wrong button... thanks for pointing out |
@stephenc I started implementing with GitHub compatible Git Refs API routes and objects |
This comment has been minimized.
This comment has been minimized.
Tag list is now implemented using refs API, still missing getting tags details |
Getting tag details will be in 1.8.0, so I'm moving issue to that milestone |
@lafriks since there is no PR for this, let's move this to 1.9.0 |
Is someone working on this? |
I hope so because the fully polished Jenkins plugin is dependent on this |
Listing is done, I'm working on details |
@stephenc Is it wanting /api/v1/repos/${repoOwner}/${repoName}/tags/${tagName} or /api/v1/repos/${repoOwner}/${repoName}/git/tags/${tagName} ? GitHub has /repos/${repoOwner}/${repoName}/tags and then you have to change |
I'm now working on the details for tags. |
So right now we have this API to list the tags: The Namely it doesn't supply the details of the timestamp of the tag object or enable differentiation between annotated tags and lightweight tags. If I look at the GitHub API, https://developer.github.com/v3/git/tags/ provides the details we need. I think what you want is to implement a route equivalent to the github one, namely Once we have Now having said all that, if I wasn't interested in matching closely the github api, then I might separate the routes differently and have the tags route return the rich objects... but as I understand it, mirroring the GitHub API structure is valued by Gitea, so in that case |
@stephenc That's for your response! Actually just figured out myself, before reading your reply, that git/refs/tags does not distinguish between lightweight (commit) tags and annotated (tag) tags. So I have already change that in my work on this. |
@stephenc See my PR above. Should have everything you specified, with /git/tags/{sha} only working for annotated tags. |
* Fixes #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 <[email protected]> * 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
* 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 <[email protected]> * 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
Description
The API currently exposes details of branches and pull requests but does not allow discovering tags.
The minimum support that I would like to see:
/api/v1/repos/${repoOwner}/${repoName}/tags
/api/v1/repos/${repoOwner}/${repoName}/tags/${tagName}
The tag JSON object should probably have the following structure:
lightweight tags (i.e. where the tag refers to a commit):
annotated tags (i.e. where the tag is an object referencing the commit):
The text was updated successfully, but these errors were encountered: