-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(plugin-workspace-tools): properly report errors for all non-zero exit codes #6535
base: master
Are you sure you want to change the base?
Conversation
2173691
to
fab356d
Compare
// The order in which the exit codes will be processed is fairly | ||
// opaque, so better just return a generic "1" for determinism. | ||
if (finalExitCode === null) | ||
finalExitCode = typeof errorCode !== `undefined` ? 1 : finalExitCode; |
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.
we no longer need to set the finalExitCode
here bc the resulting error code will be set to 1 by report.exitCode()
since errors have been reported.
berry/packages/yarnpkg-core/sources/StreamReport.ts
Lines 267 to 269 in 80052a0
exitCode() { | |
return this.hasErrors() ? 1 : 0; | |
} |
one CI failure... looks like a flakey test? unable to diagnose https://github.com/yarnpkg/berry/actions/runs/11171437408/job/31056182006 possibly related to nodejs/node#51766 ? this unrelated recent CI run passes but logs this:
All tests are passing, but force closing the worker is failing |
fab356d
to
f563303
Compare
f563303
to
5cdc969
Compare
(rebased) |
@arcanis let me know if this PR requires any adjustments |
What's the problem this PR addresses?
yarn workspaces foreach [...]
does not clearly indicate that there was a failure, or for what workspace there were non-zero exit codes.Before: (just says "done", but exit code is 1)
After:
How did you fix it?
I used the
report.reportError
feature to report all the workspaces that had non-zero exit codes.The final exitCode is not changed in this PR.
Checklist
🙏 @arcanis thank you for yarn 🙏