rwnx / pynonymizer

A universal tool for translating sensitive production database dumps into anonymized copies.
https://pypi.org/project/pynonymizer/
MIT License
101 stars 38 forks source link

Missing inputs message should not return exit code "0" #157

Closed simonblake-mp closed 3 months ago

simonblake-mp commented 4 months ago

Describe the bug The pynonymizer "missing values for required arguments" help output exits with exit code "0". If you have a pipeline that monitors exit codes that worked fine with pynonymizer v1.25.0, but lacks the correct Inputs for v2.1.0/v2.2.0, the pipeline reports success while returning zero byte dumps.

To Reproduce run pynoymizer then echo $? will return '0'

Expected behavior If pynonymizer does not get the inputs it needs to operate, then it should throw a non-zero exit code.

Additional context While this manifested because I pulled the latest pynonymizer blindly into my CI pipeline, it's not really about the change from v1 to v2 - it's not a plea for backwards compatibility, it's more about being noisier when backwards compatibility has been dropped.

rwnx commented 4 months ago

Thanks for this report, it's definitely a bug. This change is not intentional.

I'm running these fixes into a patch release: v2.2.1, which will release before the end of next week.

rwnx commented 3 months ago

Fixed, errors should now return the right error codes. please check v2.2.1!