fix(shell): Preserve verbatim stdout in log files and ShellRun.stdout#18
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18 +/- ##
==========================================
+ Coverage 85.60% 85.89% +0.29%
==========================================
Files 21 21
Lines 2049 2042 -7
==========================================
Hits 1754 1754
+ Misses 295 288 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
.stdout.log/.stderr.loginstead of piping through Richconsole.log(which wrapped long lines and broke single-line JSON).ansi_content=True; Rich record buffer keeps raw ANSI for HTML export.parse_outputreadsstdout/stderrdirectly instead of collapsing viastdout_one_line.Why
terraform show -jsonemits one long JSON line. Rich wrapping in the log file corrupted it before tfdo could parse it. The run data layout doc already describes log files as verbatim subprocess output; this restores that contract.Reviewer notes
ansi_content=True(terraform/kubectl). Live event callbacks (ShellRunStdOutput) still carry raw subprocess lines for display.parse_outputand tfdoshow_plan_jsonbenefit immediately; no tfdo changes required.stdout_one_lineunchanged: Still collapses lines for callers liketerraform --version; no longer used insideparse_output.skip_html_log_filestodo).Test plan
just pre-commit-asktfdo aon a plan with long JSON; confirm noInvalid JSON: control characterand single-lineterraform.stdout.log