Repository navigation
Description
Goal
Make releases hard to break, easy to deploy, and cheap to operate for a very small team:
main merge ──► build once ──► release record
├─► dev — auto
├─► beta — auto: newest record → beta lane (real beta-channel users)
└─► prod — manual: deploy prod <release_id>
(GitHub environment gate, same digests)
We promote artifacts, not branches. Every merge to main builds service images once and writes an immutable release record. Beta serves that record to real beta users automatically; prod deploys the same digests behind a GitHub environment approval gate. Rollback is deploying an older release record through the same command.
Scope — read this first. This is v1: stateless release rings. It covers backend, backend-listen, pusher, llm-gateway, and agent-proxy. It does not make GPU-service changes (Parakeet, diarizer, VAD, NLLB) beta-safe — those keep their existing deploy paths and beta calls the same GPU endpoints prod uses today. #10057 is a blocking follow-up before this system can be said to protect the full transcription path.
Design revision (2026-07-20): this issue originally specified protected
beta/prodrelease branches, a nightly sync bot, a custom release coordinator, and a signed release-vector ledger. That design was reviewed and replaced with the lean model below — same safety goals, a fraction of the machinery. Durable principles live indocs/runbooks/release-process.md; this issue tracks sequencing and status.
Why
The transcription incident (run 29641667073) showed that "test in beta first" is unenforceable while prod deploys rebuild from source at deploy time and validation happens after mutation. The fix is immutable artifact promotion and native platform controls, not new branch topology or bespoke release machinery.
Prescriptions
- Build once, promote digests. Beta and prod deploy the exact same
repository@sha256:...; prod never rebuilds, re-resolves a branch, or deploys a mutable tag. NomainSHA deploys directly to prod; only a beta-soaked record is prod-eligible. - Promote artifacts, not branches. No
beta/prodbranches, no sync bots, no standing bot credentials. - Deploy and rollback are one command.
deploy <ring> <release_id>— rollback is the same command with an older ID, so it is exercised on every release and cannot rot. - Pin everything, deployably. Image digests, Secret Manager secret versions (never
latest), and rendered config stored as immutable objects. A record must be able to restore state, not merely verify it — hashes alone cannot restore anything. - Beta is a ring, not a lab. Real beta-channel users on shared production data stores, one release ahead of prod. Real traffic is the acceptance signal; synthetic checks stay cheap.
- Native controls over bespoke machinery. GitHub environment protection, Cloud Run no-traffic revisions + traffic shifting, Helm revisions, GCS versioned buckets with conditional writes.
- Never remove a deploy path before its replacement has shipped for real.
State model: three GCS object shapes (no service, no database)
// records/<release_id>.json — immutable, deployable inputs
{
"release_id": "2026-07-20.1",
"git_sha": "…",
"eligibility_run_id": "…",
"images": { "backend": "gcr.io/...@sha256:…", "pusher": "…" },
"helm_values": { "backend-listen": "gs://…/values/<id>/backend-listen.yaml#sha256:…" },
"run_config": { "backend": "gs://…/run/<id>/backend.yaml#sha256:…" },
"secret_versions": { "OPENAI_API_KEY": "projects/…/versions/42" },
"created_at": "…"
}rings/<ring>/active.json— current serving record, previous verified record, hold/quarantine flag. Written withifGenerationMatchcompare-and-swap; deploy serialization itself is a GitHub Actionsconcurrency: deploy-<ring>group.receipts/<ring>/<release_id>/<run>.json— append-only: what actually happened (Cloud Run revisions/traffic, Helm revisions, verification/restore results). Write-only audit trail — no reconciler gets built on top of it.
The record is the only input a prod-capable deploy accepts — no free-form SHA, branch, tag, image, or Helm revision.
Deploy flow (one workflow, with a reliable failure branch)
- Resolve the record; refuse anything else.
- Snapshot the ring's active serving state (receipt) before any mutation.
- Cloud Run: no-traffic revisions from recorded digests → smoke check → shift traffic.
- GKE: apply recorded digests + values, wait for rollout, verify (
deploy_status_report.py). - Deterministic failure before/immediately after the traffic switch → automatically restore the pre-mutation snapshot (Cloud Run: shift traffic back; GKE: one
helm rollbackattempt). If restoration also fails: writepartial_mutationwith the exact component diff, leave state visible, page. No recursive recovery. - A failed record is marked held in
active.jsonso beta auto-deploy does not retry the same bad candidate.
Later SLO degradation pages a human and offers one-command rollback — never automatic (flapping trap).
Compatibility (load-bearing: beta and prod share live data)
- Schema/data changes: expand → dual read/write → backfill → contract; never destructive in one release.
- Every concurrently serving record — current prod through newest beta (prod may lag by several records, not one) — must operate correctly against live data. Hold promotion when ring skew exceeds the supported window.
- Record + artifact retention ≥ rollback window (30 days); destructive cleanup only after the oldest retained record expires.
Promotion criteria (start; tighten by ratchet)
A record is prod-eligible after serving beta for the soak window (default: overnight) with no new Sentry crash groups, fallback/error rates in bounds, and a minimum exposure floor (active sessions, streamed minutes, routing samples) — a quiet night must not qualify a release. Operator-checked first, scripted later.
Implementation ladder (each step ships and is useful alone)
- 1a. Pin secret versions everywhere
latestappears (ExternalSecrets, Cloud Run secret refs). - 1b. Switch
gcp_backend.ymlimage references from short-SHA tags to digests. - 1c. Prod gate, fully paired: GitHub environment
prodwith required reviewers plus a prod-only OIDC identity bound to repo + environment, explicit workflow/ref guards, and CODEOWNERS + required checks on.github/workflows/. Environment approval alone is not a barrier — any future merged workflow could request the environment. - 2. Build-once + deployable release record (rendered values/config as immutable objects, not hashes) written on every
mainmerge; nothing consumes it yet. - 3. Unified
deploy <ring> <release_id>workflow with the failure branch above (snapshot → auto-restore →partial_mutation→ quarantine). First rollback drill = deploying yesterday's record to beta. Legacy build-at-deploy path deleted only after several real prod releases on the new path. - 4. Beta ring:
betalane inruntime_env.yaml+ Helm values, beta stateless services at beta endpoints, desktop/mobile beta builds pointed at them (desktop beta currently mixes dev backend hosts with prod data — fix here), auto-deploy of newest non-held record, soak criteria + exposure floor in the promotion script. - 5. Cleanup: remove remaining arbitrary-ref prod-capable paths one at a time; publish beta/promote/rollback/break-glass runbook; quarterly read-only audit of environment protections, workflow permissions, identities, record-bucket retention.
Explicitly out of scope / dropped / deferred
- GPU services → Investigate beta-ring strategy for GPU services (Parakeet, diarizer, VAD, NLLB) #10057 (blocking before claiming full transcription-path coverage).
- Protected
beta/prodrelease branches + nightly sync bot (replaced by records + environment gates). - Custom coordinator / signed ledger / state-machine service (replaced by the three GCS object shapes).
- Separate beta GCP project and beta data stores (beta users are real users on real data).
- Synthetic signed-client acceptance harness (real beta traffic is the signal).
- Mobile store rollout automation — stores are
roll_forward_only. macOS is alsoroll_forward_onlytoday:desktop_promote_prod.ymlis explicitly roll-forward-only and update feeds choose the newest release. Channel-pointer restore becomes a declared recovery class only after a tested pointer-rollback path lands. - Incremental builds (compose unchanged digests from the prior record): deferred until build time actually hurts; when done, keyed on a content hash of each component's full input tree — never path filters, which silently ship stale code in a monorepo with shared
utils/.
Non-goals
- Making
maina release branch again (precise form: nomainSHA deploys directly to prod; only a beta-soaked immutable record is prod-eligible). - Treating a successful unit/CI run as beta acceptance.
- Allowing a manual production deploy to rebuild from an arbitrary current SHA.
References
- Principles doc:
docs/runbooks/release-process.md(timeless; this issue owns status/sequencing) - Incident evidence: chore(backend): disable hosted Deepgram serving #9936, https://github.com/BasedHardware/omi/actions/runs/29641667073
- GPU-ring investigation: Investigate beta-ring strategy for GPU services (Parakeet, diarizer, VAD, NLLB) #10057
Activity
[-]ci(release): promote main → beta nightly and beta → prod manually via protected release branches[/-][+]ci(release): build once, promote immutable digests through beta ring to prod; rollback = deploy older release[/+][-]ci(release): build once, promote immutable digests through beta ring to prod; rollback = deploy older release[/-][+]ci(release): stateless release rings v1 — build once, promote digests beta → prod, rollback = deploy older record[/+]docs: adopt lean release engineering process (build-once, ring promot…
docs: adopt lean release engineering process (build-once, ring promot…
Git-on-my-level commentedon Jul 22, 2026
Design retired rather than built: .github/scripts/check_release_rings.py lists release_rings.yaml, release-record.yml, and deploy-release-ring.yml under OBSOLETE_RELEASE_RING_SOURCES, and #10237 'SCA-14: retire backend beta release ring' merged 2026-07-21. Current thinking lives in #10338 / #10339.