C.W.K.
Stream
Lesson 05 of 12 · published

The Feedback Loop

~13 min · feedback, speed, loop

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Latency is the metric, not pass rate

Most teams optimize CI for the wrong number. They obsess over pass rate (how often is main green?). That matters, but it is downstream. The upstream metric is feedback latency: how long from I pushed a change to I know if it broke anything.

Why latency matters: a 90-minute CI run is not just slow. It is a context-switch tax. By the time it finishes, you have moved on to a different problem, started a different branch, or gone to lunch. When the failure lands, you have to re-load the mental model. The actual cost of a 90-minute run is closer to a half-day than to 90 minutes.

Tiered feedback

Real teams stack feedback at multiple speeds:

  1. Editor (seconds) — type errors, lint warnings, format issues. LSP + format-on-save catches most of them before you commit.
  2. Pre-commit hook (seconds) — fast checks that should never reach CI: lint, format, typo check.
  3. CI (minutes) — the main test suite. Aim for under 10 minutes for the bulk; under 2 minutes for the smoke subset.
  4. Pre-deploy (minutes) — integration tests, end-to-end checks, performance budgets.
  5. Post-deploy (minutes to hours) — smoke tests in production, error rate dashboards, user-facing observability.

The faster the tier, the cheaper the failure. CI's job is to push as much feedback as possible to the cheaper tiers.

Code

pre-commit hook config — fast feedback before push·yaml
# .pre-commit-config.yaml
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-large-files
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.7.0
    hooks:
      - id: ruff
        args: [--fix]
      - id: ruff-format

External links

Exercise

Time your most-recent CI run end-to-end. Now break it down: how much was checkout, how much was install, how much was actual test? At least one of those is probably the bottleneck. Pick one optimization (caching, parallelism, smaller smoke subset) and estimate the savings.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.