Are you accessing the CLI from the default port :4280 ?
[ ] No, I am using a different port number (--port) and accessing the CLI from that port
[x] Yes, I am accessing the CLI from port :4280
Describe the bug
When the StaticSitesClient fails with an unknown exception, the error is logged but the swa cli exits with a status of 0 indicating success. This is misleading and causes automated processes like CI runs to report success even though the deployment failed.
To Reproduce
Attempt to deploy a SWA using version 1.1.5 per #776. You will see the error An unknown exception has occurred printed, and then the program will exit 0.
Expected behavior
The swa cli should exit with a non-zero status code, indicating failure.
Screenshots
(Note that $? returns the exit code of the previous command)
Desktop (please complete the following information):
Either line 329 needs to set the exit parameter to true, or an else could be added to the if statement starting line 335 that handles the case when code is not zero. Without access to the source code of StaticSitesClient I don't feel comfortable opening a PR for this, as I can't confirm the expected behaviour of that binary blob.
Are you accessing the CLI from the default port
:4280
?--port
) and accessing the CLI from that port:4280
Describe the bug When the
StaticSitesClient
fails with an unknown exception, the error is logged but theswa
cli exits with a status of0
indicating success. This is misleading and causes automated processes like CI runs to report success even though the deployment failed.To Reproduce Attempt to deploy a SWA using version 1.1.5 per #776. You will see the error
An unknown exception has occurred
printed, and then the program will exit0
.Expected behavior The
swa
cli should exit with a non-zero status code, indicating failure.Screenshots (Note that
$?
returns the exit code of the previous command)Desktop (please complete the following information):
Additional context I believe this is the offending code block: https://github.com/Azure/static-web-apps-cli/blob/b2123b9c93b694593bf0a48288cd1fb28d481bc1/src/cli/commands/deploy/deploy.ts#L328-L339
Either line 329 needs to set the
exit
parameter totrue
, or anelse
could be added to theif
statement starting line 335 that handles the case whencode
is not zero. Without access to the source code ofStaticSitesClient
I don't feel comfortable opening a PR for this, as I can't confirm the expected behaviour of that binary blob.