Repository navigation
Build the validate summary as data, separate from rendering - #1254
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dylan/trunk-22401-build-the-upload-summary-as-data-separate-from-rendering #1254 +/- ##
==============================================================================================================
+ Coverage 84.74% 84.85% +0.10%
==============================================================================================================
Files 78 79 +1
Lines 18058 18144 +86
==============================================================================================================
+ Hits 15304 15396 +92
+ Misses 2754 2748 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
TylerJang27
approved these changes
Oct 26, 2026
Collaborator
There was a problem hiding this comment.
report/test_report is a bit of an overloaded term in this repo. Can we either:
- Rename the rspec test_report stuff to gem or integration or something
- and/or rename this cli/src/report to cli/src/summary_output or something
…ering
ValidateReport, in the report module, works out everything the validate
summary says once: the matched files, one FileValidation per file, the
CODEOWNERS check, the counts and the exit code. main exits with
report.exit_code, and the terminal output, including the EndOutput impl
for ValidateRunResult, moves into the text renderer. The report derives
Serialize, for the JSON output to come.
validate and upload's validation section now read the same
FileValidation. It gains test suite and test case counts, which are null
for a file that wasn't read as exactly one report. Its parse error is now
an error plus its causes, like ErrorSummary, because validate prints the
error the way anyhow's {:?} does. validate collects its --hide-banner
deprecation and BEP parse errors as notices, like upload.
The lock-down tests pass unchanged.
Refs TRUNK-22402
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dfrankland
force-pushed
the
dylan/trunk-22402-build-the-validate-summary-as-data-separate-from-rendering
branch
from
October 27, 2026 20:42
439f3aa to
bcaa633
Compare
This branch has not been deployed
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.
Stacked on #1236. Refs TRUNK-22402.
The validate summary is now built once as data, then rendered, the same way #1236 does it for upload. No output changes, and no JSON flag yet.
What changes.
cli/src/report/validate.rs.ValidateReport::newworks out everything the validate summary says: the matched files, oneFileValidationper file, the CODEOWNERS check, the counts and the exit code. The types deriveSerialize, with camelCase keys.impl EndOutput for ValidateRunResultmoves intoreport/text.rsasrender_validate, which reads only the report. The impl stays onValidateRunResult(built through the report) because the lock-down tests call it.main.rsexits withreport.exit_code;ValidateRunResult::exit_codeis gone.validateandupload's validation section now read the sameFileValidation. It gainstestSuiteCountandtestCaseCount, null for a file that wasn't read as exactly one report. Those files are the ones the text lists under "File parse issues".FileValidation.parseErroris now{error, causes}, likeErrorSummary, instead of a{:#}string.validatehas always printed parse errors the way anyhow's{:?}does, and that can't be rebuilt from the joined string. A unit test checks the rebuilt text against anyhow's own output.run_validatecollects the--hide-bannerdeprecation and the BEP parse errors asnotices, likerun_upload. The deprecation is still only logged.Kept as-is.
counts.filesis the deduplicated count.uploadandvalidatestill collect per-file results differently:uploadhas no entry for a file with no reports and keeps the last of several, wherevalidatereports both as issues.#1246 is stacked on this. Its JSON test and doc comments are updated for
parseErroras an object and the two count fields.Testing.
cli/tests/summary/pass unchanged.cargo test -p trunk-analytics-cli --lib --test summary --test test --test validate: all pass.cargo test -p trunk-analytics-cli --test upload: all pass except the three Swift xunit tests, which fail the same way on the base branch locally.cargo clippy -p trunk-analytics-cli --tests: no new warnings.cargo fmt --all --check: clean.🤖 Generated with Claude Code