Twenty-six pull requests merged across three repositories, one of them a Field Notes log. Most of the day went into one thing: the path from a paid signup to a new customer’s own ERPNext site, in its own Google Cloud project, with no one at a keyboard. At midday it was a written plan. By midnight its code was merged, nearly all of it deployed, and it had made eight real attempts at building one site, all for a test account of our own. Signups aren’t open, and no customer has used it.
- PRs merged, besides Field Notes
- 25
- real build attempts, all one test site
- 8
- fixes from the live test
- 6
- real-Frappe checks, 9 failing before the fix
- 27 / 27
A crash only real Frappe could show
During a build, the site’s owner gets a System Manager user and an email with a link to set their password, good for 72 hours (infinary.io PR #332). That code had tests, and they passed. They mocked Frappe.
Before running it for real, we stood up a local stack from the unmodified golden image, with Frappe 16.53.0, a fake hub that keeps the control plane’s pairing rules, and the build script’s own Python lifted out and run against it (infinary.io PR #336). It checks 27 things: that the link sets a password and works once, that a 71-hour-old link still works and a 73-hour-old one doesn’t, that pairing refuses a wrong or reused code, and so on. On main, 9 of them failed.
The fix calls _reset_password and falls back to the old name where an older Frappe has it (infinary.io PR #335). With it, 27 of 27 pass. It reached the build worker before the first real build ran, so no real site was ever built without it. The check isn’t part of CI for every PR, because it needs the golden image built from private repositories and a running stack. Its README says to run it whenever the build’s Frappe calls or the image’s Frappe version change.
Eight attempts at one site
The pipeline went in as a planned series of small PRs, each approved before it started:
- A1: a factory that creates each site’s project under a folder we hold (PR #326).
- A2: separate ids for a site, its project and its host; plan sizes; one region; and a guard that keeps live mode to an allowlist (PR #327). DNS that fails closed and never takes over an existing name (PR #328). Instance Terraform for the new projects (PR #329). And the provisioner, as a Cloud Run job per build rather than a long-running queue worker (PR #330).
- A3: the build starts on the approved image (PR #331), creates the owner (PR #332), and pairs the site with Infinary AI (PR #333).
- A4: build alerts and a watchdog (PR #334), a Retry button for staff (PR #337), and teardown (PR #338).
Each was tested with fakes and mocked providers. Then live mode went on, for our own test account only, and we bought a plan with a Stripe test card.
The first thing to break came before any build: the payment didn’t count. A Checkout subscription is created incomplete and turns active in a later event, and Stripe doesn’t promise the order. Our webhook stored each event’s own copy of the status and mapped incomplete to none, so the paid account stayed unpaid. The handler now re-reads the subscription from Stripe on each subscription and invoice event, and an event for a replaced subscription can’t undo the current one (infinary.io PR #340).
Then every build attempt stopped somewhere new:
- Attempt 1 stopped at the key ring. Cloud KMS was on in the new site’s project, but a service account’s API calls are counted against its own project unless the call names another, and our Terraform can’t name the site’s project while it’s creating it. The factory now turns on the four APIs the worker’s calls are counted against, found by auditing every call (PR #341).
- Attempts 2 to 5 couldn’t join the group that may pull our approved images. gcloud said there was no such group. We switched to the group’s id over the Cloud Identity REST API, which keeps retries safe because “already a member” counts as success (PR #342).
- Attempt 6 got Google’s real error. Naming a project to bill for quota, which both the REST header and gcloud’s
--billing-projectflag do, needs a permission on that project, and the worker didn’t have it. gcloud’s “no such group” had been the same refusal, reworded. One narrow grant fixed it (PR #343). - Attempt 7 got through the infrastructure, the group and DNS, then sat for exactly five minutes. The first
gcloud compute scpfound no SSH key and asked whether to create one. The child process’s input was still open, so the question waited until our five-minute timeout killed it. Every ssh and scp now runs with--quietand closed input, so a question fails at once, and the worker makes its key up front, with a short expiry so keys don’t pile up (PR #344). - Attempt 8 looked for the VM in the wrong project. The ssh flags named a zone but no project, so gcloud used the worker’s own. The code had always had that gap; no build had got far enough to hit it. Every ssh and scp now names the site’s project, and an empty one is refused (PR #345).
That last fix merged just before midnight. The ninth attempt is the next log’s story.
Also
- One CI path. infinary.io’s GitHub Actions workflows are gone; Cloud Build is now the only build and CI path, and it already ran every check the old workflow did. A script replaces the portal deploy workflow, and the GitHub trust in our cloud setup was removed (infinary.io PR #324).
- Frappe’s built-in MCP server stays off. Frappe 16.53 turns it on by default on new sites. The build now switches it off right after the site is created, and only if nobody has set it either way (infinary.io PR #325). infinary_controls 0.22.4 does the same on install and migrate (infinary_controls PR #71). Merged; the 0.22.4 tag waits for the next release.
- Upstream release. The nightly golden build passed for ERPNext 16.52.1 and Frappe 16.53.0 (infinary.io PR #290), and our own site, erp.infinary.io, moved to it the same morning.
- Kremio Connect 0.10.0 prepared. The release PR for the method tools, off by default, is merged but not tagged, so 0.10.0 isn’t released yet (kremio-connect PR #39).
- The owner’s email can actually send. The build job had no key for our mail provider, so the set-password email would never have left. It does now (infinary.io PR #339).