Sub topic 2
Feedback speed versus confidence
This chapter assumes you know the basic Git and pull request workflow, have used a CI system such as GitHub Actions, and know what linting, unit tests, and integration tests are. It covers the trade-off behind every placement decision in the chapters that follow.
The core trade-off
Every automated check answers one question: "Is this change safe?" A check can answer it quickly, or it can answer it with more certainty. It rarely does both.
- Feedback speed is the time between a developer pushing a commit and seeing a pass or fail result.
- Confidence is how strongly a passing result tells you the change works in the real system.
A linter finishes in seconds but says nothing about runtime behavior. An end-to-end suite that drives a deployed system may take an hour, but a pass tells you much more.
Why slow feedback costs more than the minutes
Slow checks cost more than the waiting time itself.
- Context switching. After a few minutes, developers start other work. A failure that arrives 40 minutes later forces them to reload the old task.
- Batching. If each run is expensive, people push larger changes less often. Larger changes are harder to review and harder to debug when they fail.
- Queueing. Runners are shared. Long jobs hold runners and delay everyone else's checks.
- Workarounds. When the pipeline feels slow, people merge without waiting, rerun until green, or ask to skip checks.
Why fast feedback costs something too
A pipeline that only runs fast checks gives quick answers, but they are shallow. Bugs that need a real database, a full deployment, or realistic load pass through unnoticed. These are called escapes: defects that reach main or production even though CI was green. Each escape costs debugging time, and often an incident.
Both sides on one chart
The chart below shows typical checks. Treat the numbers as illustrative. Your own durations will differ.
Moving right, run time rises and so does the share of real-world failures the check can catch. The cost of a failure also changes. A lint failure on a pull request is cheap to fix. An end-to-end failure at 02:00 has no author waiting on it, so someone has to find the cause later.
Spreading checks across stages
Because no single check is both fast and deep, a pipeline uses several stages. Each stage has a different tolerance for waiting.
| Stage | Who is waiting | Tolerable wait | What it should deliver |
|---|---|---|---|
| Pull request | The author, actively | Minutes | Fast, trustworthy signal on the change |
| Merge and `main` | The merge queue and the team | Tens of minutes | Confidence that the combined code works |
| Nightly | Nobody, until morning | Hours | Deep coverage that is too slow or costly earlier |
The later chapters decide which checks go in which row. For now, remember the idea: the more people wait on a stage, the faster it must be. The less often a stage runs, the more depth it can afford.
Two failure modes
Pipelines go wrong in two opposite ways.
- Too much on every pull request. Runs take 45 minutes, developers stop waiting, and flaky checks get rerun until they pass. The checks exist, but nobody trusts them.
- Too little before merge. Pull requests turn green in two minutes, but
mainbreaks often. The team stops trustingmainand stops deploying from it.
Both failures end in the same place: people ignore the signal. The goal is a pipeline whose red result reliably means "something is wrong".
A quick way to reason about it
When you consider a check, ask two questions:
- How long will someone wait for it at this stage?
- What failure does it catch that the faster checks before it would miss?
If a slow check catches little that earlier checks miss, move it later or drop it. If a fast stage lets real defects through, add depth at a later stage instead of slowing the first one.
Exercise
A team's pull request checks take 50 minutes. Developers often merge after the first few jobs pass and ignore the rest. The team has had no escapes to production. Which problem does this show, and what is the direction of the fix?
Show answer
This is the "too much on every pull request" failure mode. Slow feedback has made people stop waiting, so the slow checks no longer protect anything. The fix is to keep only fast, high-signal checks (lint, unit tests) on pull requests and move the slow ones to merge time or nightly, where they can run to completion without a person waiting.
Exercise
Name two costs of slow feedback that are not the waiting time itself.
Show answer
Any two of: context switching (the author has moved on when the failure arrives), batching (people push larger, riskier changes less often), queueing (long jobs hold shared runners), and workarounds (people skip or rerun checks until they pass).