Repository navigation
feat!: v3 uploads with the trunk CLI and analytics-cli 1.x (TRUNK-23151) - #158
Merged
Merged
Conversation
Merged
3 tasks done
acatxnamedvirtue
added a commit
to trunk-io/flake-farm-staging-fork-prs
that referenced
this pull request
Nov 16, 2026
@main becomes v3 when trunk-io/analytics-uploader#158 merges, which needs a v2 API key, analytics-cli 1.x and trunk CLI 0.0.14 or later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acatxnamedvirtue
added a commit
to trunk-io/flake-farm-staging-fork-prs
that referenced
this pull request
Nov 16, 2026
0.17.0 is the release of the 0.17.0-beta.3 the workflows ran. @main becomes analytics-uploader v3 when trunk-io/analytics-uploader#158 merges, which needs a v2 API key, analytics-cli 1.x and trunk CLI 0.0.14 or later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The action installs the trunk CLI from trunk.io/releases/trunk-cli (sha256 checked against the version's manifest), stores the token with `trunk auth api-key set` (key in TRUNK_ORG_API_KEY only, masked) and runs `trunk flakytests upload|test` with an argv array, so the trunk CLI hands analytics-cli 1.x its credential. - cli-version `latest` resolves from channel-1.json and is passed as TRUNK_ANALYTICS_CLI_VERSION; no 0.x fallback. - New trunk-cli-version input; test-collection-id is required; public-repo-id, hide-banner and gh-action-ref are removed. - quarantine: false maps to --disable-quarantining; true passes nothing. - run is wrapped as `-- /bin/sh -c <run>` (cmd.exe /d /s /c on Windows). - The trunk CLI and analytics-cli binaries are cached separately; a per-step credential store under RUNNER_TEMP is removed when the step ends; an inherited TRUNK_API_TOKEN is dropped. - github-annotations runs through `trunk flakytests github-annotations`. - The action's own telemetry, protobufjs and @actions/github are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…UNK-23151) README and CONTRIBUTING describe the trunk CLI install, the v2 API key token, the required test collection and the removed inputs. The release workflow can move v3; the PR smoke test points the staging upload's key exchange at the staging API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-prefixed versions (TRUNK-23151) - token must be a v2 API key. An organization token would still upload through the gateway's JWT exchange, but analytics-cli 1.x refuses it and Trunk is retiring it on v2 (TRUNK-21105); v2 users keep it on @v2. - trunk-cli-version, pinned or latest, must be 0.0.14 or later: 0.0.13 and older store the key unchecked and hand analytics-cli no credential. - A leading v on cli-version or trunk-cli-version is dropped, since the trunk CLI takes plain semver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acatxnamedvirtue
force-pushed
the
tylerbeebe/trunk-23151-uploader-v3
branch
from
November 18, 2026 19:09
30e017d to
377f742
Compare
v3 refuses organization tokens, so its CI uploads with TRUNK_PROD_API_V2_TOKEN and TRUNK_STAGING_API_V2_TOKEN. The v2.x branch keeps the organization token secrets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acatxnamedvirtue
requested review from
TylerJang27,
dfrankland and
max-trunk
November 18, 2026 19:26
dfrankland
approved these changes
Nov 18, 2026
dfrankland
left a comment
Member
There was a problem hiding this comment.
(not asking for this to change, just lamenting) we should switch to vitest 😭
Comment on lines
+135
to
+136
| (entry): entry is [string, string] => | ||
| !dropped.has(entry[0]) && entry[1] !== undefined, |
Member
There was a problem hiding this comment.
I know I'm a total dork about this: using is is an unsafe type assertion, you can use flatMap instead to transform the type while filtering
This was referenced Nov 19, 2026
trunk-io Bot
pushed a commit
to trunk-io/toolbox
that referenced
this pull request
Nov 19, 2026
Pins `trunk-io/analytics-uploader` from `@main` to `@v2`. analytics-uploader's `main` became v3 on 2026-11-19 (trunk-io/analytics-uploader#158). v3 runs analytics-cli 1.x and accepts only a v2 API key, so every upload here that passes an organization token now fails with: > token must be a v2 API key (trunk_v2_...) … or stay on analytics-uploader@v2 to keep using the organization token. `@v2` (currently v2.1.8) is the same action this repo ran before the merge. It still takes the organization token and analytics-cli 0.17.x. Moving to `@v3` later needs a v2 API key with the Upload test results permission as the `token`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 19, 2026
trunk-io Bot
pushed a commit
to trunk-io/toolbox
that referenced
this pull request
Nov 19, 2026
Moves both test-result uploads (`pr.yaml`, `main.yaml`) from the `@v2` pin back to `trunk-io/analytics-uploader@main`, which is v3 since trunk-io/analytics-uploader#158. - **Credentials:** `token: ${{ secrets.TRUNK_PROD_V2_TEST_UPLOAD_TOKEN }}`, a `trunk` v2 API key with Upload test results. This repo is **public**, so the org-level secret doesn't reach it: it needs a **repo-level** secret with this name. v3 refuses the organization token in `TRUNK_PROD_ORG_API_TOKEN`. - **Test collection:** `test-collection-id: HilUwBm9`. v3 requires one. - **CLI version:** unset, so v3 runs the latest analytics-cli 1.x from `channel-1.json` (1.0.0 today). This repo uploads to production, so it needs no `TRUNK_API_URL`. **Merge after the repo secret is added.** Until then the upload fails with "Missing token". The steps have `continue-on-error`, so the jobs still pass, but nothing uploads. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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-23151
Ready to merge. Everything v3 depends on has shipped: trunk CLI 0.0.14 is on prod, and analytics-cli 1.0.0 is promoted to
channel-1.json. Rebased ontomainafter #159.v3 installs the trunk CLI and runs it. It no longer downloads trunk-analytics-cli itself. v2 maintenance moves to the new
v2.xbranch, cut at v2.1.8 (9886de7), andmainbecomes v3.What v3 does
trunk-<v>-<platform>fromtrunk.io/releases/trunk-cli/prod, checks its sha256 against the version'smanifest.json, and caches it with@actions/cache.trunk-cli-version: latestreadschannel.json. Pinned or latest, the version must be 0.0.14 or later.trunk auth api-key set, with the key only inTRUNK_ORG_API_KEY.TRUNK_CREDENTIALS_FILEunderRUNNER_TEMP), which is removed afterwards.tokenmust be a v2 API key (trunk_v2_...). Organization tokens are refused; they stay on@v2.trunk flakytests uploadortest.execFileSync, no shell), as--flag=value.runbecomes-- /bin/sh -c "<run>", orcmd.exe /d /s /con Windows. Those are the shells v2 used, so shell syntax keeps working.uploadand the key fortest(trunk2#8432).cli-version: latestreads onlychannel-1.jsonand fails clearly rather than falling back to 0.x. The version goes to the trunk CLI asTRUNK_ANALYTICS_CLI_VERSION. A leadingvis dropped.--allow-forked-pr-uploadswith the job'sGITHUB_TOKEN, no key);previous-step-outcome;github-annotations, now throughtrunk flakytests github-annotations.TRUNK_NO_AUTO_UPDATE=1, and without an inheritedTRUNK_API_TOKENorTRUNK_ORG_API_KEY.Inputs
public-repo-id,hide-banner,gh-action-ref.test-collection-idis required.quarantine: false→--disable-quarantining.use-uncloned-repo's brokentype: trueis nowboolean.trunk-cli-version.The action's own telemetry (protobuf to trunk1 with
x-api-token) is removed, along withprotobufjsand@actions/github. The trunk CLI reports each run with the stored key (trunk2#8469, in 0.0.14).Workflows
release.ymloffersv3. v2 patches are cut fromv2.x.pr.yml's staging step setsTRUNK_API_URLforapi-key set.pr.ymluploads with the newTRUNK_PROD_API_V2_TOKENandTRUNK_STAGING_API_V2_TOKENsecrets, v2 API keys with Upload test results. Thev2.xbranch keeps the organization-token secrets, which analytics-cli 0.17.x needs.Before releasing (all done)
MIN_TRUNK_CLI_VERSION, and the first release with awindows-x64build.channel-1.json.channel.jsonand GitHub's latest stay on 0.17.0, so@v2and older pins are unaffected.pr.yml(above).Testing
latestto 0.0.14, which ran analytics-cli 1.0.0 fromchannel-1.json. Both the prod and staging uploads succeeded on every leg with the v2 keys, including Windows, whose leg is allowed to fail but didn't. The dry-run job read quarantine with the prod key.pnpm test: 5 suites, 97 tests pass. msw stays atonUnhandledRequest: "error".pnpm buildis clean anddist/is current.trunk checkandfmtreport no new issues.dist/index.jslocally as a dry run against trunk CLI 0.0.13 and analytics-cli 0.17.0. Install, the sha check, the cache layout, theft uploadargv,ft testthrough/bin/sh -c, and credential cleanup behaved as intended.Known limit: on Windows, Rust escapes
"insiderunas\", whichcmd.exemay not read as intended. The README says so.🤖 Generated with Claude Code