Repository navigation
fix: align all pre-* hooks to FailFast — no exceptions - #1708
Conversation
…avior `wt hook pre-start` was grouped with other `pre-*` hooks using FailFast strategy, but `execute_pre_start_commands` (automatic execution during worktree creation) uses Warn. The docs explicitly say pre-start warns and continues on failure. This aligns the manual invocation. Closes #1703 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
can we do a full audit: there should be no "exceptions" etc given our new consolidated approach to pre vs post hooks is our code consistent with that? |
Full audit of hook failure strategies confirms the only inconsistency was pre-start using Warn while all other pre-* hooks use FailFast. Align pre-start with the symmetric pre (blocking, fail-fast) / post (background, warn) pattern established in the hook rationalization. Changes: - hook_commands.rs: merge PreStart back into the FailFast match arm - worktree/hooks.rs: execute_pre_start_commands uses FailFast - cli/mod.rs + docs: remove "(except pre-start)" exception text - tests: update snapshot and assertions for FailFast behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Done — full audit completed and pre-start aligned with all other pre-hooks. Audit results: The only inconsistency was
Changes in a9503ed:
Note: since pre-start runs after worktree creation (it was renamed from |
wt hook pre-start to match automatic behavior
worktrunk-bot
left a comment
There was a problem hiding this comment.
CI failure: test_post_create_failing_command in tests/integration_tests/post_start_commands.rs has a stale snapshot. This test also exercises a failing pre-start hook (via the deprecated post-create config key) but its snapshot wasn't updated alongside the one in user_hooks.rs.
The snapshot at tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap still expects success: true / exit_code: 0 with the old warn-and-continue output. It needs updating to match the new FailFast behavior (success: false, exit_code: 1, new error message).
The test comment on line 111 ("Should show warning but continue") also needs updating to reflect the new behavior.
Fix: run cargo insta test --accept -- --test integration test_post_create_failing_command and update the test comment.
Co-Authored-By: Claude <noreply@anthropic.com>
Summary
pre-startusingWarninstead ofFailFastpre-startwith the symmetricpre-(blocking, fail-fast) /post-(background, warn) pattern from feat!: rationalize hooks — rename post-create, add post-commit, background post-merge #1679pre-start, which warns and continues") from CLI help and docsexecute_pre_start_commandsandwt hook pre-startto both useFailFastTest plan
Closes #1703
🤖 Generated with Claude Code