Back to Field Notes
Log

After the sprint: one lockfile, honest end states and a snapshot first

One Thursday of cleanup after June's sprint: CI and the first tests, npm workspaces, the portal reading its types from the API contract, and major upgrades that wait for a fresh disaster-recovery snapshot before they start.

Covers
Written
Repositories
infinary.io, infinary_agent
Pull requests
2
Reading time
3 min
#control-plane#ci#testing#portal
Contents

What this week was

All of it happened on Thursday, July 2, in two pull requests that merged seconds apart: #42 in infinary.io (69 files) and #10 in infinary_agent, plus a deploy runbook committed later that morning. Both carried out a written plan whose first finding was that the June work had no tests and no CI. That part, and the two bugs it turned up, is told in the control plane note. This is the rest.

Stop the bleeding

  • The site stopped selling one unbuilt feature. Testing an update on a private copy of the customer’s site before applying it was advertised on the site, in the plan comparison, in a calculator tooltip, in the portal’s plan picker and in the control plane’s plan metadata. It didn’t exist. Every one of those places now says “coming soon”. Claims about automatic rollback, which did exist in the agent, were separated from it.
  • Two things Terraform may never destroy. The disk encryption key and the data disk now carry prevent_destroy = true, so a mistaken terraform destroy stops instead of taking the data with it.

Consolidation

  • One lockfile. The repository became npm workspaces: the site, the portal and the control plane install together. Vite is held at 7 across the tree, with the reason written down: Vite 8 broke the Cloudflare adapter.
  • Two 1,200-line files split. The control plane’s store and its server entry had each grown to about 1,200 lines in nine days. Both were split into focused modules and kept as thin composition roots, so nothing that imported them had to change.
  • The portal reads its types from the contract. Until now the portal had a hand-copied version of the control plane’s types, and they had drifted. It now imports them from the contract package, type-only, so the portal’s bundle came out byte-identical.
  • Accessibility at error severity. Biome’s full recommended accessibility rules now fail the build, from a baseline of zero errors. Getting there meant typing 46 buttons and associating 9 labels in the portal.

Launch gates

  • A snapshot before every major upgrade. With Backup and DR configured, a major upgrade is queued only after a fresh snapshot has completed. If the snapshot fails, the upgrade doesn’t start.
  • Polling that survives a restart. The control plane saves the handle of a long-running backup operation before it starts polling, and on boot it re-attaches to the operation or fails it loudly, rather than forgetting it.
  • A metric that can’t flatter an empty fleet. Every major upgrade now leaves a durable outcome record, and the admin overview reports the share that needed no human. Until real attempts exist the rate shows nothing rather than 100%.
  • A second major version. The golden image pipeline gained ERPNext 15, so the path from one major version to the next can actually be exercised.
  • Customers can see their backups. The instance page lists the organization’s backups. Restores stay a job for us, not a button.

The agent

Sidecar 0.7.4 got the agent repository’s first test suite and CI (ruff, mypy and pytest on every push), a release script, and a test that pins the agent’s two version numbers to each other, since they had been kept in step by hand. It also closed two hardening items the review had raised in how the sidecar builds shell commands and downloads its own updates.

What we’d tell someone else