Repository navigation
SCA-3804: restore release-floor and live preflight controls for bound Backend deploys - #26569
Conversation
… Backend deploys Scoped revert of the two #26499 hunks that weakened controls for bound multi-revision Backend deploys: - The bound rollback path (restore-completed and the recover-run recovery route) now runs the published backend release floor over every revision in the admitted inverse before it moves traffic, and refuses the restore when any target is below the floor. - The live runtime-env validation and live Cloud Run env drift report run for bound multi-revision plans again instead of being skipped.
|
DESIGN: scoped revert of the two #26499 bound-deploy control regressions, at Decision record: Release's R26 ruling on SCA-3804 (2026-11-28T02:48Z) chose revert over fix-forward and named the two controls to restore. This PR implements exactly that; it adds no new deploy route and keeps the configured release hold. Controls restored:
Deliberately unchanged: split routing, candidate staging, receipt custody, and the capture-time |
Codex Review Summary: ✅ CompletedThis 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: 73c9a48618
ℹ️ 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".
| git fetch --no-tags --depth=1 \ | ||
| "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" \ | ||
| +refs/heads/main:refs/remotes/origin/main |
There was a problem hiding this comment.
Fetch complete history before checking recovery targets
In the recover-bound-split job, the checkout is shallow and this fetch retains only the main tip, so a previously deployed inverse revision's release SHA will normally be absent locally. verify_backend_release_floor.py requires both git cat-file -t <sha> and git merge-base --is-ancestor <floor> <sha> to succeed; consequently, even floor-qualified rollback revisions are rejected before traffic can be restored, leaving the failed promotion serving. Fetch complete history here, as the in-workflow restore already does. The local git fetch -h documents --unshallow as “convert to a complete repository”; a local depth-one reproduction confirmed that the current fetch leaves older target commits unavailable.
Useful? React with 👍 / 👎.
…t plans FIX-FIRST from the panel review at 73c9a48: - recover-bound-split deepens history with --unshallow before the floor check. A depth-1 checkout cannot resolve an eligible historical revision (git cat-file rejects it), so the recovery rollback would have refused every legitimate restore. - stage_split_image --verify --expected-state compares the candidate's inherited env and secret refs against the source's rendered state and refuses env-changing split plans before promotion, instead of leaving the live checks to fail after staging. Both live checks stay enabled. - --release-floor-check is required on restore-completed and recover-run, and the verifier's refusal reason is preserved. Regression tests cover the shallow-history reproduction, the required flag, the stderr reason and the env-change refusals.
|
FIX-FIRST repair pushed at Blocking — recovery history. The Major — env-changing split plans. Also: Local pre-push gate at this head: backend unit selection 648 passed / 0 failed (both changed test files included), backend typecheck passed, production-boundary check passed. CI is running; no local backend run beyond the push gate. |
What changed and why
Scoped revert of the two #26499 hunks that weakened controls for bound multi-revision Backend deploys, per Release's R26 ruling on SCA-3804 (2026-11-28T02:48Z), plus the repair of Luna's two FIX-FIRST findings on this PR.
cloud_run_split_canary.py restore-completedrunsverify_backend_release_floor.pyover every revision in the admitted inverse before it reads or replaces traffic; a below-floor target refuses the restore and leaves traffic untouched.--release-floor-checkis required on bothrestore-completedandrecover-run, and a refusal now carries the verifier's reason. Both rollback paths pass it: the in-workflow "Restore admitted inverse after a failed bound acceptance gate" step (after fetching currentmain, mirroring the non-bound snapshot restore) and therecover-bound-splitrecover-runjob.selected_split_binding != ''and the plan contained a split.FIX-FIRST repair in this head:
recover-bound-splitjob fetchedmainwith--depth=1, so the floor verifier could not resolve an eligible historical revision (git cat-filerejects a commit outside the shallow history). The step now deepens with--unshallowbefore the restore, the same pattern the non-bound snapshot restore already uses. A regression test builds a two-commit history and shows the verifier refuses the floor commit from a depth-1 clone and admits it after--unshallow.stage_split_image.py --verify --expected-statenow compares the candidate's inherited env (value and secret refs, release stamp excluded) againstrender_backend_runtime_env.py --state-outputand refuses withsplit_plan_changes_runtime_env:<keys>before promotion. Both live checks stay enabled for compatible plans.Not reverted: the split routing itself, candidate staging, receipt custody, and the capture-time exemption from
--expected-serving-revision(a single-admitted-serving precondition that cannot hold for a split and is not the rollback floor check).Product invariants affected
How it was verified
check-gcp-backend-production-boundary.pypasses, including the bound-restore rollback-coverage clause.restore_completedrefuses without reading or replacing traffic when the floor rejects a target;release_floorchecks every target, carries the verifier's stderr and fails closed; both CLI verbs reject a missing--release-floor-check.git cat-file;git fetch --unshallowmakes the same verifier admit it.require_inherited_envaccepts a matching plan and refuses value changes, added/removed keys, secret-version changes and a missing rendered state.Tests
backend/tests/unit/test_split_release_controls.pycovers the floor refusal, per-revision floor check, required CLI flag, recovery fetch depth/order and preflight exemption assertions.backend/tests/unit/test_stage_split_image.pycovers the env-changing plan guard.