bitops icon indicating copy to clipboard operation
bitops copied to clipboard

Preserve the exit-code for "fail-fast: false" mode

Open arm4b opened this issue 2 years ago • 5 comments

The fail-fast mode will exit with non-zero code immediately when there's an error in deployment. This is as intended.

However, currently, when the fail-fast mode is disabled and there's an error in deployment, BitOps will run until the end and exit with 0 return code like it was a success.

The expectation from the fail-fast: false mode is to run all the deployment steps, but defer the error code (if any) and bubble it up to the BitOps finish exit code. This way we exit with non-zero if some deployment in the middle of the pipeline was unsuccessful.

arm4b avatar Dec 08 '22 19:12 arm4b

My question here is; In a list of 4 services, if 2 fails with different codes, which would be reported?

Or is the intention to create a reportable object such as;

service:returncode

{
  "service1": "0",
  "service2": "2",
  "service3": "0",
  "service4": "3",
}

PhillypHenning avatar Dec 08 '22 19:12 PhillypHenning

For me, any non-zero works great, as long as we don't report "success" if there was an "error". Even 101, like we did here https://github.com/bitovi/bitops/blob/dab9410f793a56a37105f6232e11c6616432a3a8/scripts/plugins/utilities.py#L375

arm4b avatar Dec 08 '22 19:12 arm4b

So this is the type of error that I would recommend putting into the doc lookup under an entry like: multiple processing failures, code:101 (or w.e)

But yea I agree with this 👍

PhillypHenning avatar Dec 09 '22 14:12 PhillypHenning

This would be an insanely easy first-issue as well btw

PhillypHenning avatar Dec 09 '22 14:12 PhillypHenning

Let's add the respective tag then!

arm4b avatar Dec 09 '22 18:12 arm4b