You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
crates/tui/src/hooks.rs mixed hook config definitions with executor runtime behavior in one large module, which made hooks policy changes harder to review.
Change
Move hook events, conditions, hook definitions, and HooksConfig into hooks/config.rs.
Move HookExecutor, subprocess execution, timeout handling, stdout parsing, payload helpers, and tests into hooks/executor.rs.
Keep the existing root crate::hooks::* API available through re-exports.
Thanks — this is the split #4082 asks for, done cleanly: hooks/config.rs holds the event/matcher/HooksConfig types with no subprocess dependencies, hooks/executor.rs owns HookExecutor, spawn/wait/timeout, and stdout-decision parsing along with the 56 moved tests, and the nine-line hooks.rs shim keeps crate::hooks::* stable. The head also has a fully green matrix (ubuntu/macos/windows tests, lint, DCO) from July 16 — appreciated.
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 hooks.rs picked up three fixes on July 17-18 (ee8b6db process-tree containment, b8258fc observer EOF via closed pipe, 525ef8a Windows EOF regression test) and now sits at 3,018 lines versus 2,593 at the cut, so the move will conflict and a naive resolution could drop those fixes.
Path to land:
Regenerate the split on current main rather than doing conflict surgery — re-apply the same module boundaries so the new executor fixes end up inside hooks/executor.rs.
Re-run cargo fmt and cargo test -p codewhale-tui hooks::, and note in the body that the v0.9.3 refactor(hooks): split config types from HookExecutor #4082 acceptance criteria hold (config module free of subprocess imports; decision-JSON and timeout tests unchanged).
Mark the PR ready for review.
If you would rather not redo the move, say so — it is small enough to regenerate maintainer-side and land with your credit (Co-authored-by plus Harvested from PR #4087 by @cyq1017). Closing #4082 stays attached to your work either way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 -- --nocaptureRUSTFLAGS='-Dwarnings' cargo test -p codewhale-tui hooks:: --locked -- --nocapturecargo fmt --all -- --checkgit diff --check