Trevor PaughSystems engineer
Trevor PaughProject Chronicles

Chronicles / The Factory

Twelve minutes to build, hours to merge

Design

With jobs running in parallel, building stopped being the slow part. Jobs waited 40 to 200 minutes at the merge, and many of them waited for a person to type the same command again.

A job built in about twelve minutes and then stood at the merge for forty minutes to more than three hours. A sibling would land between a job’s suite run and its own landing, which forced a new merge of main, a new wait for the lock and a new suite run.

Hold the lock to the end

A merging job now keeps the suite lock from the moment it merges main into its branch until its pull request has landed, so nothing of the same repo can land in between. A waiting job keeps its place in line for twelve hours, even if it parks and is approved again, and the merger keeps waiting on a busy lock instead of giving up after seven tries.

Less to do under the lock

The merge script now settles a version-line conflict by itself, and lands through moves of main that touched only job records. Repos with a build step no longer run the whole suite again when the tester passed it on the exact commit that merges; the merger runs only the build. That proof is tied to the one run that produced it.

Try again before asking

On one day seven jobs parked with nothing wrong in them: main had moved, the lock stayed busy, or the merger ran out of time. Four waited one to three hours for someone to approve them again. The factory now retries such a merge once itself. A conflict with main is named on the job’s card, and its resolution is started once, before anyone is asked.