fix(update): accept custom types from types.custom config (GH#hq-8hif1z)

The `bd update --type` command was rejecting custom types (like role, agent,
rig) even when configured via types.custom. The issue was that type validation
used IsValid() which only checks the 5 core types, ignoring custom types.

Changes:
- CLI (update.go): Use IsValidWithCustom() with types from config
- Storage (validators.go): Add validateIssueTypeWithCustom() function
- Storage (queries.go, transaction.go): Fetch and pass custom types

The error message now dynamically shows all valid types including custom ones.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jasper
2026-01-24 15:07:17 -08:00
committed by John Ogle
parent 1e329754a9
commit d8ec84c728
4 changed files with 69 additions and 30 deletions

View File

@@ -400,12 +400,11 @@ func (t *sqliteTxStorage) UpdateIssue(ctx context.Context, id string, updates ma
return fmt.Errorf("issue %s not found", id)
}
// Fetch custom statuses and types for validation
// Fetch custom statuses and types for validation (GH#hq-8hif1z)
customStatuses, err := t.GetCustomStatuses(ctx)
if err != nil {
return fmt.Errorf("failed to get custom statuses: %w", err)
}
customTypes, err := t.GetCustomTypes(ctx)
if err != nil {
return fmt.Errorf("failed to get custom types: %w", err)