feat(bd-1pj6): Add custom status states via config
Users can now define custom status states for multi-step pipelines using: bd config set status.custom "awaiting_review,awaiting_testing,awaiting_docs" Changes: - Add Status.IsValidWithCustom() method for custom status validation - Add Issue.ValidateWithCustomStatuses() method - Add GetCustomStatuses() method to storage interface - Update CreateIssue/UpdateIssue to support custom statuses - Add comprehensive tests for custom status functionality - Update config command help text with custom status documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1087,6 +1087,34 @@ func (m *MemoryStorage) GetAllConfig(ctx context.Context) (map[string]string, er
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// GetCustomStatuses retrieves the list of custom status states from config.
|
||||
func (m *MemoryStorage) GetCustomStatuses(ctx context.Context) ([]string, error) {
|
||||
value, err := m.GetConfig(ctx, "status.custom")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if value == "" {
|
||||
return nil, nil
|
||||
}
|
||||
return parseCustomStatuses(value), nil
|
||||
}
|
||||
|
||||
// parseCustomStatuses splits a comma-separated string into a slice of trimmed status names.
|
||||
func parseCustomStatuses(value string) []string {
|
||||
if value == "" {
|
||||
return nil
|
||||
}
|
||||
parts := strings.Split(value, ",")
|
||||
result := make([]string, 0, len(parts))
|
||||
for _, p := range parts {
|
||||
trimmed := strings.TrimSpace(p)
|
||||
if trimmed != "" {
|
||||
result = append(result, trimmed)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// Metadata
|
||||
func (m *MemoryStorage) SetMetadata(ctx context.Context, key, value string) error {
|
||||
m.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user