Skip to content

fix(deploy): establish a canonical public-build deployment contract #9824

Closed

Description

@Git-on-my-level

Problem

We are repeatedly discovering configuration and deployment drift only after a rollout:

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:

Required outcome

Create one canonical deployment contract for the four browser-delivered services:

  • web/admin
  • web/app
  • web/frontend
  • web/personas-open-source

For every target and deploy environment, the contract must declare:

  1. the Dockerfile and deploy workflow;
  2. each required public build input and whether it is optional;
  3. the authoritative source and allowed scope for that input;
  4. the candidate acceptance command; and
  5. 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 -n only 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

  1. Inventory all current required public build inputs and resolve the existing personas gaps before enabling the gate.
  2. Move the four targets onto the shared contract and shared preflight.
  3. Remove superseded inline/duplicated public-build validation from individual workflows.
  4. 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.
  5. Demonstrate the candidate browser smoke against a non-production revision, then production candidate promotion.
  6. 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

  1. added a commit that references this issue on Jul 15, 2026
    3390ab1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions