feat(types): add custom type support to beads config (bd-649s)
Add types.custom config key mirroring the status.custom pattern: - Add CustomTypeConfigKey constant and GetCustomTypes() to storage interface - Add IssueType.IsValidWithCustom() method for validation - Add ValidateWithCustom() to Issue for combined status/type validation - Update all validation call sites to use GetCustomTypes() - Rename parseCustomStatuses to parseCommaSeparated for reuse This enables Gas Town to register custom types like agent/role/rig/convoy without hardcoding them in beads core, supporting the type extraction epic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: beads/crew/dave Rig: beads Role: crew
This commit is contained in:
committed by
Steve Yegge
parent
3287340678
commit
b7358f17bf
@@ -11,14 +11,21 @@ import (
|
||||
)
|
||||
|
||||
// validateBatchIssues validates all issues in a batch and sets timestamps if not provided
|
||||
// Uses built-in statuses only for backward compatibility.
|
||||
// Uses built-in statuses and types only for backward compatibility.
|
||||
func validateBatchIssues(issues []*types.Issue) error {
|
||||
return validateBatchIssuesWithCustomStatuses(issues, nil)
|
||||
return validateBatchIssuesWithCustom(issues, nil, nil)
|
||||
}
|
||||
|
||||
// validateBatchIssuesWithCustomStatuses validates all issues in a batch,
|
||||
// allowing custom statuses in addition to built-in ones.
|
||||
// Deprecated: Use validateBatchIssuesWithCustom instead.
|
||||
func validateBatchIssuesWithCustomStatuses(issues []*types.Issue, customStatuses []string) error {
|
||||
return validateBatchIssuesWithCustom(issues, customStatuses, nil)
|
||||
}
|
||||
|
||||
// validateBatchIssuesWithCustom validates all issues in a batch,
|
||||
// allowing custom statuses and types in addition to built-in ones.
|
||||
func validateBatchIssuesWithCustom(issues []*types.Issue, customStatuses, customTypes []string) error {
|
||||
now := time.Now()
|
||||
for i, issue := range issues {
|
||||
if issue == nil {
|
||||
@@ -54,7 +61,7 @@ func validateBatchIssuesWithCustomStatuses(issues []*types.Issue, customStatuses
|
||||
issue.DeletedAt = &deletedAt
|
||||
}
|
||||
|
||||
if err := issue.ValidateWithCustomStatuses(customStatuses); err != nil {
|
||||
if err := issue.ValidateWithCustom(customStatuses, customTypes); err != nil {
|
||||
return fmt.Errorf("validation failed for issue %d: %w", i, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user