-
Notifications
You must be signed in to change notification settings - Fork 0
Ingegrate beads ticket tracking #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implement foundation for beads issue tracking integration: - Create pkg/beads/ package with BeadsClient interface - Add CLIClient implementation wrapping bd CLI - Add IsBeadsProject() and FindBeadsRoot() detection functions - Add BeadsConfig to pkg/config with enabled and cli_command fields - Add BeadsError type to pkg/errors following JiraError pattern - Add comprehensive unit tests for all new code This enables rig to detect beads-enabled projects and interact with the bd CLI for issue tracking operations. Part of epic rig-k6n: Integrate beads workflow tracking
Add TicketRouter to determine which ticket system owns an ID based on: - Ticket format (alphanumeric suffix = beads, numeric = JIRA) - Project context (.beads/ directory presence) - Config enablement flags Routing rules: 1. Beads takes precedence for alphanumeric IDs in beads projects 2. JIRA handles numeric-suffix IDs when enabled 3. Falls back to unknown when source cannot be determined Includes comprehensive table-driven tests for all routing scenarios. Part of epic rig-k6n: Integrate beads workflow tracking
Wire beads integration into the work command workflow: - Use TicketRouter to detect beads vs JIRA tickets - Fetch beads issue details for note integration - Auto-update beads status to in_progress on work start - Prefer beads info over JIRA when both available for notes - Follow same graceful degradation pattern as JIRA When rig work is run with a beads-style ticket in a beads project, it will now automatically transition the issue to in_progress. Part of epic rig-k6n: Integrate beads workflow tracking
Add pkg/errors/types_test.go with table-driven tests covering: - Error message formatting with/without IssueID - Error unwrapping and chain traversal - All BeadsError constructors - IsBeadsError type checking through wrapped errors - IsRetryable detection for BeadsError Tests follow existing patterns and ensure BeadsError integrates properly with cockroachdb/errors.As and errors.Is. Part of epic rig-k6n: Integrate beads workflow tracking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR integrates beads ticket tracking system into the rig workflow tool. Beads is a lightweight, file-based issue tracker that stores issues in .beads/beads.jsonl files. The integration adds detection, routing, and CLI interaction capabilities to distinguish between beads and JIRA tickets.
Changes:
- Added beads package with client, detection, and types modules for interacting with the bd CLI tool
- Implemented ticket routing logic to differentiate between beads and JIRA ticket formats
- Updated work command to support beads issue status updates and note integration
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/beads/types.go | Defines beads issue data structures and validation helpers |
| pkg/beads/types_test.go | Unit tests for beads type validation |
| pkg/beads/detection.go | Project detection logic for finding beads root directories |
| pkg/beads/detection_test.go | Tests for beads project detection and root finding |
| pkg/beads/client.go | Interface definition for beads client operations |
| pkg/beads/cli_client.go | CLI-based implementation wrapping the bd command |
| pkg/beads/cli_client_test.go | Tests for CLI client validation and command execution |
| pkg/workflow/router.go | Ticket routing logic to distinguish beads from JIRA tickets |
| pkg/workflow/router_test.go | Comprehensive tests for ticket routing behavior |
| pkg/errors/types.go | Added BeadsError type and helper functions |
| pkg/errors/types_test.go | Tests for BeadsError creation and error chain handling |
| pkg/config/config.go | Added BeadsConfig structure and defaults |
| cmd/work.go | Integrated beads status updates into the work command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Beads tickets have an alphanumeric suffix that contains at least one letter. | ||
| // Examples: rig-k6n, rig-abc123, proj-7xy | ||
| func IsBeadsTicket(ticketID string) bool { | ||
| if !looksLikeTicket(ticketID) { |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function looksLikeTicket is not defined in this file. It exists in pkg/workflow/merge.go but is a private (lowercase) function. This will cause a compilation error. Either move the helper functions (looksLikeTicket, isLetter, isDigit) to a shared location in the workflow package or duplicate them in this file.
|
|
||
| // Beads tickets have at least one letter in the suffix | ||
| for i := range len(suffix) { | ||
| if isLetter(suffix[i]) { |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function isLetter is not defined in this file. It exists in pkg/workflow/merge.go but is a private (lowercase) function. This will cause a compilation error.
| // JIRA tickets have a numeric-only suffix. | ||
| // Examples: PROJ-123, FRAAS-456, ABC-1 | ||
| func IsJiraTicket(ticketID string) bool { | ||
| if !looksLikeTicket(ticketID) { |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function looksLikeTicket is called here but not defined in this file, causing a compilation error.
|
|
||
| // JIRA tickets have only digits in the suffix | ||
| for i := range len(suffix) { | ||
| if !isDigit(suffix[i]) { |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function isDigit is not defined in this file. It exists in pkg/workflow/merge.go but is a private (lowercase) function. This will cause a compilation error.
No description provided.