diff --git a/common/changes/@microsoft/rush/stdio-blank-summary_2024-10-29-00-31.json b/common/changes/@microsoft/rush/stdio-blank-summary_2024-10-29-00-31.json new file mode 100644 index 00000000000..baa2f378a5e --- /dev/null +++ b/common/changes/@microsoft/rush/stdio-blank-summary_2024-10-29-00-31.json @@ -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" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts b/libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts index d564a53eea7..bd54fc9ff81 100644 --- a/libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts +++ b/libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts @@ -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 }); } }