Repository navigation
feat(ci): the API launch gate — refuse a prod release that breaks the deployed contract (#658) - #1247
Merged
Merged
Conversation
… deployed contract (#658) er-server api-check compares two contract files with the shipped breaking_changes. The prod deploy copies that binary out of the release's own er-api image, compares the candidate with s3://er-prod-api-contract/ deployed/ under --strict, and refuses on a break (unless api_break_ok names a reason), on an unreadable baseline, and on a checker that cannot run; a missing baseline is first publication. After cutover it publishes releases/<sha>/ once and moves the deployed/ pointer. The decision logic is self-tested (14 cases, in make check and in the deploy job). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…efs (#658) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…#658) structured_logging.rs forbids eprintln! in er-server product code and allowlists, by exact count, the CI helpers whose stderr report is the product. api_check.rs joins er-openapi-check.rs there; the detection stays in openapi::breaking_changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…658) Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 26, 2026 01:21 — with
GitHub Actions
Inactive
This was referenced Nov 26, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #658
What
The API launch gate, enforced at the production deploy. The store it reads and writes landed in #1246 and is applied:
er-prod-api-contract-797781631727, pluser-ci-deploy-prod:api-contract.er-server api-check <base> <candidate> [--strict](api_check.rs): file-against-file, using the shippedopenapi::breaking_changes, the same detection the PR-time advisory runs. Exit 0 when compatible, 2 when breaking under--strict, and 64 when an input is unreadable or not JSON. An unreadable input is never "no changes".deploy.yml):er-serverout of the release's owner-apiimage by digest (api-launch-gate-binary.sh), because the deploy job has no Rust toolchain;openapi.public.jsonwithdeployed/openapi.public.jsonbefore the inactive colour exists;releases/<sha>/openapi.public.jsononce (If-None-Match: *; the bucket policy forbids deleting a release) and moves thedeployed/pointer andrelease.json.api-launch-gate.sh):workflow_dispatchinputapi_break_oknames a reason (a deliberate version change or a rollback), which is printed;NoSuchKey) is first publication.The ticket's checklist:
api-contractskill: query inputs, compositions and payload narrowing are not detected);Why
#658: the launch prerequisite for #1013. An external consumer's integration must not be broken by accident.
Proof
make check: 1,195 passed, 0 failed, with the newapi-launch-gate-checktarget. The gates caught one thing on the way:structured_logging.rsforbidseprintln!in er-server, so the verb's report moved to its ownapi_check.rs, allowlisted by exact count besideer-openapi-check.rs.actionlintandworkflow-shell-checkpass ondeploy.yml.api_check_passes_additive_and_refuses_breaking_or_unreadable(realbreaking_changesover the real public document):--strict;GoldenRecord.id→ 2;<html>AccessDenied</html>body, or a single argument → 64.api-launch-gate-test.sh, 14 cases, run inmake check(api-launch-gate-check) and in the deploy job before the gate: compatible passes; breaking is refused; breaking with a reason passes and prints it; NoSuchKey is first publication; AccessDenied is refused even if the checker would pass; checker exits 64 and 101 are refused; an empty candidate is refused; publish writes all three objects with the conditional put; a redeploy of a published sha keeps it; a failed write fails.api-launch-gate-test: "an unreadable baseline refuses"The first prod deploy after this merge is the live proof. It must log
no deployed contract yet; first publication, then publish. The next deploy compares against it. Both are recorded in the ledger.Risk & rollback
A prod deploy can now be refused, which is the point. A false refusal is overridden by re-running the deploy via
workflow_dispatchwithapi_break_ok. If the gate itself is broken,git revert <merge-sha>restores the ungated deploy. The store stays (prevent_destroy).Post-merge ledger
Closed by: agent · session
Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306onMac· 2026-11-26T01:56:34Zmainis green with this change on it: mergebae09b2e. Push runs: devcontainer 45735164149 success, infra 45735164156 success, frontend 45735164176 success, rust 45735164155 success, images 45735164179 success.images: built and succeeded forbae09b2e.deployconverged. Process proof was read once the AWS session was restored (2026-11-26). The live colour in dev (ci/web-api-green-5d5f9c8844-88dxb, logged"er-server listening"at 01:36:40Z) and prod (app/web-api-blue-7544598cbb-8rjth, at 01:51:39Z) both runer-api@sha256:5d993716…, built frombae09b2e, which contains this merge (git merge-base --is-ancestor bae09b2e bae09b2eholds). (Earlier note: the gate converged, the gate's own log, run 45736789375 attempt 2:api-launch-gate-test: 14 passed, 0 failed→checker is er-server from er-api@sha256:5d993716…→no deployed contract yet; first publication, no comparison→production now serves the contract of bae09b2e8e89f85ad2f86fc40430a549f3294126. Attempt 1 failed safely at fetching the checker (no ECR layer read; prod kept serving the prior release), was fixed forward by fix(infra): the prod deploy role may pull er-api layers for the launch gate (#1248) #1249 (#658 follow-up: er-ci-deploy-prod needs ECR layer read for the launch gate's checker #1248), and attempt 2 succeeded. The live pods'er-server listeningline could not be read: the AWS SSO session has been expired since 12:10Z. Tick afteraws sso login.)deployis green after the fix-forward.driftandkindwere already red on schedule before feat(api): typed response structs, batch 3 — reviews+merges (#1193) #1202.compatible with the deployed contract.api-contractskill names the gate as the blocking check and its decisions;api-contract.tfrecords why the role needs ECR layer read.Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files