Adds a configurable number of allowable Red samples (MAX_RED_SAMPLES, default of 20) before deciding the deployment has failed.
Background
It's desirable to fail if a deploy is Red. However, a deploy will sometimes go Red for some time before it ultimately goes Green. Without a grace period, as this PR introduces, deployment often yields false negatives.
Other changes
Increases the time between samples from 5 seconds to 10.
Moves a block of code which determines the current environment name to immediately before it's used.
Adds a log message recording the name of the old environment being deleted.
References
Partially restores the deletion in #22, which was (presumably) motivated by the desire to not fail entirely if the deploy only goes Red briefly.
Summary
Adds a configurable number of allowable
Red
samples (MAX_RED_SAMPLES
, default of 20) before deciding the deployment has failed.Background
It's desirable to fail if a deploy is
Red
. However, a deploy will sometimes goRed
for some time before it ultimately goesGreen
. Without a grace period, as this PR introduces, deployment often yields false negatives.Other changes
References
Red
briefly.