The Green Build Log

A zero exit code is not proof

2026-05-28

The green

The merge finished without a word of complaint and returned a zero exit code. The deploy that followed also completed cleanly. By every signal the pipeline produced, a fix had been merged and shipped to production.

What was actually true

Nothing had been merged. The main line of the code was exactly where it had been before the merge ran, and the deploy dutifully shipped that unchanged code. The fix the release existed to deliver was still sitting on its branch, untouched. Production now carried a new deployment and the same old behavior, and every record of the release said it had shipped.

Why the check passed

The branch being merged existed only on the remote. The merge was handed the branch's short name, and the tool resolved that name against the local copy, where no such branch existed. With nothing to merge, it did nothing, and in that situation doing nothing is not an error. It exited zero.

The exit code was answering a narrow question: did the command fail? It had not. But the step that followed read the zero as an answer to a different question: did the merge happen? Those are not the same question, and only one of them was ever asked.

This pattern is common because exit codes are so convenient. Every step in a pipeline produces one, they compose cleanly, and a run of zeros feels like a run of proofs. It is not. A zero means the command did not report an error. It does not mean the command did the thing you called it for.

A surprising number of operations can finish successfully having changed nothing at all. A merge with nothing to merge. A copy whose source pattern matched no files. A filter that matched no rows. A migration that found no pending work because it was pointed at the wrong database. Each one is a clean exit, and each one is a silent no-op. The pipeline has no way to tell them apart from real work unless something looks at the result.

How it surfaced

After the deploy, a routine look at the live service compared what it was serving against what the fix should have produced. The live service was still returning placeholder text where the fix should have put real descriptions. That one look at the actual output caught it. Neither the merge output nor the deploy output had shown anything wrong, and both had been read.

The look that caught it existed for other reasons. It was a habit of checking the live service after any deploy, not a gate designed for this failure. Without that habit, the false "shipped" would have stood until a user noticed the old behavior and asked why.

The rule

Confirm that an operation changed what it was supposed to change, and never accept a clean exit as proof that it did.

What it changed

A merge is not treated as done until the main line is shown to have actually moved to include the intended change. A deploy is not treated as done until the live output is shown to reflect it. The operator checks the after-state of every step that matters, and a clean exit with no visible change is treated as a question to answer rather than as an answer.

Back to the log