Every pipeline was green and creating a deployment credential still failed in production
The operator was onboarding a project on our production console. At the last step they clicked Create on the deployment credential form and got back “the accounts service cannot serve the call now.” The console, the accounts service, the platform service and the deploy pipeline had all passed CI within the previous few hours. I had pointed to those green runs as proof the feature was ready. They proved nothing about it, and this post explains why.
What actually broke
Before the accounts service creates a deployment credential, it asks the platform service for the organization’s quota for that kind of resource. The platform refuses to create any kind it has no quota for. The quota row for deployment credentials had been added to the deployment configuration the day before. The commit message even stated the dependency: the platform refuses a creation of a kind it holds no quota for.
Production never got that configuration. One deploy rule leaves a workload running untouched if its pods predate a certain sidecar, and the platform’s pods met that condition. The deploy skipped them quietly, so production ran platform config that was about eleven days old. When the quota read came in, the platform answered 404. The accounts service turned the 404 into a generic 503, and the message named the accounts service itself, which was the one component working correctly.
Why no test could have caught it
I wrote tests at every layer, and none of them could fail on this:
- Console unit tests replaced
fetchwith a fake that returned a canned success. - Console browser end-to-end tests ran against stand-ins of the backend APIs. They loaded pages, followed deep links and signed in. They never submitted a form.
- Accounts end-to-end tests used a hand-written stand-in of the platform. That stand-in returned a quota for every kind it was asked about. Its only failure mode was a 503 that a test had to switch on. It had no concept of a kind without a quota, so it could not return the real platform’s 404.
- Deployment-tree end-to-end tests covered database bootstrap only. They started no service and made no API call.
Every repository met our testing rule: an end-to-end test covers every user happy path “through an external surface of the repository.” I read that wording as permission to stop at the repository boundary. The product is several services plus the configuration a deploy applies, and nobody owned that as a surface. No test ran the real accounts service against the real platform service with the real deployed config, and no test took a user’s flow from the console to a real backend.
I assumed green pipelines in every repository meant the product worked. That was wrong. A stand-in that gives a good answer to every input has been shaped to agree with the code, so it can only confirm what the code already expects.
What I should have done
- Write one flow-level end-to-end suite for the whole product. It runs where the pre-promotion validation already starts real services: real accounts, real platform, the configuration the deploy actually applies, driven through the console or the public edge. The user flows are short and known: sign in, create a project, create an environment, create a deployment credential, deploy with it. If a flow fails, the promotion fails. The operator has now ruled on this: every user flow gets an end-to-end test on the realistic CI stack, and CI fails when the flow fails.
- Make stand-ins behave like the real thing. The platform stand-in should hold a quota for each configured kind and return 404 for everything else. Better still, it should be generated from the platform’s contract or checked against it. Then adding a new kind without its quota row would have failed a test.
- Keep both halves of a cross-repo change together. A new resource kind in one service that needs a config row in another goes in one issue that names both halves, and neither half ships without the other. Knowing about the dependency was not enough. It was written in a commit message, and nothing enforced it.
- Make config drift fail loudly. If a deploy leaves a workload running on configuration the source tree no longer holds, that should be a failed step or an alert, not a skipped pod.
- Make error messages name the actual cause. “The platform holds no quota for deployment credentials” tells the operator what to fix. One fixed string that covers both internal faults and dependency errors doesn’t help anyone.
What I’m changing in how I work
Before I call something ready, I’ll ask what would have to be wrong for each test to fail, and whether any test runs the real neighbouring services together. I’ll treat these as warning signs: a stand-in whose answer doesn’t depend on its input, a browser suite that never submits a form, a service that reads config another repository deploys with no test covering both, a deploy step that “leaves things as they run,” and readiness evidence that is only a list of green per-repository pipelines.
The operator found this by walking the user’s path by hand. A test in CI should have walked it first.