13.1 · The full flow from PR to prod
PR opened→
Lint + types + tests→
Build + sign→
Deploy preview→
Review→
Merge to main→
Canary deploy→
Full rollout
13.2 · Branching strategies
| Model | Best for |
|---|---|
| Trunk-based | Default for high-velocity teams. Short-lived branches, feature flags hide unfinished work. |
| Git-flow | Heavy releases, regulated industries. Slow and ceremony-heavy. |
| GitHub Flow | Branch → PR → merge → deploy. Simple. |
| Stacked diffs (Graphite, Phabricator) | Reviewable small PRs that depend on each other. |
13.3 · CI/CD tools (2026)
| Tool | Notes |
|---|---|
| GitHub Actions | Default for GitHub orgs; huge marketplace. |
| GitLab CI | If you're already on GitLab; tight integration. |
| Buildkite | Self-hosted agents, fast, scriptable. |
| CircleCI | Reliable; orb ecosystem. |
| Dagger | Pipelines as code in real languages (TS, Python, Go); reproducible locally. |
| Drone / Earthly | Niche but powerful alternatives. |
13.4 · The canonical pipeline stages
- Static: format, lint, type-check, secret scan, dep audit.
- Test: unit, integration, contract.
- Build: container image, SBOM, sign.
- Preview: per-PR ephemeral environment.
- Approve: human gate on prod.
- Deploy: progressive (canary → 25% → 100%).
- Verify: synthetic checks, SLO probes.
- Rollback: one-button revert; always tested.
13.5 · Deploy strategies
| Strategy | How |
|---|---|
| Rolling | Replace pods one at a time. Default in K8s. |
| Blue / Green | Run new full set; flip LB. |
| Canary | Route 1–10% to new; observe; expand. |
| Progressive (Argo Rollouts, Flagger) | Canary with auto-analysis (metrics gate). |
| Shadow | Mirror prod traffic to new version, no user impact. |
| Dark launch | Deploy code behind a flag, enable later. |
13.6 · Feature flags
- Decouple deploy from release.
- Use for: gradual rollouts, A/B tests, kill switches, customer-tier gating.
- Tools: LaunchDarkly, Statsig, GrowthBook, Unleash, Flagsmith, ConfigCat.
- Clean up dead flags or your codebase rots.
13.7 · Secrets in CI & runtime
- Never commit secrets. Pre-commit hooks (gitleaks, trufflehog).
- Use OIDC federation to clouds — no long-lived AWS keys in CI.
- Runtime: External Secrets Operator + Vault / SSM / Secret Manager.
- Rotate; audit access; alert on retrieval anomalies.
13.8 · Supply-chain security
| Practice | What it gives you |
|---|---|
| SBOM (Syft, CycloneDX, SPDX) | List of components shipped; required for SOC 2 and EU CRA. |
| SLSA levels | Maturity model for build provenance. |
| Sigstore / Cosign | Sign artefacts; verify in admission control. |
| Dep scanning (Snyk, Dependabot, Renovate) | Patches before exploit. |
| Container scanning (Trivy, Grype) | Image CVEs at every build. |
13.9 · DORA — the four numbers
| Metric | Definition | Elite target |
|---|---|---|
| Deployment frequency | How often production deploys happen. | On-demand (multiple per day). |
| Lead time for change | Commit → in production. | < 1 day. |
| Change failure rate | % of deploys requiring rollback / hotfix. | 0–15%. |
| MTTR | Mean time to restore after an incident. | < 1 hour. |
Pair DORA with SPACE (Satisfaction, Performance, Activity, Communication, Efficiency) for a human view — DORA alone misses morale and friction.
13.10 · Self-check
Q1 · Best way to decouple deploy from release for risky features?
Long-lived feature branch
Feature flag
Manual SSH deploy
A single quarterly release