Situation: Our team deploys weekly but leadership wants daily deployments without consuming our error budget or increasing incidents.
Task: As SRE lead I proposed a phased plan to shorten lead time and raise deployment frequency to daily while preserving SLOs.
Action:
Phase 0 — safety & baseline (2–4 weeks)
- Baseline metrics: current lead time, deployment frequency, MTTR, change-failure-rate (CFR), error-budget burn rate, test pass rates, and test flakiness.
- Hardening: add end-to-end observability (latency, errors, user-impact), structured release logs, and a runbook for automated rollback.
Phase 1 — pipeline improvements & test automation (4–6 weeks)
- Convert pipeline to fast, parallel CI stages: lint/compile → unit tests (parallel) → integration tests (parallel) → contract tests → canary deploy stage.
- Invest in test pyramid: ensure high unit coverage, reliable integration tests, and smaller, deterministic end-to-end tests; quarantine flaky tests and fix them or convert to integration tests.
- Shift-left: require PR-level test pass and pre-merge CI gating; run long-running tests on scheduled PR clusters.
Phase 2 — feature flags & progressive rollout (4–6 weeks)
- Adopt feature-flag framework for code toggles (server-side flags, kill-switch, targeting).
- Deploy code with flags off; enable gradually via percentage-based canaries (1% → 5% → 25% → 100%) and targeted cohorts.
- Implement automated health checks (SLO-based) during each step and automatic rollback if thresholds breach.
Phase 3 — SLO gating & automated guardrails (2–4 weeks)
- Implement SLO-gates in pipeline: before promoting from canary to wider rollout, validate key SLOs (latency P99, error rate) over a short window.
- Use error-budget policy: if error budget exhausted, pipeline blocks non-critical releases and triggers a remediation cadence.
- Automate rollback/kill-switch and tie alerts to incident response runbooks.
Phase 4 — org/process & culture (ongoing)
- Change release cadence policy: move from weekly big-bang to daily small releases with a defined cutover window and on-call coverage for the first 30–60 minutes of rollout.
- Create deployment champions: cross-functional guild to maintain flags, pipelines, and SLOs.
- Training: teach developers to design for observability, safe defaults for flags, and rollbacks.
- Blameless postmortems for every production-impacting change; publish learnings.
Metrics to track (daily/weekly dashboards)
- Deployment frequency (per service)
- Lead time for changes (commit → prod)
- Mean Time To Recover (MTTR)
- Change Failure Rate (CFR)
- Error-budget burn rate and remaining budget
- Canary success/failure rates and rollback counts
- Test suite times and flakiness rate
- % releases gated/blocked by SLO
Risk controls & trade-offs
- Start small: enable daily deploys for low-risk services first.
- Accept slightly higher pipeline complexity for faster feedback.
- Prioritize reducing test flakiness — false positives/negatives erode trust.
- Maintain manual override and emergency freeze capability.
Result (expected)
- Within 3 months: lead time reduced (aim: <1 day), deployment frequency increased to daily for pilot services, stable or reduced CFR, and controlled error-budget burn due to canaries and SLO-gating.
- Ongoing improvements to expand to full fleet as automation and culture mature.
This plan balances velocity and safety by combining faster CI/CD, reliable automated testing, feature flags and progressive rollouts, SLO-driven gates, and organizational changes to sustain daily deployments without exceeding error budgets.