fermyon / spin

Spin is the open source developer tool for building and running serverless applications powered by WebAssembly.
https://developer.fermyon.com/spin
Apache License 2.0
5.05k stars 242 forks source link

flag to fail deployment if apps readiness check timeout without success #1366

Open rajatjindal opened 1 year ago

rajatjindal commented 1 year ago

it seems there is a bug right now on trying to update app on Fermyon Cloud. I am adding a test for it and it also seems like spin cloud deploy would exit with code 0 even if readiness check timeouts.

what do you think about adding a flag to spin cloud deploy, which will make the spin command exit with error code if readiness is not established. it will be useful in CI/CD scenarios as well.

vdice commented 1 year ago

I definitely see the value for sending some sort of signal to the user that the app readiness check failed. A non-zero exit code is one way, an error message another. The former would probably be the friendliest to automation.

itowlson commented 1 year ago

We already have a message if the app doesn't come ready. Some nastiness with exit codes (from a previous look at an unrelated issue):

  1. The default way of setting a non-zero exit code is to return Err(...) from main which always prints "Error: ..." _even if it's really only a heads up
  2. The override way of setting a non-zero exit code is to do your own implementation of std::process::Termination, and this could have knock-on impacts to other parts of the codebase (because we return the same type from all the commands), so might turn out to be more work than expected

These are not a blocker to doing an exit code, but just for awareness.