CI/CD without surprises: 7 checks before deploying
Reproducible deployments, rollback, migrations: a short checklist that changes everything.
A deployment that fails in production is expensive: downtime, complex rollback, loss of trust. Here are 7 checks to do before each deployment.
1. Tests: all tests pass (unit, integration, E2E). No tests ignored or skipped. If a test is flaky, fix it before deploying.
2. Migrations: database migrations are tested in staging with realistic data. Migration rollback tested and documented. Execution order verified.
3. Feature flags: new features are behind flags disabled by default. Progressive activation (10% → 50% → 100%) with monitoring at each step.
4. Monitoring: key metrics are monitored (latency, errors, throughput). Alerts configured before deployment. Dashboard accessible during deployment.
5. Alerting: critical alerts are tested (they trigger correctly). Escalation configured (who is notified, in what order). Runbook up to date.
6. Correlated logs: logs are structured with a unique trace ID. We can follow a request end-to-end. Logs accessible in less than 30 seconds.
7. Runbook: a runbook exists for this deployment (steps, rollback, contacts). Tested in staging. Accessible to the whole team. If there’s a problem, we know what to do.
These 7 checks take 15-30 minutes before each deployment, but avoid hours of debugging in production. Worth the investment.