fix(core): suppress git stderr output in parseGitOutput - #33645
Conversation
The parseGitOutput function was missing `stdio: 'pipe'` option, causing git error messages to be printed directly to stderr. This caused CI pipelines with strict error checking to fail even when nx commands succeeded. Fixes #33330
|
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 542a229
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Nx Cloud has identified a possible root cause for your failed CI:
Our test failures are unrelated to the stderr suppression changes. The e2e test failed due to an npm registry issue ("get-proto is not in the npm registry"), and the workspace test failed on Nuxt file generation. Neither failure involves the modified git output parsing code, and the npm registry issue requires external service recovery.
No code changes were suggested for this issue.
🎓 Learn more about Self-Healing CI on nx.dev
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |

Current Behavior
Since Nx 21.6.1, running
nx graphor other commands that calculate affected projects prints git errors to stderr when the default branch is not fetched:This causes CI pipelines with strict stderr checking to fail, even though the nx commands succeed.
Expected Behavior
Git error messages should not be printed to stderr. The errors are already caught and handled gracefully - they just shouldn't be visible to the user.
Related Issue(s)
Fixes #33330
Solution
Added
stdio: 'pipe'to theexecSynccall inparseGitOutput(). This suppresses stderr output while still allowing the command to throw on failure (which is already caught by the try-catch ingraph.ts).This matches the pattern used in
getMergeBase()which already usesstdio: 'pipe'.