revert(ci): back out the GCP SA key ratchet, keep its setup-doc fix - #12183
Conversation
Reverts BasedHardware#11125. The ratchet shipped with two defects that compound, and the first hid the second (see BasedHardware#12182). It declared backend/agent-proxy/main.py and backend/agent-proxy/Dockerfile as trigger paths and neither exists. run_checks.py:187 existence-checks any trigger without glob magic and fails the whole manifest resolution when one is missing, before any check runs -- so this broke every consumer of the manifest, not the ratchet alone. BasedHardware#12181 touches three desktop Swift files and no backend, and lost Detect Desktop Swift Changes, Desktop Swift Build & Tests, Hygiene and PR Metadata Preflight to it. Making resolution succeed only moves the failure: the ratchet then runs for the first time and does not pass its own baseline, on pristine main, with 13 findings. Twelve are stale-shrink entries -- several for backend/agent-proxy/*, the same paths that do not exist. One is not: backend/database/google_credentials.py:service-account-json-env reports found 6 against a cap of 1, on a file main has not modified, so the cap was miscounted when written rather than something having regressed. --write-baseline never raises caps by design, so that one cannot be corrected with the tool; it needs either real key-path removal or a baseline edit under security review. Reverting costs nothing that currently works: the check has never executed, so no key path is being protected by it today. It can be re-landed with a baseline generated against this tree and backend/agent-proxy/** as the trigger. Deliberately kept: the Backend_Setup.mdx change, restored verbatim. It steers local setup to ADC instead of copying application_default_credentials.json into the repo as google-credentials.json. That improvement has no CI dependency, and reverting it would put the copy-a-key-into-the-repo instructions back. Failure-Class: none
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@undivisible five PRs are sitting with no approving review. Consolidating into one comment rather than pinging five threads. Thanks for the pass on #11864 earlier — that's why I'm asking you rather than adding to the queue elsewhere. Please look at this one first — it unblocks everything else#12183 — reverts #11125, which is mine and merged broken this morning. It declared two trigger paths that don't exist, and Underneath that, the ratchet has never passed its own baseline — 13 findings on clean Reverting costs nothing that works today: the check has never executed. The The other four
#10960 and #11183 both had a review that was later dismissed, so they've been sitting with nothing on them since. On #11804 specifically — worth knowing before you open it: @Git-on-my-level has written "no blocking technical issues found" across five passes, but those were issue comments rather than submitted reviews, so none of them count toward the approving-review gate. The only formal review on it is a I'm not asking anyone to rubber-stamp. #11804 has a real product question attached — unprompted speech-triggered responses — that's genuinely a human call and I'd rather have a "no" on it than more silence. #12183 and #12181 are the ones where I think the path is clear. #12183 has two long-running desktop compiles still in flight as I write this; nothing failing. |
Reverts #11125. Details and reproduction in #12182.
Why
The ratchet shipped with two defects that compound, and the first hides the second.
1. Dead trigger paths break manifest resolution for every PR. It declares
backend/agent-proxy/main.pyandbackend/agent-proxy/Dockerfile; neither exists.run_checks.py:187existence-checks any trigger without glob magic and fails the whole resolution when one is missing — before any check runs:So it breaks every consumer of the manifest, not the ratchet alone. #12181 touches three desktop Swift files and no backend, and lost
Detect Desktop Swift Changes,Desktop Swift Build & Tests,Hygiene, andPR Metadata Preflightto it.2. The ratchet has never passed its own baseline. Defect 1 masks this — the check cannot run, so nobody saw it fail. Fix the paths and it executes for the first time and fails on pristine
mainwith 13 findings. Twelve are stale-shrink (baseline allows N, tree has 0), several of them forbackend/agent-proxy/*— the same nonexistent paths, so the baseline was generated against a tree this repo does not have. One is not a shrink:That is the ratchet's real failure mode — new key paths — firing on a file
mainhas not modified. The cap was wrong when written rather than something having regressed since.This is why I am reverting rather than sending the one-line trigger-path fix: on its own it converts a broken-manifest error into a red credential check on every PR, which reads as a real security finding and is worse than the current state.
--write-baseline"never raises existing caps" and refuses to add keys or raise counts, sofound 6, allows 1cannot be corrected with the tool. It needs either removing the key paths fromgoogle_credentials.py(a real move toward ADC / Workload Identity, which is the ratchet's stated purpose) or a baseline edit under security review. Both belong to someone who owns that area.What this costs
Nothing that currently works. The check has never executed, so no key path is protected by it today. Reverting restores green immediately.
Re-landing
Straightforward once the baseline question is settled: generate the baseline against this tree, and use
backend/agent-proxy/**as the trigger —run_checks.py:187exempts globs from the existence check, so the surface stays covered if agent-proxy ever lands, without asserting it exists now. Happy to do that re-land.Deliberately kept
The
docs/doc/developer/backend/Backend_Setup.mdxchange is restored verbatim, not reverted. It replaces this:cp ~/.config/gcloud/application_default_credentials.json ./google-credentials.jsonwith ADC guidance and an explicit "do not copy a service-account JSON key into the repo". That improvement has no CI dependency and stands on its own; reverting it would put the copy-a-key-into-the-repo instructions back in the setup guide.
Verification
run_checks.py --lane ci --listresolves clean.grepforgcp_sa_key_ratchet/gcp-sa-key-ratchetacross the tree: 0 remaining references, so nothing dangles.Backend_Setup.mdxis byte-identical to its post-fix(ci): ratchet long-lived GCP SA key paths (#6800) #11125 state.Failure-Class: none