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

[Bug] CLI exits successfully with code 0 in the case of a fatal missing credentials failure #226

Open
jonaldinger opened this issue Jul 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jonaldinger
Copy link

Current Behavior

When an error is thrown for missing credentials, the error message is rendered but the process exits with code 0 indicating success.

My use case is to push translations via CI as part of our deployment process. The credentials in our CI environment variables got wiped at some point, and we never realized the translation pushes stopped happening because the job still "succeeds" even though it actually failed.

Expected Behavior

When a fatal error occurs, the process should exit with a non-zero exit code so that automated tooling (such as CI) can respond to the failure. My use case is specific to missing credentials in the push action, but there may be other scenarios that warrant this same outcome.

Steps to Reproduce

Call a CLI command such as push, without providing any credentials:

txjs-cli push src/

Observe the error message logged, but the command succeeding:

image

Possible Solution

Return a non-zero exit code for fatal errors.

Possible Implementation

https://github.com/transifex/transifex-javascript/blob/master/packages/cli/src/commands/push.js#L156

process.exit(1)
@jonaldinger jonaldinger added the bug Something isn't working label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant