Context & constraints
At Mercurie, production services handle customer payments, business wallets, virtual cards, orders, and KYC workflows on Google Cloud (Cloud Run, Cloud Spanner, Go, and Python).
Before standardizing release engineering, rebuilding artifacts per environment meant what passed verification in dev or staging was not guaranteed to be byte-for-byte identical to what reached customers — and recovering from a bad deploy required waiting for a fresh rebuild instead of an instant revert.
Architecture & release flow
I designed a gated, artifact-immutable release pipeline so one verified container digest moves all the way from dev verification to live customer traffic:
Reviewed PR ──► Build Once (Immutable Digest)
│
▼
Dev (no-traffic tagged revision)
│ integration & smoke checks
▼
Production Preview (same immutable revision, private URL)
│ human approval gate + live checks
▼
Public Promotion (shift 100% traffic to verified revision)
│
[if regression]
▼
One-Step Rollback (shift traffic back to prior revision in seconds)
Core design rules:
- Build once, promote by digest: Production never recompiles source code or pulls floating base-image tags during promotion.
- No-traffic verification first: Every candidate revision boots against real configuration on a private tagged URL before receiving a single customer request.
- Instant reversibility: Because the previous known-good revision stays warm and immutable in Cloud Run, rollback is a single traffic-routing command rather than a rebuild race during an incident.
Failure mode caught in production
While operating the pipeline under concurrent releases, I uncovered and fixed a race condition in promotion tag cleanup where overlapping tag updates could interfere with preview routing — hardening the promotion step so concurrent deploys remain deterministic.
Alongside release safety, I paired the pipeline with sandboxed AI triage agents that inspect logs and traces to open structured GitHub and Linear issues while enforcing a strict human-approval gate on every production change.
Outcomes
| Dimension | Before | After |
|---|---|---|
| Artifact parity | Rebuilt per environment | Byte-for-byte identical immutable revision |
| Production verification | Post-deploy discovery | Private preview URL before traffic shift |
| Rollback time | Rebuild + redeploy | One-step traffic shift (seconds) |
| AI triage safety | Manual log digging | Sandboxed read/triage with human approval gate |