refactor(infra): move ./infra's logic into scripts/lib/infra, like manage and setup #205

Merged
jfraeys merged 2 commits from jfraeys/refactor/infra-lib into main 2026-10-15 21:25:58 -04:00
Owner

Part of #204. ./infra was a 131-line script with the helpers, a 40-line embedded Python status report and the whole command table inline. Now it is a 38-line entry (usage header, ROOT/PATH setup, three sources, infra_dispatch) and the logic lives in scripts/lib/infra/: core.sh (run, usage), commands.sh (one dispatch_* function per command group, the same pattern as scripts/lib/manage/), status.sh and status.py (the status summary is a real Python file now instead of a heredoc). Behaviour is unchanged: same commands, same usage messages and exit codes, INFRA_PRINT_ONLY still works; test-infra-cli.sh passes unchanged and infra help, a usage error, a deploy dispatch and infra status were smoke-tested from the branch. scripts/CLAUDE.md documents the layout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ

Part of #204. `./infra` was a 131-line script with the helpers, a 40-line embedded Python status report and the whole command table inline. Now it is a 38-line entry (usage header, ROOT/PATH setup, three `source`s, `infra_dispatch`) and the logic lives in `scripts/lib/infra/`: `core.sh` (`run`, `usage`), `commands.sh` (one `dispatch_*` function per command group, the same pattern as `scripts/lib/manage/`), `status.sh` and `status.py` (the status summary is a real Python file now instead of a heredoc). Behaviour is unchanged: same commands, same usage messages and exit codes, `INFRA_PRINT_ONLY` still works; `test-infra-cli.sh` passes unchanged and `infra help`, a usage error, a deploy dispatch and `infra status` were smoke-tested from the branch. `scripts/CLAUDE.md` documents the layout. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
refactor(infra): move ./infra's logic into scripts/lib/infra (core, commands, status), like manage and setup
Some checks failed
Lint / lint (pull_request) Failing after 35s
Secret scan / scan (pull_request) Has started running
19df52be98
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
fix(infra): shebang on the new lib files, like the other scripts/lib modules (shellcheck SC2148)
All checks were successful
Lint / lint (pull_request) Successful in 2m16s
Secret scan / scan (pull_request) Successful in 15s
a2ddd4cff9
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!205
No description provided.