Repository navigation
Description
Problem
We are repeatedly discovering configuration and deployment drift only after a rollout:
- Incident: admin.omi.me down Jul 15 — PR #9670 moved NEXT_PUBLIC build args to GitHub vars that were never created #9820: a valid
vars.NEXT_PUBLIC_*migration deployed empty browser configuration because the GitHub variables did not exist. - Prevent deployment secret sprawl with a classification ratchet and config migration #9663 / fix(deploy): classify secret and public setting boundaries #9670: a source-classification ratchet correctly rejected wrong secret/config sources, but deliberately did not prove that the required external configuration had been provisioned.
- fix(deploy): preflight pusher config references #9690 and fix(deploy): guard dev pusher config rollout #9691: deployment preflight was added to one pusher path and then found missing from the automatic path; duplicated workflow logic drifted.
- fix(dev): preflight runtime binding drift #9732 and fix(dev): smoke deployed Cloud Run URL #9745: the next fixes needed a read-only live runtime-binding preflight and a smoke against the actual deployed Cloud Run URL rather than an assumed hostname.
This is one failure class: checked-in deployment wiring, externally managed configuration, the built artifact, and traffic promotion are not enforced as a single contract.
Relevant work:
- fix(deploy): classify secret and public setting boundaries #9670
- fix(deploy): preflight pusher config references #9690
- fix(deploy): guard dev pusher config rollout #9691
- fix(dev): preflight runtime binding drift #9732
- fix(dev): smoke deployed Cloud Run URL #9745
- chore(admin): document and verify local development #9774
- Incident: admin.omi.me down Jul 15 — PR #9670 moved NEXT_PUBLIC build args to GitHub vars that were never created #9820
Required outcome
Create one canonical deployment contract for the four browser-delivered services:
web/adminweb/appweb/frontendweb/personas-open-source
For every target and deploy environment, the contract must declare:
- the Dockerfile and deploy workflow;
- each required public build input and whether it is optional;
- the authoritative source and allowed scope for that input;
- the candidate acceptance command; and
- the traffic-promotion rule.
The contract is the source of truth. Dockerfiles and workflows are implementations that must be checked against it.
Required enforcement
1. Deterministic repository check
Register a local + PR-CI check in make preflight that fails when the contract, Dockerfile ARG/environment wiring, or workflow build arguments disagree.
It must catch, at minimum:
- a required Docker build input not passed by its workflow;
- an undeclared or unclassified public build input;
- a workflow using a source or scope not allowed by the contract;
- a workflow/Dockerfile target not covered by the contract.
Use focused fixtures that prove the failures. Do not make this check call GitHub, GCP, Docker, or any other live service.
2. Read-only live configuration preflight
Add one shared preflight used by every deploy entry point for each target, including manual, push-triggered, and auto-deploy workflows.
Before an image is built or traffic can change, it must resolve the contract's required inputs for the target environment and fail closed if any are missing or empty. It must:
- inspect only the configuration metadata/value-presence required for this decision;
- emit variable names and scopes only, never values;
- distinguish a missing value from denied/unavailable metadata access;
- validate all applicable scopes and GitHub's effective precedence;
- run on deployment/config PRs and on a schedule as a drift detector, in addition to pre-deploy.
This is a live control-plane preflight, not a hermetic unit test. Provision it with the least read-only GitHub permission needed; do not use a write-capable deployment credential.
3. Artifact-level defense
Every target image must fail its own build when a contract-required public input is empty. This remains mandatory even when the workflow preflight passes, so an alternate workflow cannot silently bake empty browser configuration.
The failure message may name the missing input but must never reveal its value.
4. Candidate acceptance before production traffic
Production deploys must not immediately shift 100% traffic to a new revision.
Deploy a candidate with no production traffic, run the contract's browser-level acceptance smoke against that exact candidate revision, and promote only on success. The smoke must cover the client initialization path that failed in #9820; a server-only health endpoint is insufficient.
A failed candidate must preserve the last healthy revision.
Configuration ownership decision
Browser-delivered values are not secrets. The migration must eliminate their console-only ownership:
- Preferred: version required public build configuration in the repository, per environment, and build from that reviewed source.
- If a value cannot be versioned, manage its GitHub variable through reviewed IaC in the same change that introduces or migrates the reference.
A PR must never change a public-build source from an existing store to GitHub vars.* while relying on a human follow-up to create values in the console.
Explicit non-solutions
The following do not close this issue:
- adding another
test -nonly to one workflow; - adding a one-off service checker that does not cover all deploy entry points;
- extending the existing name-only source-classification ratchet without a live presence check;
- documenting a manual provisioning step;
- allowing a preflight to warn, continue, or use a fallback/default;
- relying on a successful image build, Cloud Run deployment, or server health check as proof that browser config is valid.
Migration and acceptance criteria
- Inventory all current required public build inputs and resolve the existing personas gaps before enabling the gate.
- Move the four targets onto the shared contract and shared preflight.
- Remove superseded inline/duplicated public-build validation from individual workflows.
- Add regression fixtures for Incident: admin.omi.me down Jul 15 — PR #9670 moved NEXT_PUBLIC build args to GitHub vars that were never created #9820's exact shape: a newly referenced, absent GitHub variable must fail before a deploy can build or route traffic.
- Demonstrate the candidate browser smoke against a non-production revision, then production candidate promotion.
- Update the deployment-setting documentation and PR guidance so future deployment changes cite this contract.
No follow-up issue is required to make the guard effective. If broader backend adoption is deferred, it may be tracked separately only after the four web targets meet every acceptance criterion above.
Activity
fix(deploy): gate public builds on browser candidates (#9831)