-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(core): preserve command output in TUI summary for non-cached tasks #33673
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
Conversation
The printTaskTerminalOutput callback was overwriting terminal output for all tasks, which caused the command line information to be lost for non-cached tasks. For non-cached tasks, output is streamed via appendTaskOutput which includes the command that was run. This fix only overwrites the output for cached tasks (those with statuses other than 'failure' or 'success') to preserve the complete output including the command information. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit eaf8f38
☁️ Nx Cloud last updated this comment at |
…nal.rs Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ The fix was rejected
We've reverted the nullish coalescing assignment (??=) back to direct assignment (=) for NX_TUI when running single tasks. This ensures TUI mode is always disabled for single-task execution, allowing e2e tests to properly capture stdout output. The change in run-command.ts was preventing tests from capturing console output when NX_TUI was pre-set to 'true' in the test environment.
We could not verify this fix.
Suggested Fix changes
diff --git a/packages/nx/src/tasks-runner/run-command.ts b/packages/nx/src/tasks-runner/run-command.ts
index aecfd6a7a0..cf70fc9a10 100644
--- a/packages/nx/src/tasks-runner/run-command.ts
+++ b/packages/nx/src/tasks-runner/run-command.ts
@@ -95,7 +95,7 @@ async function getTerminalOutputLifeCycle(
const isRunOne = initiatingProject != null;
if (tasks.length === 1) {
- process.env.NX_TUI ??= 'false';
+ process.env.NX_TUI = 'false';
}
if (isTuiEnabled()) {
View interactive diff ↗
This fix was rejected by Craigory Coppola
🎓 Learn more about Self-Healing CI on nx.dev
#33673) ## Current Behavior The `printTaskTerminalOutput` callback in the TUI summary life cycle overwrites terminal output for all tasks when output is provided. This causes the command line information (the actual command that was run) to be lost for non-cached tasks because non-cached tasks stream their output via `appendTaskOutput`, which includes the command information. ## Expected Behavior For non-cached tasks (those with 'failure' or 'success' status), the output should be preserved from the streaming via `appendTaskOutput` which includes the complete command line that was executed. Only cached tasks should have their output overwritten by `printTaskTerminalOutput` since they don't go through the streaming path. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com> Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.com> (cherry picked from commit 72c47e7)
#33673) ## Current Behavior The `printTaskTerminalOutput` callback in the TUI summary life cycle overwrites terminal output for all tasks when output is provided. This causes the command line information (the actual command that was run) to be lost for non-cached tasks because non-cached tasks stream their output via `appendTaskOutput`, which includes the command information. ## Expected Behavior For non-cached tasks (those with 'failure' or 'success' status), the output should be preserved from the streaming via `appendTaskOutput` which includes the complete command line that was executed. Only cached tasks should have their output overwritten by `printTaskTerminalOutput` since they don't go through the streaming path. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com> Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.com> (cherry picked from commit 72c47e7)
#33673) ## Current Behavior The `printTaskTerminalOutput` callback in the TUI summary life cycle overwrites terminal output for all tasks when output is provided. This causes the command line information (the actual command that was run) to be lost for non-cached tasks because non-cached tasks stream their output via `appendTaskOutput`, which includes the command information. ## Expected Behavior For non-cached tasks (those with 'failure' or 'success' status), the output should be preserved from the streaming via `appendTaskOutput` which includes the complete command line that was executed. Only cached tasks should have their output overwritten by `printTaskTerminalOutput` since they don't go through the streaming path. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com> Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.com>
Current Behavior
The
printTaskTerminalOutputcallback in the TUI summary life cycle overwrites terminal output for all tasks when output is provided. This causes the command line information (the actual command that was run) to be lost for non-cached tasks because non-cached tasks stream their output viaappendTaskOutput, which includes the command information.Expected Behavior
For non-cached tasks (those with 'failure' or 'success' status), the output should be preserved from the streaming via
appendTaskOutputwhich includes the complete command line that was executed. Only cached tasks should have their output overwritten byprintTaskTerminalOutputsince they don't go through the streaming path.Related Issue(s)
🤖 Generated with Claude Code