Skip to content

[rush] Fix logging for non-zero exit codes #4984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Fix an issue where if an Operation wrote all logs to stdout, then exited with a non-zero exit code, only the non-zero exit code would show up in the summary.",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,12 @@ export class OperationExecutionManager {
if (message) {
// This creates the writer, so don't do this until needed
record.collatedWriter.terminal.writeStderrLine(message);
// Ensure that the error message, if present, shows up in the summary
// Ensure that the summary isn't blank if we have an error message
// If the summary already contains max lines of stderr, this will get dropped, so we hope those lines
// are more useful than the final exit code.
record.stdioSummarizer.writeChunk({
text: `${message}\n`,
kind: TerminalChunkKind.Stderr
kind: TerminalChunkKind.Stdout
});
}
}
Expand Down
Loading