Repository navigation
feat(cli)!: use only the Trunk API v2 routes (TRUNK-23148) - #1313
Merged
Merged
Conversation
acatxnamedvirtue
changed the base branch from
tylerbeebe/trunk-23150-analytics-cli-100-require-test
to
tylerbeebe/trunk-23773-otlp-upload-telemetry
November 13, 2026 18:08
acatxnamedvirtue
force-pushed
the
tylerbeebe/trunk-23148-v2-apis-only
branch
from
November 13, 2026 18:10
424ef8a to
f475224
Compare
acatxnamedvirtue
marked this pull request as ready for review
November 13, 2026 18:18
acatxnamedvirtue
requested review from
TylerJang27,
dfrankland and
max-trunk
November 13, 2026 18:21
acatxnamedvirtue
force-pushed
the
tylerbeebe/trunk-23148-v2-apis-only
branch
from
November 13, 2026 20:21
f475224 to
d12df0e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## tylerbeebe/trunk-23773-otlp-upload-telemetry #1313 +/- ##
===============================================================================
Coverage ? 85.86%
===============================================================================
Files ? 84
Lines ? 19211
Branches ? 0
===============================================================================
Hits ? 16496
Misses ? 2715
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
acatxnamedvirtue
force-pushed
the
tylerbeebe/trunk-23148-v2-apis-only
branch
from
November 16, 2026 18:11
d12df0e to
efc52f8
Compare
TylerJang27
approved these changes
Nov 16, 2026
analytics-cli 1.0.0 always uses v2. The CLI and the test-runner plugins that share the `api` crate (`test_report`, and through it the rspec gem's native extension) make no v1 call and no `getUploadApiVersion` call. - The v1 upload and quarantine client (`createBundleUpload`, `getQuarantineConfig`) and the `getUploadApiVersion` decision are gone, with their types: `UploadApiVersion`, `UploadApiDecision`, `GetUploadApiVersionRequest/Response`, `GetQuarantineConfigResponse` and the v1-only `CreateBundleUploadResponse.key`. - `test_report` drops its on-disk API-version cache. Its quarantine cache keeps the `#v2` key suffix, so a v1 entry from 0.17.x is never read. - The collection inference and "Trunk has no collection" skip that 0.17.x read from the decision are gone, with the `UPLOAD_SKIPPED` notice. - The fork lane keeps #1293's v2 path: a credential-free GitHub Actions fork PR run swaps its `GITHUB_TOKEN` at `POST /v2/auth/github-actions/login` and sends the login on `x-trunk-token`. There is no v1 fallback: a refused swap, a missing `GITHUB_TOKEN`, or `--allow-forked-pr-uploads` with no token outside a fork PR uploads nothing and says why. - 4xx bodies are read as public-api's `{"error": {"code", "message"}}` envelope; v1's top-level shape and its org-slug 404 hint are gone. - The mock server serves the v2 routes, and the CLI, plugin and client tests run against them. The smoke steps that exercised v1's credential-free lane are removed. Telemetry is unchanged: it still goes to trunk1's telemetry service with the token on `x-api-token`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1.0.0 (TRUNK-23148) The flags it warned about are gone, so no run reports a deprecation. The summary schema's notice kinds are now BEP_PARSE_ERROR only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t left (TRUNK-23148) The rspec gem printed deprecation notices on stderr; with the variant gone, there are none to print. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acatxnamedvirtue
force-pushed
the
tylerbeebe/trunk-23148-v2-apis-only
branch
from
November 16, 2026 22:52
eb766c5 to
28d508f
Compare
acatxnamedvirtue
changed the base branch from
tylerbeebe/trunk-23773-otlp-upload-telemetry
to
main
November 16, 2026 22:52
|
😎 Merged successfully - details. |
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-23148
Based on
main. #1328 (TRUNK-23773) merged on 2026-11-16, so upload telemetry already goes to public-api's v2 metrics route. That was what this PR waited for: "v2 APIs only" couldn't ship while telemetry still used v1 (decided 2026-11-11). #1314 is stacked on this PR.What changes
1.0.0 always uses the Trunk API v2.
Removed:
api/src/client/v1.rs, withcreateBundleUploadandgetQuarantineConfig.getUploadApiVersiondecision call, its retry and its types.GetQuarantineConfigResponseand the v1-onlykeyfield.test_report's on-disk API-version cache.UPLOAD_SKIPPEDnotice. 1.0.0 requires--test-collection-id(feat(cli)!: require --test-collection-id and remove the repo lane #1298).is_fork_pr, and v1's org-slug hint on a 404.Kept: #1293's v2 fork lane, the
GITHUB_TOKENswap atPOST /v2/auth/github-actions/login, sent onx-trunk-token. With no v1 fallback, each of these now uploads nothing and logs why:GITHUB_TOKEN;--allow-forked-pr-uploadsoutside a fork PR.Fixed: 4xx errors are now parsed from public-api's
{ error: { code, message } }envelope. The client read v1's top-level shape and never showed the v2 message.Tests and docs:
test_utilsserves the three v2 routes by default, and every CLI, plugin and client test runs against them.perform_smoke_test. Those steps ran in this repo's own CI, which is never a fork pull request, so on v2 they could only upload nothing. The v2 fork lane is covered end to end bytrunk-io/flake-farm-staging-fork-prs. A generator fork opens a pull request there every 30 minutes, and its runs exchange the job'sGITHUB_TOKEN(ci_fork) and upload to staging on v2. That's 877 exchanges in the 24 hours to 2026-11-16, on 0.17.0-beta.3 withanalytics-cli-use-api-v2on fortrunk-staging-org.--allow-forked-pr-uploadshelp text are updated.Testing
cargo test -p api,-p test_report --test telemetryand-p trunk-analytics-cli --test upload --test testpass, except the 3swift_test_xunittests, which fail the same way on unmodifiedmainon this machine.trunk checkandtrunk fmt: clean.Merge order
#1328 (merged), then this PR, then #1314 (stacked on this one). #1298, #1296 and #1295 have merged, and this PR is rebased on them:
use_quarantininggone, the quarantine result readsupload_args.disable_quarantiningdirectly.getUploadApiVersionmock is dropped.x-api-tokenheader,version_path_prefixandDEBUG_STRIP_VERSION_PREFIXhad no users left and are removed, along with their CONTRIBUTING line.🤖 Generated with Claude Code