Skip to content

feat(cli)!: require --test-collection-id and remove the repo lane - #1298

Merged
trunk-io[bot] merged 1 commit into
mainfrom
tylerbeebe/trunk-23150-analytics-cli-100-require-test
Nov 12, 2026
Merged

trunk-io[bot] merged 1 commit into
mainfrom
tylerbeebe/trunk-23150-analytics-cli-100-require-test

Conversation

@acatxnamedvirtue

Copy link
Copy Markdown
Contributor

analytics-cli 1.0.0 uploads only to test collections. Every org is on them now (TRUNK-21074).

Breaking changes

  • --test-collection-id (TRUNK_TEST_COLLECTION_ID) is required for upload and test; a blank value counts as missing. The rspec gem stays off, with a warning, without TRUNK_TEST_COLLECTION_ID. The test-runner plugin makes no quarantine lookup and no upload without it.
  • --public-repo-id (TRUNK_PUBLIC_REPO_ID) and its x-trunk-public-repo-id header are removed. Forked pull requests use --allow-forked-pr-uploads, which stays. --token is required unless --allow-forked-pr-uploads is passed.
  • --hide-test-collection-links (TRUNK_HIDE_TEST_COLLECTION_LINKS) and repo-scoped test links (/flaky-tests/test/<id>) are removed. Links always point into the collection.

CI

  • The smoke tests name a collection on every run.
  • The two "public repo id" uploads now use the collection fork lane: --allow-forked-pr-uploads with 4B2wfoEU (production) and z2dzjLHm (staging). Both collections have forked-PR uploads enabled (confirmed 2026-11-09).
  • These steps have no continue-on-error, so a failure fails perform_smoke_test, which gates release promotion.

Not in this PR: removing the v1/v2 decision call and the collection inference, which no CLI run can reach now (TRUNK-23148).

Conflicts: #1293 (fork lane on v2) touches api/src/client/mod.rs, cli/src/upload_command.rs, cli/tests/common/command_builder.rs and cli/tests/upload.rs; whichever merges second rebases. #1295 also edits api/src/urls.rs.

Tests

  • New: the required flag (upload, test, blank values), --public-repo-id being gone, a token or --allow-forked-pr-uploads being required, the plugin making no calls without a collection, and the gem staying off (test/test_collection_spec.rb).
  • Repo-only and inference-only tests are deleted.
  • cargo nextest run --workspace: 593 of 596 pass; the 3 failures are Swift xunit tests that need a Swift language server. The gem specs were not run locally (the native extension doesn't compile on the dev box), so CI is their first run.

Part of TRUNK-23150

🤖 Generated with Claude Code

@trunk-io

trunk-io Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

analytics-cli 1.0.0 uploads only to test collections.

- `--test-collection-id` / `TRUNK_TEST_COLLECTION_ID` is required for
  `upload` and `test`; a blank value counts as missing. `run_upload` also
  refuses a run without one, for the test-runner plugins.
- The rspec gem stays off, with a warning, when `TRUNK_TEST_COLLECTION_ID`
  is unset or blank; the native plugin makes no quarantine lookup and no
  upload without it.
- `--public-repo-id` / `TRUNK_PUBLIC_REPO_ID` and its
  `x-trunk-public-repo-id` header are gone. `--allow-forked-pr-uploads`
  stays.
- `--hide-test-collection-links` / `TRUNK_HIDE_TEST_COLLECTION_LINKS` and
  the repo-scoped `/flaky-tests/test/<id>` link are gone.
- Smoke tests name a collection on every run, and the public repo id
  steps use the collection fork lane instead.

Part of TRUNK-23150

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trunk-io
trunk-io Bot merged commit e68b666 into main Nov 12, 2026
23 checks passed
trunk-sudo Bot pushed a commit that referenced this pull request Nov 12, 2026
Since #1298 the rspec gem turns itself off when TRUNK_TEST_COLLECTION_ID
is unset. The quarantine-lookup abort step set no collection, so the gem
never ran the lookup, slow_test ran in full and the step hit its 25s
timeout. A fake collection turns the gem on, and the lookup fails on the
fake credentials as the step intends.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
acatxnamedvirtue added a commit that referenced this pull request Nov 12, 2026
…1084)

#1298 made test_case_url's short_id required, so the no-repo GUID test no
longer compiled once rebased onto main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trunk-io Bot pushed a commit that referenced this pull request Nov 12, 2026
…kup named the collection (#1295)

* feat(upload): link failing tests by GUID when only the quarantine lookup named the collection

The failing-tests table built its GUID links only from the upload's ids. A dry run
or a failed upload has none, so it fell back to the `/t/<id>?repo=` short link even
when the v2 quarantine lookup had already returned the collection uuid and
repository id. The run now uses the lookup's pair when the upload gives none.

Also pins ADR-0019's `--no-repo` golden vector at the URL layer.

Part of TRUNK-21084

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

* test(upload): pin the exact GUID link the quarantine lookup ids produce (TRUNK-21084)

The test only checked the `/collections/tc_123/tests/` prefix, so a link
built from the short id, a nil repo id or the wrong test still passed. It
now uploads the checked-in junit0_fail.xml instead of the randomly seeded
mock, so the one failing test's id is stable, and asserts the full URL and
that it is the only test link printed.

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

* test(urls): pass the collection short id as &str after #1298 (TRUNK-21084)

#1298 made test_case_url's short_id required, so the no-repo GUID test no
longer compiled once rebased onto main.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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