Skip to content
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

--no-bail behavior inconsistent #8013

Open
2 of 4 tasks
c-vetter opened this issue Apr 25, 2024 · 0 comments
Open
2 of 4 tasks

--no-bail behavior inconsistent #8013

c-vetter opened this issue Apr 25, 2024 · 0 comments

Comments

@c-vetter
Copy link

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

9.0.6

Which area(s) of pnpm are affected? (leave empty if unsure)

CLI

Link to the code that reproduces this issue or a replay of the bug

https://github.com/c-vetter/repro_pnpm_inconsistent-nobail

Reproduction steps

In the repro, pnpm lint, then check the exit code.

Describe the Bug

--no-bail is listed on the website for --recursive, but not for plain run.

Based on #3036, --no-bail is currently specced to always exit 0, at least without --recursive. I don't have a monorepo to test right now, but if I read the tests correctly, with --recursive, --no-bail exits with a fixed code, with the symbol "ERR_PNPM_RECURSIVE_FAIL". That would mean that the behavior for pnpm run --recursive --no-bail is consistent with the website docs, while the behavior for pnpm run --no-bail is different.

#7381 is related. I have pretty much exactly the same use-case as @mizdra and am coming from npm-run-all as well. Based on the current behavior, I cannot switch although I would like to drop the dependency. I was thinking about adding this there, but it seemed more appropriate to open a new bug report.

#7381 could be interpreted as advocating a new parameter, in addition to --no-bail. While I don't think that is actually the case, I want to be clear. --no-bail should be fixed, there is no need for another parameter – that would just add confusion without benefit. For those users who don't care about the exit code, it's trivial to ignore it. But when the failure state matters, we cannot easily extract that without parsing the logs, which is just the wrong way to go.

Expected Behavior

When running with --no-bail, exit code should be 0 if all sub-runs exit 0, and non-0 otherwise. Irrespective of whether or not --recursive is active.

Which Node.js version are you using?

20.12.2

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant