Repository navigation
fix(pusher): bind the promotion contract to Pusher's runtime env slice, not every flag - #22924
Conversation
…e, not every flag Prod Pusher promotion 39433983369 (main 11f9737) failed with "qualification evidence contract does not match the current promotion contract". The dev qualification 39423577397 ran on 506592e; between the two, flag ruling #22831 edited backend/deploy/runtime_env{.yaml,/_base,/dev,/prod overlay}, which were hashed byte-for-byte into contract_sha256. Every flag ruling for any service therefore invalidated every dev qualification, and prod Pusher could promote only if dispatched before the next flag PR landed on main. The contract now hashes the promotion scripts and workflows as before, plus only environments.{dev,prod}.gke.pusher and the per-environment project/region scalars from the composed runtime_env.yaml. The receipt writer imports the verifier's contract_fingerprint so the two cannot drift apart. The prod selection step installs PyYAML before running the verifier. Tests: the recorder's qualification output passes the prod verifier; an unrelated listen/Cloud Run flag change keeps the projection; a dev or prod Pusher env change breaks it. Failure-Class: FC-promotion-gate-admits-on-recency-not-lineage Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ba581549b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| projection[name] = { | ||
| "pusher": gke["pusher"], | ||
| **{key: environment.get(key) for key in RUNTIME_ENV_SCALAR_KEYS}, | ||
| } |
There was a problem hiding this comment.
Include the shared ConfigMap in the Pusher projection
When environments.dev/prod.gke.config_map.entries changes after qualification, this projection—and therefore contract_sha256—remains unchanged, so an older qualification can still authorize production. Pusher consumes that map through envFrom in backend/charts/pusher/templates/deployment.yaml, and the production workflow recreates it from the current manifest before rollout, meaning the promoted process may run with runtime configuration that was never covered by the selected development qualification. Include the relevant gke.config_map contract in this projection while continuing to exclude other services' flags.
Useful? React with 👍 / 👎.
…tract Grok review on #22924: the prod job writes gke.config_map into prod-omi-backend-config before Helm and the Pusher pod envFroms it, so a ConfigMap entry change (e.g. a literal REDIS_DB_HOST) could ship under an old dev qualification. The projection now includes gke.config_map for dev and prod. Tests assert contract_fingerprint() itself (not the projection dict) and cover a ConfigMap change. Only an immutable digest is cached now, so callers cannot poison later fingerprints by mutating a returned projection. Failure-Class: FC-promotion-gate-admits-on-recency-not-lineage Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Prod Pusher promotion run 39433983369 (main
11f97372) failed withqualification evidence contract does not match the current promotion contract. The selected dev qualification, run 39423577397, ran on506592ee. Between those two commits only one contract input changed: flag ruling #22831 (11f97372) removedLIVE_SPEAKER_SPAN_RESOLUTIONfrombackend/deploy/runtime_env{.yaml,/_base.yaml,/dev.overlay.yaml,/prod.overlay.yaml}. Those four files were hashed byte-for-byte intocontract_sha256. As a result, any flag ruling for any service invalidated every dev qualification, and prod Pusher could promote only if it was dispatched before the next flag PR merged. Main receives several flag PRs a day, and dev Pusher was red from about 14:30 to 17:15 UTC on 10-20, so prod Pusher has not deployed since before #22839.What changed:
runtime_env.yaml, onlyenvironments.{dev,prod}.gke.pusher, the shared backend ConfigMapgke.config_map(the prod job writes it before Helm and the Pusher pod envFroms it), and the per-environment project and region scalars. A real Pusher env change still invalidates the evidence; another service's flag ruling no longer does. The prod workflow already re-validates the prod runtime env at the checked-out main before it publishes, and the Pusher image source closure is still diffed separately.pusher_release_receipt.py(the dev writer) importscontract_fingerprintfromverify_pusher_promotion_evidence.py(the prod checker). Before this change each file kept its own copy of the file list.pip install pyyamlbefore the verifier, because the projection parses YAML.Review
Grok review: no blockers. Both should-fixes are addressed in
f145eeb5:gke.config_mapis now hashed, and the tests assertcontract_fingerprint()itself, including a ConfigMap-change case. For the nit, only an immutable digest is cached now. Residual risks Grok noted, unchanged from before this PR: GitHub-var values forsource: environmentkeys were never hashed, andpip install pyyamlis unpinned (a parser change fails closed on hash mismatch).Lane / contract
Lane pusher-d0b (10-20 swarm P5 Part A); owner sign-offs for edits to other lanes' files: none
Product invariants affected
.github/workflows/gcp_backend_pusher.yml). The only workflow edit is apip install pyyamlline in the prod selection step.This change does not alter the Firebase/Firestore project or serving endpoints.
Verification
backend/test.shwithBACKEND_UNIT_TEST_FILE_LIST=test_verify_pusher_promotion_evidence.py,test_pusher_auto_deploy_paths.py,test_pusher_deployment_control_workflow.py: 63 passed, including the fast-unit CPU guard. Layer: unit.test_dev_qualification_recorder_output_satisfies_the_prod_promotion_contract: the qualification JSON fromrecord_qualification, which the dev workflow writes, passes the prodvalidate()with no errors.Rollback
Revert this PR. The old byte-for-byte contract comes back, and dev evidence recorded under the new fingerprint will then fail prod until dev re-qualifies.
Failure-Class: FC-promotion-gate-admits-on-recency-not-lineage
🤖 Generated with Claude Code