Claude/review ticket refactor p tfgk - #6
Merged
Merged
Conversation
This commit implements the refactoring described in specs/ticket-refactor-ideas.md: ## Ticket Type Configuration - Add lib/ticket_types.sh module for configurable ticket states and transitions - Add defaults/ticket_types.json with default state machine configuration - Support custom ticket types, states, and transition hooks via JSON config - Fallback to hardcoded defaults when config/jq unavailable ## Hook Invocation from ticket_transition() - Move hook invocation from git post-receive hook to ticket_transition() - Support pre-transition hooks (can block transition) - Support post-transition hooks (run asynchronously after sync) - Add --no-hooks flag to skip hook invocation - Set WIGGUM_PREV_STATE, WIGGUM_NEW_STATE, WIGGUM_HOOK_PHASE env vars ## Bare Repo Hooks Removed - Remove pre-receive and post-receive hooks from bare repo (now no-op) - Validation now done in ticket_transition() using ticket_types - Main clone auto-sync handled by ticket_sync_push() ## Data Layer Invariants Enforced - Create proper CRUD API in ticket.sh with clear invariants - Only CRUD functions may access $TICKETS_DIR directly - All operations sync before read and push after write - Add _ticket_ensure_sync() for idempotent sync within operations - Update hooks.sh to use clone via read_ticket_content() ## Tests - Add tests/test_ticket_types.sh for ticket type configuration - Add tests/test_hooks_transition.sh for hook invocation from transition - Update tests/test_distributed.sh to verify no bare repo hooks 78/80 tests pass (2 pre-existing failures in tmux spawn tests)
- Remove --no-sync flag from ticket_transition (sync is mandatory) - Make frontmatter utils internal (_get_frontmatter_value, _set_frontmatter_value) - Add CRUD wrappers: get_ticket_field(), set_ticket_field() - Update pane.sh to use CRUD API instead of direct $TICKETS_DIR access - Fix shellcheck warning in hooks.sh (SC2155) - Update specs to document: - Pre/post transition hook model - Configurable state machine via ticket_types.json - Mandatory sync invariants - Fix test framework to disable GPG signing (prevents CI failures) All 80 tests pass.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.