Repository navigation
feat: resolve latest from channel-0.json and never above 0.x (TRUNK-23254, TRUNK-23770) - #157
Merged
Merged
Conversation
analytics-cli 1.0.0 removes flags this major version passes and requires a v2 API key, so `@v2` must not pick it up when 1.0.0 becomes trunk.io's latest. `latest` still follows trunk.io's channel (or GitHub's latest release), so 0.x backports keep flowing, but a resolved 1.x or later is replaced by DEFAULT_CLI_VERSION, the last release before 1.0.0. An explicit cli-version is still used as given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…NK-23770) analytics-cli's Promote now publishes a latest pointer per major version. `latest` reads channel-0.json first, so @v2 keeps getting 0.x backports after 1.0.0 is promoted with no change to this action. Until channel-0.json is published, or when it cannot be read, `latest` falls back to channel.json and then GitHub, both clamped below 1.0.0 as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It stops being the last 0.x release at the first 0.17.x backport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TylerJang27
approved these changes
Nov 12, 2026
acatxnamedvirtue
deleted the
tylerbeebe/trunk-23254-keep-latest-on-0x
branch
November 12, 2026 16:29
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.
Part of TRUNK-23254 and TRUNK-23770
Why
analytics-cli 1.0.0 removes flags this action passes and requires a v2 API key. Today
cli-version: latest, the default, resolves to whatever trunk.io'schannel.jsonnames. So the moment 1.0.0 is promoted, every@v2user would install it with no change on their side, and their uploads would break.@v2has to stay on the 0.x line, and keep getting 0.x backports, before 1.0.0 is promoted.What changes
latestnow resolves in this order:channel-0.json, the newest 0.x release. analytics-cli's Promote workflow publishes one pointer per major version (ci(release): publish a latest pointer per major version (TRUNK-23770) analytics-cli#1310, TRUNK-23770). This is how 0.17.x backports reach@v2after 1.0.0, with no action release.channel.json, whenchannel-0.jsonisn't published yet or can't be read.DEFAULT_CLI_VERSION, a pinned 0.x release (0.17.0), when nothing resolves.Any version that resolves to 1.0.0 or later is replaced by
DEFAULT_CLI_VERSION, with a log line. In the GitHub case the action then downloads that pinned tag, not/latest/download/.An explicit
cli-version, including1.0.0, is used as given. Thecli-versiondocs inaction.yamland the README now saylatestis the newest 0.x release.The test fixtures answer
channel-0.jsonwith trunk.io's 403 for a missing object, unless a test publishes one. So the existing tests exercise the fallback, and the sample "latest" version moved from1.2.3to0.18.3.New tests cover:
channel-0.jsonnaming 0.17.4 whilechannel.jsonnames 1.0.0;channel-0.jsonnaming 1.0.0;channel-0.jsonunpublished andchannel.jsonnaming 1.0.0;cli-version: 1.0.0.Testing
npm test: 88 passed.tsc --noEmit, eslint,trunk check: clean.dist/index.jsrebuilt by the pre-commit hook.Release order
channel-0.json. This PR is safe without that step, since it falls back to the clampedchannel.json.v2.1.8, and run Update release version withtarget: v2.1.8,major_version: v2. That also ships fix: fall back to analytics-cli 0.17.0 when latest can't be resolved #156.The order is also recorded in trunk2's TRD-0031 Rollout, steps 8–11 (trunk-io/trunk2#8333).
🤖 Generated with Claude Code