refactor(hooks): split config and executor modules - #4087
Conversation
20528e1 to
4590065
Compare
|
Thanks — this is the split #4082 asks for, done cleanly: Where it stands: #4082 is on the v0.9.3 milestone, behind the v0.9.1 freeze and the active v0.9.2 lane, so there is runway — but the branch is stale in the one way that matters for a file move. Main's Path to land:
If you would rather not redo the move, say so — it is small enough to regenerate maintainer-side and land with your credit ( Generated by Claude Code |
Signed-off-by: cyq <15000851237@163.com>
4590065 to
6d38efd
Compare
|
Status update from the v0.9.2 maintainer pass, @cyq1017 — deferring to v0.9.3, with one concrete blocker. The refactor itself reads well: splitting hooks into config and executor modules is the right seam, and it is the kind of structural change that gets harder to land the longer it waits. The blocker is that Test (windows-latest) is red on this branch. That is not a formality — hooks touch process spawning, and Windows is where that path diverges most. It needs triage before the merge window rather than during it. If you can reproduce and fix the Windows failure, this becomes an easy merge. If you'd like, say so and I'll take a look at the failure specifically — I don't want a structural cleanup to rot because of one platform job. |
|
Thanks @cyq1017 — your contribution landed in
Closing this PR now that the code is on If you want to land more work and would prefer your future PRs merge cleanly without a harvest step, the |
Move data-only hook configuration into hooks/config.rs and process execution, timeout, and decision parsing into hooks/executor.rs while preserving crate::hooks re-exports. Closes Hmbown#4082. Harvested from PR Hmbown#4087 by @cyq1017 Co-authored-by: cyq1017 <61975706+cyq1017@users.noreply.github.com>
Problem
crates/tui/src/hooks.rsmixed hook config definitions with executor runtime behavior in one large module, which made hooks policy changes harder to review.Change
HooksConfigintohooks/config.rs.HookExecutor, subprocess execution, timeout handling, stdout parsing, payload helpers, and tests intohooks/executor.rs.crate::hooks::*API available through re-exports.Closes #4082.
Verification
cargo test -p codewhale-tui hooks:: --locked(65 passed)cargo fmt --all -- --checkcargo clippy -p codewhale-tui --bin codewhale-tui --locked -- -A clippy::collapsible_match -D warnings(the strict form is currently capped by an unrelated existing UI lint)git diff --checkhooks/config.rshas no subprocess imports; decision-JSON and timeout coverage remain unchanged.