feat(upload): print a short link to the upload when a collection id is passed - #1168
Draft
TylerJang27 wants to merge 2 commits into
Draft
feat(upload): print a short link to the upload when a collection id is passed#1168TylerJang27 wants to merge 2 commits into
TylerJang27 wants to merge 2 commits into
Conversation
…s passed The end-of-run "Bundle Upload ID" line becomes a link when the run is in test-collection link mode: 🏷️ Bundle Upload: https://app.trunk.io/{org}/flaky-tests/collections/{short_id}/u/{bundle_meta_id} The webapp resolves the upload's createdAt from the id and redirects to the canonical uploads page (companion PR: trunk-io/trunk2#5440). Unlike the per-test `/t/` links there is no `?repo=` param — the collection short id fully scopes the lookup. Gated exactly as the `/t/` links are: a collection id must be passed and `--hide-test-collection-links` / `TRUNK_HIDE_TEST_COLLECTION_LINKS` must be unset. Otherwise the bare bundle upload id prints as before. The gate reads `test_collection_short_id` rather than `base_props.test_collection.short_id` because an exported-but-blank `TRUNK_TEST_COLLECTION_ID` is `Some("")`, not `None`, and would otherwise produce a malformed `/collections//u/` link. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1168 +/- ##
==========================================
+ Coverage 83.07% 83.36% +0.28%
==========================================
Files 72 72
Lines 16313 16359 +46
==========================================
+ Hits 13552 13637 +85
+ Misses 2761 2722 -39 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
TylerJang27
marked this pull request as draft
August 26, 2026 02:40
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.
Summary
The end-of-run
🏷️ Bundle Upload IDline becomes a link when the run is in test-collection link mode:The webapp resolves the upload's
createdAtfrom the id and redirects to the canonical uploads page. No RPC or response changes —CreateBundleUploadResponse.test_collection_bundle_meta_idalready carries the id, andcontext.rsalready threads it ontobase_props.test_collection.Unlike the per-test
/t/links from #1165, there is no?repo=param: the collection short id fully scopes the webapp's lookup, so there is no repo name to resolve.Companion webapp PR (must deploy first, it hosts the redirect page): trunk-io/trunk2#5440
Behavior
--hide-test-collection-links/TRUNK_HIDE_TEST_COLLECTION_LINKS🏷️ Bundle Upload: …/collections/{short_id}/u/{bundle_meta_id}🏷️ Bundle Upload ID: {id}(unchanged)🏷️ Bundle Upload ID: {id}(unchanged)Same gate as #1165, so the one flag controls both link kinds.
Note on the gate
collection_upload_url()readstest_collection_short_idrather thanbase_props.test_collection.short_id. An exported-but-blankTRUNK_TEST_COLLECTION_IDisSome(""), notNone, so the latter yields a malformed/collections//u/…link — the same edge #1165 added a test for. The existingupload_bundle_without_test_collection_id_prints_repo_linkstest caught this.upload_bundle's assertion changed: that test passes--test-collection-id tc_123, so by design it now gets the link rather than the bare id. The bare-id form stays covered by the new links-hidden test.Test plan
cargo test -p api— URL unit test for the new form (20 passing)cargo test -p trunk-analytics-cli— full suite green (53 + 23 + 13 + 9), including 2 new integration tests covering the gate matrix abovecargo fmtapplied;cargo clippyfindings unchanged frommain(5 pre-existing inupload_command.rsbefore and after)🤖 Generated with Claude Code