Skip to content

ci(release): publish a latest pointer per major version (TRUNK-23770) - #1310

Merged
trunk-io[bot] merged 1 commit into
mainfrom
tylerbeebe/trunk-23770-latest-per-major
Nov 11, 2026
Merged

trunk-io[bot] merged 1 commit into
mainfrom
tylerbeebe/trunk-23770-latest-per-major

Conversation

@acatxnamedvirtue

Copy link
Copy Markdown
Contributor

Part of TRUNK-23770

Why

analytics-uploader @v2 has to keep installing the newest 0.x analytics-cli after 1.0.0 is promoted, and @v3 has to follow 1.x. trunk.io has one mutable pointer today, channel.json, so an uploader major can't tell "the newest release" from "the newest release I support".

There's also a bug coming: promoting a 0.17.x backport after 1.0.0 would move channel.json and GitHub's "latest" flag backwards to the backport.

What changes

set-latest-in-s3.sh

  • Every promotion also writes channel-<major>.json ({"latest": "<version>"}): channel-0.json, channel-1.json, and so on.
  • Each pointer moves forward only, unless ALLOW_DOWNGRADE=true. So a 0.17.x backport after 1.0.0 moves only channel-0.json.
  • It writes global_moved=true|false to $GITHUB_OUTPUT.
  • If reading a pointer fails for any reason other than "not found", the script fails and writes nothing. Without shopt -s inherit_errexit, an AccessDenied inside $(...) was logged, but the pointer was overwritten anyway and the script exited 0.

promote_release.yml

  • New allow-downgrade input (default false) for a deliberate rollback.
  • GitHub's "latest" flag moves only when channel.json moved. Otherwise the release is marked non-prerelease with --latest=false.

mirror_release_to_s3.yml: step name only. It calls the same script, so it writes the per-major pointer too.

CONTRIBUTING.md: the Promote step and the bucket layout describe both pointers.

Consumers

Testing

Ran the script against a fake aws backed by a temp directory, starting from channel.json at 0.17.0:

Promote Result
0.17.0 channel-0 and channel → 0.17.0
1.0.0 channel-1 and channel → 1.0.0
0.17.1 channel-0 → 0.17.1; channel stays 1.0.0; global_moved=false
0.16.9 nothing moves; warning
0.16.9, ALLOW_DOWNGRADE=true both move
9.9.9 (unpublished) fails on the missing manifest
0.17.10 over 0.17.9 moves (sort -V)
an AccessDenied read fails, writes nothing

trunk check is clean.

After merge

Re-run Promote Release for 0.17.0 to seed channel-0.json. Do this before analytics-uploader v2.1.8 ships, and before 1.0.0 is promoted.

🤖 Generated with Claude Code

Promote now points channel-<major>.json at the version too, so each
analytics-uploader major can follow its own line: @v2 reads channel-0.json and
keeps getting 0.x backports after 1.0.0 is the latest release. channel.json and
GitHub's latest move only when the version is the newest overall, so promoting
a 0.17.x backport after 1.0.0 no longer moves either of them backwards. A
pointer never moves back unless allow-downgrade is set, for a rollback.

The script also fails when reading a pointer fails for any reason other than a
missing object, instead of writing over it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

@acatxnamedvirtue

Copy link
Copy Markdown
Contributor Author

/trunk merge

@trunk-io
trunk-io Bot merged commit 5be4978 into main Nov 11, 2026
23 checks passed
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