chore(scripts): organize scripts/ by job: release, secrets, checks, ci, dev, migration #156
Loading…
Reference in a new issue
No description provided.
Delete branch "jfraeys/chore/scripts-layout"
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?
Stacked on #154 → #152. Until those merge, this PR's diff also shows their commits; merge them first. After they land this rebases cleanly (it only moves files and rewrites paths).
scripts/was flat: 30 scripts mixing production release commands, vault tools, read-only checks, CI helpers, a dev wrapper and one-off migration wizards. Now:release/./infra plan / approve / deploysecrets/./infra rotate / secrets / keyschecks/./infra check, CI, pre-commitci/dev/migration/lib/,tests/./infrakeeps the same commands: day-to-day use does not change.References updated (~270 in 60 files):
./infra's dispatch, workflows and.githooks/pre-commit, roles (defaults, CLAUDE.md, alert text), the secrets manifest'srotation:fields, runbooks, README, tests (including path-joined Python tests) and the scripts' calls to each other.CHANGELOG.mdanddocs/incidents.mdkeep the paths of their time. Each moved script now finds the repo root two levels up andlib/as../lib(34 lines in 26 scripts).scripts/CLAUDE.mddocuments the layout and where a new script goes..claude/settings.jsonhas no script paths.Checked:
bash -n/py_compileon every script; a repo-wide scan finds no reference to a script path that does not exist (the 3 hits are other repos' or containers' scripts); check-downloads, check-secret-hygiene, 39 unit tests, test-promotion, -rotation-lock, -project-key-isolation, -bitwarden-save, -vault-pr, -tofu-unlock, -infra-cli, -approve-promotion, -container-scan, ansible-lint and yamllint pass; the moved entry points run from outside the repo (usage paths, the manifest-only expiry report); the commit's own pre-commit hook ran fromscripts/checks/.test-alert-rulesandtest-alertmanager-configfail locally identically before and after (Docker/promtool on macOS); CI runs them. Staging (staging-validate.ymlcallsrelease/scripts) will exercise the deploy path once merged.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
scripts/approve-promotion.sh (./infra approve [PR]) checks, before anything is merged, what the deploy gate will check later: the PR is main -> prod, staging validated a commit, the PR's head is that commit or differs from it only in files staging does not exercise (the gate's PROMOTION_STAGED_RE, reused), CI on the head is green, and scripts/plan-prod.sh does not error. You then type the PR number ("<N> with changes" when the plan found changes); it merges with tea and confirms on the API that the merge took. Replaces merging in the Forgejo UI, where merges silently did not take (#129, #133, #134). Needs a terminal; reads no secret. test-approve-promotion.sh: 15 cases with a fake tea, a fake plan and a throwaway git repo for the ancestry rule; added to the lint workflow. Runbooks and README point step 4 at ./infra approve. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZf1ca12aaaf0d2667f8eb