Skip to content

feat: resolve latest from channel-0.json and never above 0.x (TRUNK-23254, TRUNK-23770) - #157

Merged
acatxnamedvirtue merged 3 commits into
mainfrom
tylerbeebe/trunk-23254-keep-latest-on-0x
Nov 12, 2026
Merged

acatxnamedvirtue merged 3 commits into
mainfrom
tylerbeebe/trunk-23254-keep-latest-on-0x

Conversation

@acatxnamedvirtue

@acatxnamedvirtue acatxnamedvirtue commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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's channel.json names. So the moment 1.0.0 is promoted, every @v2 user would install it with no change on their side, and their uploads would break. @v2 has to stay on the 0.x line, and keep getting 0.x backports, before 1.0.0 is promoted.

What changes

latest now resolves in this order:

  1. 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 @v2 after 1.0.0, with no action release.
  2. channel.json, when channel-0.json isn't published yet or can't be read.
  3. GitHub's latest release.
  4. 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, including 1.0.0, is used as given. The cli-version docs in action.yaml and the README now say latest is the newest 0.x release.

The test fixtures answer channel-0.json with 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 from 1.2.3 to 0.18.3.

New tests cover:

  • channel-0.json naming 0.17.4 while channel.json names 1.0.0;
  • channel-0.json naming 1.0.0;
  • channel-0.json unpublished and channel.json naming 1.0.0;
  • GitHub's latest being 1.0.0;
  • an explicit cli-version: 1.0.0.

Testing

  • npm test: 88 passed.
  • tsc --noEmit, eslint, trunk check: clean.
  • dist/index.js rebuilt by the pre-commit hook.

Release order

  1. ci(release): publish a latest pointer per major version (TRUNK-23770) analytics-cli#1310 merges, and Promote Release is re-run for 0.17.0, which seeds channel-0.json. This PR is safe without that step, since it falls back to the clamped channel.json.
  2. Merge this PR, publish v2.1.8, and run Update release version with target: 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.
  3. Only then promote analytics-cli 1.0.0.

The order is also recorded in trunk2's TRD-0031 Rollout, steps 8–11 (trunk-io/trunk2#8333).

🤖 Generated with Claude Code

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>
@acatxnamedvirtue acatxnamedvirtue changed the title fix: never resolve latest to analytics-cli 1.0.0 or later (TRUNK-23254) feat: resolve latest from channel-0.json and never above 0.x (TRUNK-23254, TRUNK-23770) Nov 11, 2026
@acatxnamedvirtue
acatxnamedvirtue merged commit 9886de7 into main Nov 12, 2026
8 checks passed
@acatxnamedvirtue
acatxnamedvirtue deleted the tylerbeebe/trunk-23254-keep-latest-on-0x branch November 12, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants