Open
Description
When listing tags, we call the GitHub API to fetch the list of git refs, and then iterate over them to get the git tag information (message, creation date, revision it points to) for each one. Each requires an addition GitHub API call. Essentially, this is a classic N+1 problem.
This will become very slow quite fast once we have more than a handful of tags for a dataset.
Directions to solve:
- Maybe there is an API endpoint I am missing that could be used for this instead of what I have used. I didn't find any but perhaps there is a way.
- Lazy-load some of the information not on initial fetch but on subsequent data access. This can speed up some use cases but will not help with others.
- ???
Note that this doesn't even include an additional API call that might be needed for some use cases, to fetch the data package itself beyond the revision the tag points to.
Github API
There are 3 ways to get tags ...
- https://developer.github.com/v3/repos/#list-tags - these list the commits but not tag info (other than name)
- https://developer.github.com/v3/git/refs/ - Git Data API "References"
- GraphQL: https://developer.github.com/v4/object/tag/ (although how do we query)
Git Data API "References"
GET /repos/:owner/:repo/git/matching-refs/tags
- For each result you look up the tag object ...
GET /repos/:owner/:repo/git/tags/:tag_sha
https://developer.github.com/v3/repos/#list-tags
[
{
"name": "v0.1",
"commit": {
"sha": "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc",
"url": "https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc"
},
"zipball_url": "https://github.com/octocat/Hello-World/zipball/v0.1",
"tarball_url": "https://github.com/octocat/Hello-World/tarball/v0.1"
}
]
Metadata
Metadata
Assignees
Labels
No labels