tony-o / raku-fez

This project is for 'fez', raku's cool new shiny dist uploader & manager. If you're a module author you should definitely be using this sweet thang. ;;;;;;;;;;;;;; This project and the underlying infrastructure is supported out of my own pocket and through donations. If you'd like to donate please check here: https://www.patreon.com/oynot
Artistic License 2.0
20 stars 12 forks source link

fez upload none interactive should stop in case any errors or when expects a user input #75

Closed melezhik closed 1 year ago

melezhik commented 1 year ago

In CI scripts when fez upload is executed by a program not a human, I wish fez does not wait till a user's input ( when something goes wrong or additional user's input is required). I would rather want fez to stop immediately at this point, generates none zero exit code and provide with some helpful message in stderr.

Example:

Fez hangs in case there are some distro verification

$ fez upload
>>= Looking in "sdist/hV5uzNAg.tar.gz" for META6.json
=<< File "dist/lib/SparrowCI/Repo.rakumod" in tar not found in meta<provides>
>>= meta<resources> looks OK
=<< Error retrieving "S/PA/SPARROWCI - SUPER FUN AND FLEXIBLE CI SYSTEM WITH MANY PROGRAMMING LANGUAGES SUPPORT/index.json", unable to verify if version exists.
>>= SparrowCI - super fun and flexible CI system with many programming languages support:ver<0.0.2>:auth<zef:melezhik> could use some sprucing up
>>= Upload anyway (y/N)?

Here, if, say run with --none_interactive option I would like fez to give it up, generate none zero exit code and print into STDERR something like "File "dist/lib/SparrowCI/Repo.rakumod" in tar not found in meta"

Without such a proper error handling fez just hangs for a user confirmation and there is no way to handle this in CI scripts ...

tony-o commented 1 year ago

@melezhik can you verify this is fixed in v39?

melezhik commented 1 year ago

I will test soon and let you know!

melezhik commented 1 year ago

The first negative test succeeds - https://ci.sparrowhub.io/report/2488 , but let me test on more cases …

melezhik commented 1 year ago

positive test (with valid META6.json file , valid distribution and --unattended option ) also PASSES - https://ci.sparrowhub.io/report/2521

melezhik commented 1 year ago

documented the future option in my example pipeline - https://raku.land/zef:melezhik/SparrowCI-SandBox