Commit Graph

5 Commits

Author SHA1 Message Date
jonabe
d9bd02d952 fix(import): support custom issue types during import (#1322)
* fix(import): support custom issue types during import

Fixes regression from 7cf67153 where custom issue types (agent, molecule,
convoy, etc.) were rejected during import with "invalid issue type" error.

- Add validateFieldUpdateWithCustom() for both custom statuses and types
- Add validateIssueTypeWithCustom() for custom type validation
- Update queries.go UpdateIssue() to fetch and validate custom types
- Update transaction.go UpdateIssue() to fetch and validate custom types
- Add 15 test cases covering custom type validation scenarios

This aligns UpdateIssue() validation with the federation trust model used
by ValidateForImport().

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(test): add metadata.json and chdir to temp dir in direct mode tests

Fixes three test failures caused by commit e82f5136 which changed
ensureStoreActive() to use factory.NewFromConfig() instead of respecting
the global dbPath variable.

Root cause:
- Tests create issues in test.db and set dbPath = testDBPath
- ensureStoreActive() calls factory.NewFromConfig() which reads metadata.json
- Without metadata.json, it defaults to beads.db
- Opens empty beads.db instead of test.db with the seeded issues
- Additionally, FindBeadsDir() was finding the real .beads dir, not the test one

Fixes applied:
1. TestFallbackToDirectModeEnablesFlush: Add metadata.json pointing to test.db and chdir to temp dir
2. TestImportFromJSONLInlineAfterDaemonDisconnect: Same fix
3. TestIsBeadsPluginInstalledProjectLevel: Set temp HOME to avoid detecting plugin from real ~/.claude/settings.json

All three tests now pass.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-25 17:59:47 -08:00
beads/refinery
50a079d3b7 fix: repair test build failures in types and sqlite packages
- Add TypeRig constant to IssueType enum
- Add IsBuiltIn() method to IssueType for multi-repo hydration trust logic
- Fix parseCommaSeparated -> parseCommaSeparatedList function name in test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 22:00:32 -08:00
beads/crew/dave
b7358f17bf 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
2026-01-06 21:30:58 -08:00
Steve Yegge
a5ec5c6977 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>
2025-11-28 23:19:21 -08:00
Steve Yegge
b5db80c412 Refactor sqlite.go: Extract hash IDs, batch ops, validators (bd-90a5, bd-c796, bd-d9e0)
- Extract hash ID generation to hash_ids.go (bd-90a5)
  - generateHashID, getNextChildNumber, GetNextChildID
  - Reduced sqlite.go from 1880 to 1799 lines

- Extract batch operations to batch_ops.go (bd-c796)
  - validateBatchIssues, generateBatchIDs, bulkInsertIssues
  - bulkRecordEvents, bulkMarkDirty, CreateIssues
  - Reduced sqlite.go from 1799 to 1511 lines

- Extract validation functions to validators.go (bd-d9e0)
  - validatePriority, validateStatus, validateIssueType
  - validateTitle, validateEstimatedMinutes, validateFieldUpdate
  - Reduced sqlite.go from 1511 to 1447 lines

- Add comprehensive validator tests (bd-3b7f)
  - validators_test.go with full coverage

Total reduction: 2298 → 1447 lines (851 lines extracted, 37% reduction)

Part of epic bd-fc2d to modularize sqlite.go
All tests pass

Amp-Thread-ID: https://ampcode.com/threads/T-09c4383b-bc5c-455e-be24-02b4f9df7d78
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 19:55:48 -07:00