fix(release): list tags via git ls-remote to remove the 1000-tag cliff#509
Merged
Conversation
list_tags() called 'gh api --paginate /git/refs/tags', but that endpoint
emits no Link header, so --paginate is a no-op and the response is
silently capped at 1000 refs. Past 1000 tags it would return a truncated
set and compute the wrong 'latest' version.
Read tags via 'git ls-remote --tags' instead: one git-protocol round
trip, no pagination, no ref-count cap, and zero REST rate-limit exposure.
Peeled '^{}' refs from annotated tags are filtered to avoid duplicates.
Adds unit tests (no test coverage existed for this script before).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
🤖 Generated with Nori
Found while auditing the sibling release scripts after the same class of bug was fixed in nori-skillsets (tilework-tech/nori-skillsets#522).
list_tags()calledgh api --paginate /repos/{repo}/git/refs/tags. That endpoint emits noLinkheader, so--paginateis a no-op and the response is silently capped at 1000 refs. There's no hang (unlike the skillsets bug, which hand-rolled the pagination loop), but past 1000 tags it would return a truncated set and compute the wrong "latest" version. At 210 tags today there's headroom, but as the most frequently released product it'll get there first.list_tags()togit ls-remote --tags origin: one git-protocol round trip, no pagination, no ref-count cap, zero REST rate-limit exposure.^{}refs that annotated tags emit so versions aren't double-counted.Test Plan
python3 -m unittest scripts.test_create_nori_release— 2 tests pass (remote-tag parsing + peeled-ref dedup; raises on failed query)./scripts/create_nori_release --get-latest-stable→0.23.0./scripts/create_nori_release --publish-release --dry-run→0.24.0./scripts/create_nori_release --get-next-version→0.23.0-next.4ruff checkclean (also fixed 2 pre-existing f-string lint nits)Share Nori with your team: https://www.npmjs.com/package/nori-skillsets