deploy-verify-loop
Deploy-verify loop
A deploy that reports success isn't the same as a deploy that's actually healthy — a rollout can finish while a pod crash-loops, a health check flakes, or the new version 400s on a path the deploy step never exercised. This loop watches the window right after a deploy closes and turns "did it work?" into a checked answer instead of a hope.
Step 1 — Establish what "rolled out" means here
Before polling, confirm the concrete signal for this deploy target — it varies by platform:
- Kubernetes: every replica of the relevant Deployment(s)/StatefulSet(s) on the new image digest/tag,
Ready, noCrashLoopBackOff. - A PaaS/serverless platform: the release/deployment resource's own status field reaches its terminal "active"/"succeeded" state.
- A generic host: the running process's version endpoint (or build hash) matches what you just shipped.
Done when you can name the exact check that proves the rollout finished — not "give it a few minutes."
Step 2 — Poll with a bound, not indefinitely
Check the Step 1 signal on an interval matched to how fast this deploy actually rolls (a Kubernetes rollout finishes in seconds to minutes; a CDN/edge propagation can take longer — don't poll a slow system every few seconds). Set a hard timeout. If the timeout is reached before the signal clears, stop and report exactly what's still not ready — don't keep polling past the bound hoping it resolves.