Skip to content

trunk-merge/pr-1314/d8dbb2f9-acdf-431a-9216-54003b3524f5 - #1334

Closed
trunk-io[bot] wants to merge 7 commits into
mainfrom
trunk-merge/pr-1314/d8dbb2f9-acdf-431a-9216-54003b3524f5
Closed

trunk-io[bot] wants to merge 7 commits into
mainfrom
trunk-merge/pr-1314/d8dbb2f9-acdf-431a-9216-54003b3524f5

Conversation

@trunk-io

@trunk-io trunk-io Bot commented Nov 17, 2026

Copy link
Copy Markdown
Trunk Merge Pull Request Banner

This pull request was created and is being managed by Trunk Merge for the main merge queue.

This pull request is based on the main branch at SHA 31300453b14b11c7ec7a045a92fabd7d32b5a85c.

See more details here.

When CI completes, this pull request will be closed automatically.

Pull Requests Being Tested

This pull request is testing the changes from pull request 1314.

acatxnamedvirtue and others added 7 commits November 17, 2026 13:14
…-23372)

analytics-cli 1.0.0 reads what `--token` / `TRUNK_API_TOKEN` holds before
it calls Trunk:

- `trunk_v2_...` is a v2 API key, sent as `Authorization: Bearer` for the
  gateway to exchange.
- Three non-empty base64url segments is a Trunk JWT, sent on
  `x-trunk-token` (#1293's header) and never as a bearer.
- Anything else is the organization token, refused before any call with
  how to create a v2 key (Settings → Developer → API Keys), the Upload
  test results permission it needs, and the 0.17.x pin. `upload` and
  `test` exit with an error, and `test` refuses before running the tests.
  The fork lane's `GITHUB_TOKEN` exchange is unchanged.

On the three CLI endpoints, a 403 `INSUFFICIENT_PERMISSIONS` names the
missing `upload_test_results` permission group and how to grant it, and
a 401 for a JWT says it is expired or invalid (with its `exp` when past)
and to re-run `trunk login --api-key` or pass an API key. The error
report shows that explanation in place of the generic org-slug hint.

A Trunk JWT lasts 15 minutes (auth-hydra's `ttl.access_token`), which a
long `test` run or a plugin that looks up quarantine early and uploads
late can outlive. The CLI does not refresh it; the 401 message and the
docs say to mint it right before the upload step.

`test_report` and the rspec gem apply the same rule: the gem asks the
native extension (`RSpec::Trunk.token_refusal`) and stays off with a
warning for an organization token.

Telemetry is unchanged and still sends the token on `x-api-token`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…UNK-23916)

`trunk login --api-key` was canceled. A Trunk JWT now reaches analytics-cli
from `trunk flakytests upload`, exchanged from a key stored with
`trunk auth api-key set`, and can have about a minute left, so the help
text, the expired-JWT message and the docs point there instead of telling
users to mint a 15-minute JWT themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… comment

TRUNK-23371 is canceled; the JWT now comes from `trunk flakytests upload`,
and a gem run should use a v2 API key (see the README's Credentials).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…149)

analytics-cli 1.x refuses the organization token, so every step that runs
the built CLI or the rspec gem now uses TRUNK_PROD_API_V2_TOKEN and
TRUNK_STAGING_API_V2_TOKEN. The Dynamic CI filter steps keep
TRUNK_PROD_ORG_API_TOKEN: they don't run analytics-cli.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-token pin (TRUNK-23149)

Review follow-up. Messages, the --token help and the README link to
https://app.trunk.io/settings/developer/api-tokens, which the web app sends to
the viewer's org. The organization token keeps working on 0.17.x until
December 1, 2027.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tests

ubuntu-latest is now ubuntu-26.04, where qemu-user-static is a virtual
package with no installation candidate, so apt-get exits 100 before the
smoke test runs. qemu-user-binfmt provides the user-mode emulators and
registers binfmt_misc on both 24.04 and 26.04.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.39583% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.05%. Comparing base (3130045) to head (0532737).

Files with missing lines Patch % Lines
api/src/client/v2.rs 92.50% 3 Missing ⚠️
cli/src/summary_output/github.rs 87.50% 1 Missing ⚠️
cli/src/upload_command.rs 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1334      +/-   ##
==========================================
+ Coverage   85.76%   86.05%   +0.29%     
==========================================
  Files          84       85       +1     
  Lines       19381    19538     +157     
==========================================
+ Hits        16622    16814     +192     
+ Misses       2759     2724      -35     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trunk-io trunk-io Bot closed this Nov 17, 2026
@trunk-io
trunk-io Bot deleted the trunk-merge/pr-1314/d8dbb2f9-acdf-431a-9216-54003b3524f5 branch November 17, 2026 13:54
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