Repository navigation
fix(cli): say why an upload failed - #1357
Merged
Merged
Conversation
An upload error with a base message ("There was an unexpected error
that occurred while uploading test results") printed only Trunk's
explanation beneath it, so an error with none, such as
--allow-forked-pr-uploads outside a fork pull request, printed a blank
line where the reason belongs, in the summary and in the GitHub
annotation alike. Print the error and its causes in that case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
😎 Merged successfully - details. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1357 +/- ##
==========================================
+ Coverage 85.61% 85.81% +0.19%
==========================================
Files 85 85
Lines 19174 19180 +6
==========================================
+ Hits 16416 16459 +43
+ Misses 2758 2721 -37 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
TylerJang27
approved these changes
Nov 17, 2026
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.
Problem
When an upload fails, the CLI prints "There was an unexpected error that occurred while uploading test results". Beneath that it printed only Trunk's explanation, and only when Trunk's API gave one. Every other error left a blank line where the reason belongs, in the text summary and in the GitHub annotation alike.
Found on 1.0.0-beta.1 in the flake farm (trunk-io/flake-farm-staging-fork-prs#6188). There,
--allow-forked-pr-uploadson a pull request that isn't from a fork printed:The CLI had the right message, "…uploads only from a GitHub Actions run of a pull request from a fork…", but dropped it.
UPGRADING.mdpromises that this case "uploads nothing and says why".Change
ErrorSummary::reason()returns Trunk's explanation when there is one. Otherwise it returns the error with its causes, joined with:the way anyhow's{:#}joins them.text::render_errorand the GitHub annotation'serror_messageprintreason()beneath the base message.errorandcauses.The same case now prints:
Testing
prints_the_error_and_its_causes_beneath_the_base_message(text) andwarns_with_the_reason_an_upload_failed(annotation).trunk-analytics-cliandtest_reportsuites pass locally, except the three Swift xunit tests, which need a Swift toolchain this machine doesn't have.--allow-forked-pr-uploadsand no token outside a fork PR; output is above.trunk checkis clean. The clippy warnings in the touched test file predate this change.🤖 Generated with Claude Code