Report build errors and failures to standard error stream during redirection#33
Report build errors and failures to standard error stream during redirection#33google-labs-jules[bot] wants to merge 2 commits intomainfrom
Conversation
…tion Modified ConsoleLogger and the CLI runner to ensure that build errors and tool failure notifications are written to the standard error stream when standard output is redirected (e.g., to $GITHUB_STEP_SUMMARY). Key changes: - Refactored ConsoleLogger to support flexible routing to any TextWriter. - LogFailed now mirrors output to Console.Error if output is redirected. - CLI runner now captures all stdout from dotnet commands. - Detected errors in stdout are mirrored to Console.Error immediately if redirection is active. - On command failure with suppressed stdout (like restore), the full captured log is dumped to stderr and the markdown summary. - Prevented ANSI escape codes from leaking into markdown summaries while preserving them for console stderr output.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…tion (CLI only) Modified the CLI runner to ensure that build errors and tool failure notifications are written to the standard error stream when standard output is redirected (e.g., to $GITHUB_STEP_SUMMARY). Key changes: - Introduced a local LogFailed helper in cli/Program.cs to mirror failure notifications to Console.Error when redirection is active. - Improved RunDotnetAsync to capture all stdout from dotnet commands. - Detected errors in stdout are mirrored to Console.Error immediately if redirection is active or stdout logging is suppressed. - On command failure with suppressed stdout (like restore), the full captured log is dumped to stderr and the markdown summary. - Fixed ANSI escape codes leaking into markdown summaries while preserving them for console stderr output. - All changes are contained within the CLI package.
If the CLI's stdout is redirected to a file (like
$GITHUB_STEP_SUMMARY), many important error messages fromdotnetcommands and the tool's own failure notifications were previously lost from the console.This PR ensures these messages are written to the standard error stream when redirection is detected, providing immediate visibility into failures while maintaining clean and useful Markdown summaries. It also avoids duplicating output in interactive terminal sessions.
PR created automatically by Jules for task 10890483434945522317 started by @sator-imaging