fix(secrets): vault-pr commits pass the repo's hook; the deploy gate refuses an uncommitted vault #167
Loading…
Reference in a new issue
No description provided.
Delete branch "jfraeys/fix/vault-pr-hook-venv"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happened (2026-10-14):
./infra rotate forgejorotatedFORGEJO_METRICS_TOKEN, thenvault-pr.py's commit failed: its temporary worktree ran the repo's pre-commit hook, andcheck-secret-hygiene.pycrashed there because it needs the checkout's.venv(PyYAML), which a fresh worktree does not have (.venvis gitignored). As designed on failure, the rotated vault stayed in the checkout. The later./infra deploy --tags forgejo,prometheusread the working-tree vault and shipped it: production has a new metrics token (working: scrape up, no alerts) thatmaindoes not have.Fixes
vault-pr.pylinks the checkout's.venvinto its worktree before committing.test-vault-pr.shnow runs a real pre-commit hook that needs it; without the fix the test fails exactly like the real run (verified).promotion_verifyrefuses whensecrets/vault.sops.ymlin the working tree differs from the commit being deployed (deploys read the working-tree vault, so uncommitted secrets reached production without main). The refusal says how to fix it; the logged emergency bypass still applies.test-promotion.sh+2.Follow-up (separate): record the live vault on main with the fixed helper, close #161/#162 (never deployed).
Touches
scripts/lib/(staged path), so merging starts a staging run. Checked: test-vault-pr, test-promotion, test-approve-promotion, test-infra-cli.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ