16.1 · The flow from PR to prod
PR opened→
Lint + types + tests→
Build + sign→
Preview env→
Review→
Merge→
Canary→
Full rollout
16.2 · Branching strategies
| Model | Best for |
|---|---|
| Trunk-based | High velocity; short branches + feature flags. |
| GitHub Flow | Branch → PR → merge → deploy. |
| Git-flow | Heavy releases / regulated industries. |
| Stacked diffs | Small reviewable PRs that depend on each other (Graphite, Phabricator). |
16.3 · CI/CD tools (2026)
| Tool | Notes |
|---|---|
| GitHub Actions | Default for GitHub orgs. |
| GitLab CI | If you're on GitLab. |
| Buildkite | Self-hosted agents, fast, scriptable. |
| CircleCI | Reliable; orb ecosystem. |
| Dagger | Pipelines as code in real languages. |
| Earthly / Drone | Niche alternatives. |
16.4 · 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.
16.5 · Deploy strategies
| Strategy | How |
|---|---|
| Rolling | Replace pods one at a time. K8s default. |
| Blue / Green | Run new full set; flip LB. |
| Canary | 1–10% to new; observe; expand. |
| Progressive | Canary with auto-analysis on metrics (Flagger, Argo Rollouts). |
| Shadow | Mirror prod traffic to new version, no user impact. |
| Dark launch | Deploy code behind a flag; enable later. |
16.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.
16.7 · Testing pyramid (and what's above it now)
| Layer | Tools |
|---|---|
| Unit | Vitest / Jest / pytest / go test / cargo test / JUnit / xUnit. |
| Component | Testing Library, Storybook stories-as-tests. |
| Integration | Testcontainers (real DBs / brokers in Docker). |
| Contract | Pact, Spring Cloud Contract. |
| E2E | Playwright (default 2026), Cypress (legacy). |
| Visual regression | Chromatic, Percy, Argos. |
| Synthetic / RUM | Checkly, Datadog Synthetics + RUM, Sentry. |
| Load | k6, Gatling, Locust, JMeter. |
16.8 · Mutation, fuzz, contract, property testing
- Mutation testing (Stryker, PIT) — mutates code; if tests still pass, your tests are weak.
- Fuzz testing (libFuzzer, AFL++, Jazzer, go-fuzz) — auto-generates inputs to crash code.
- Property-based testing (Hypothesis, fast-check, QuickCheck) — define invariants; framework finds counterexamples.
- Contract testing (Pact) — pinned API expectations between services.
- Chaos engineering (Litmus, Chaos Mesh, Gremlin) — break things on purpose; verify resilience.
16.9 · Supply-chain security in CI
| Practice | What it gives you |
|---|---|
| SBOM (Syft, CycloneDX, SPDX) | Listing of components shipped; SOC 2 / EU CRA expect it. |
| SLSA levels | Maturity model for build provenance. |
| Sigstore / Cosign | Keyless signing of artefacts. |
| Dep scanning | Snyk, Dependabot, Renovate, OSV-Scanner. |
| Container scanning | Trivy, Grype. |
| Secrets scanning | gitleaks, trufflehog, push-protection. |
| OIDC federation | No long-lived cloud keys in CI. |
16.10 · DORA + SPACE — measuring the team
| DORA (delivery) | SPACE (developer experience) |
|---|---|
| Deploy frequency | Satisfaction & well-being |
| Lead time for change | Performance (outcomes) |
| Change failure rate | Activity (volume — careful) |
| MTTR | Communication & collaboration |
| Efficiency & flow |
16.11 · Self-check
Q1 · Best leading indicator of test quality?
Coverage %
Mutation score
Lines of test code
PR count