How it works
The explanation, with examples you can run.
Why integrate so often
Two people changing the same code for three weeks will collide. The longer they wait, the bigger the collision, and the harder it is to tell whose change caused a failure. Merging daily turns one painful merge into many trivial ones. It also means the tests run against the code that will actually ship, not against a private copy of it.
DORA's research has found the same thing for years: teams that work in small batches on a short-lived trunk deliver more often and break production less. Speed and stability go together; they are not a trade-off.
What it takes
- One shared line. Branches live for hours or a day or two, not weeks. Pull requests are fine as long as they are small and merged quickly.
- A build anyone can run. One command builds and tests the project on a clean machine. If it only works on the build server, or only on one laptop, it is not trusted.
- Tests you believe. A red build has to mean a real problem. Flaky tests teach people to click "re-run" and ignore failures, which defeats the point.
- Fast feedback. Aim for checks that finish in about ten minutes. Slow suites push people towards bigger, less frequent merges.
- Fix main first. When main breaks, revert or fix within minutes. Nobody merges on top of a red build.
Unfinished work on main
The usual objection is "my feature isn't ready". You don't have to ship a feature to merge its code. Put new behaviour behind a feature flag, add a new code path next to the old one and switch over later (branch by abstraction), or build the backend before any UI uses it. The code is integrated and tested every day; users see it only when you turn it on.
Signs you are not really doing CI
- Pull requests that sit open for a week and touch dozens of files.
- A "merge day" or a code freeze before every release.
- People asking "is main green?" before starting work.
- Tests that pass on retry and nobody investigates.
Fixing these is mostly about batch size and discipline. A faster pipeline helps, and the next topic shows how to build one.
Check yourself
3 questions. Get them all right to finish this topic.
0 of 3 right so far. Get all three to finish this topic.