mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-15 20:09:18 -05:00
API support for listing tags and fetching tag details #1164
Closed
opened 2025-11-02 03:50:53 -06:00 by GiteaMirror
·
30 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
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c1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#1164
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stephenc on GitHub (Oct 18, 2017).
Originally assigned to: @lafriks on GitHub.
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):
@bkcsoft commented on GitHub (Nov 1, 2017):
https://developer.github.com/v3/git/tags/
@stephenc commented on GitHub (Nov 1, 2017):
note that on github's api, it is undocumented, but
GET /repos/:owner/:repo/git/tagswill return a paged list of tags.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 https://github.com/jenkinsci/gitea-plugin/pull/6
@stephenc commented on GitHub (Dec 18, 2017):
@lafriks any ETA?
@lafriks commented on GitHub (Dec 18, 2017):
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.
@tgulacsi commented on GitHub (Feb 25, 2018):
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?
@lunny commented on GitHub (Feb 25, 2018):
@tgulacsi
vgowill 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.@tgulacsi commented on GitHub (Feb 25, 2018):
I'd like to help, just point me in the right direction. An API endpoint to
copy would be a good start.
Lunny Xiao notifications@github.com ezt írta (időpont: 2018. febr. 25.,
V, 14:45):
@sapk commented on GitHub (Feb 25, 2018):
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+
@sapk commented on GitHub (Feb 25, 2018):
For example a simple API added endpoint : https://github.com/go-gitea/gitea/pull/2047
You may need to update the sdk (https://github.com/go-gitea/go-sdk) before like in #1668 with https://github.com/go-gitea/go-sdk/pull/56
@tgulacsi commented on GitHub (Feb 25, 2018):
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.
What about the paths? (/repos/:id/tags)
Now it is only to list tags, as Release already embodies a tag, so it is not clear how these two should live together...
@sapk commented on GitHub (Feb 25, 2018):
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.
@stephenc commented on GitHub (Jul 10, 2018):
ping!
@stephenc commented on GitHub (Sep 4, 2018):
Ping!
@tgulacsi commented on GitHub (Sep 5, 2018):
github.com/gomods/athens works as a GOPROXY and no need for the go mod
specific API.
Stephen Connolly notifications@github.com ezt írta (időpont: 2018. szept.
4., K, 22:55):
@stephenc commented on GitHub (Sep 5, 2018):
@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?
@lunny commented on GitHub (Sep 11, 2018):
@stephenc so, but why close this one?
@stephenc commented on GitHub (Sep 11, 2018):
@lunny sorry hit wrong button... thanks for pointing out
@lafriks commented on GitHub (Nov 18, 2018):
@stephenc I started implementing with GitHub compatible Git Refs API routes and objects
@stephenc commented on GitHub (Nov 18, 2018):
@lafriks commented on GitHub (Nov 27, 2018):
Tag list is now implemented using refs API, still missing getting tags details
@lafriks commented on GitHub (Dec 27, 2018):
Getting tag details will be in 1.8.0, so I'm moving issue to that milestone
@lunny commented on GitHub (Feb 28, 2019):
@lafriks since there is no PR for this, let's move this to 1.9.0
@conradoqg commented on GitHub (Apr 26, 2019):
Is someone working on this?
@stephenc commented on GitHub (Apr 26, 2019):
I hope so because the fully polished Jenkins plugin is dependent on this
@lafriks commented on GitHub (Apr 26, 2019):
Listing is done, I'm working on details
@richmahn commented on GitHub (May 31, 2019):
@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
/tagsto/git/tags/{$tagSHA}. There is also/git/refsand/git/refs/tags/<$tagSHA>so wondering what exactly Jenkins is looking for.@richmahn commented on GitHub (May 31, 2019):
I'm now working on the details for tags.
@stephenc commented on GitHub (May 31, 2019):
So right now we have this API to list the tags:
The
/repos/{owner}/{repo}/git/refs/{ref}path doesn't return an object with the details we requireNamely 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
/repos/{owner}/{repo}/git/tags/{tag}. This route would only support annotated tag objects, so if it returns a failure then we can conclude that the object is a lightweight tag!Once we have
/repos/{owner}/{repo}/git/tags/{tag}then we are good.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
/repos/{owner}/{repo}/git/tags/{tag}is all that remains@richmahn commented on GitHub (Jun 5, 2019):
@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.
@richmahn commented on GitHub (Jun 6, 2019):
@stephenc See my PR above. Should have everything you specified, with /git/tags/{sha} only working for annotated tags.