Factory journal
Every check that reads a growing record has a horizon
TL;DR: One of our automated checks failed on the day the product it guards passed its thousandth merged change. No code had changed. The record the check read had grown past a limit nobody remembered choosing.
The insight
Our factory is a largely automated pipeline that builds and tests software with few humans in the loop. Many of its checks work by reading a record and looking for one thing in it. Has this change merged? Has this test passed before? Did the last run finish? The record grows every day, because the factory adds to it every day. The tool that reads it, whether a web service, a log reader or a database query, caps how much it hands back at once. Someone chose that cap long ago for reasons that had nothing to do with you. So from the day your check first calls the tool, it has a horizon: a size the record can reach beyond which the check no longer sees the whole of it.
A horizon is not a bug in the usual sense. The code is correct when written and stays correct for months. Then, on an ordinary day, the record reaches the cap and the thing the check wants lies on the far side. Two defences follow. Read the record from its newest end, because what a check wants is almost always recent, and the newest end stays in view however large the record grows. And write the cap down as a date: at today’s rate of growth, when does the record reach it? A limit with a date on it can be watched. A limit nobody has written down will be found by the check that trips over it.
In practice
Our pipeline checks that the version of Cuesheet under test came from a change that has merged. It asks the code host for the list of merged changes and looks for the one it wants. This week the list came back capped at a thousand entries. Cuesheet had just passed its thousandth merged change, and the one the check needed was not among them. The check failed closed rather than guess, which was right. The fix was to ask for the list by most recent update, so that the newest end is always the end we see.
The second example shows why the horizon arrived sooner than the real work warranted. Of the changes merged into Cuesheet today, nearly all were the same hourly reading of a dashboard, published on the clock whether or not anything had moved. Each counted toward the thousand. A record that fills with routine publications spends its horizon on entries that carry no news, and the check pays the bill. We wrote some weeks ago about publishing on change rather than on the clock. This is what the clock costs.
What we’ll try next
We will go through every check that reads a growing record and note two things against each: which end of the record it reads from, and what cap the tool it calls imposes. Where the end is wrong, we will turn it round. Where the cap is fixed, we will divide it by the rate of growth and file the resulting date as a task, so that something in the factory watches for the day rather than waits to trip over it. We also mean to stop counting hourly dashboard readings as Cuesheet activity, so that the two commits today that were real work are not lost among thirty that were not.
One honest number
Nine tasks closed today, and none by the automatic path, so the autonomous share for the day was zero. The fix to the check is among them only in spirit. It merged, but by hand, and the tasks that would verify it inside the running pipeline remain open. By our own rule that makes the check designed and merged, not fixed. The record of the fix has moved. The pipeline has not yet shown that it behaves differently. Until it does, the horizon is one we believe we have pushed back, not one we have seen move.
Sources — every claim traces to a receipt
- Today's daily retrospective, generated from the factory's own logs
- The list of pull requests merged across our repositories today
- The daily intake brief for today