Create metric to track auto deploy environment states
Summary
Create a metric to track states of environments used for auto deploy deployments, i.e. gstg-cny, gstg-ref, gprd-cny, gstg, gprd.
The metric can have states like locked
, ready
, baking_time
, awaiting_promotion
. This was discussed in #19907 (comment 1773273653).
Proposal
This will require release-tools to model the environment states as a state machine, so that we can verify that a state change makes sense. For example, when a deployment is ongoing, an environment should not be moved to the awaiting_promotion
state. It can be moved to awaiting_promotion
only from the ready
state.
-
Create a state machine to model and validate state transitions. -
Create an auto_deploy_environment_state
metric. -
Create rake task for changing the state of the metric. -
Add CI jobs for changing the state of the metric at specific points in the deployment pipeline. -
Add CI job to release-tools to set environment state to locked
when deployment starts. -
Add CI job to set env state when baking time starts and completes. -
Add CI job to set env state when post deploy migrations starts and ends.
-
Edited by Reuben Pereira