Fix bd migrate loop: skip prefix validation during auto-import
When auto-importing issues from JSONL, issues with different prefixes (e.g., gt-1 vs gastown-) would fail validation and cause an infinite loop of failed migrations. The fix adds SkipPrefixValidation option to CreateIssuesWithFullOptions which propagates through EnsureIDs to skip prefix validation for issues that already have IDs during import. This allows importing issues with any prefix while still validating new issues created interactively. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -620,7 +620,11 @@ if len(newIssues) > 0 {
|
||||
}
|
||||
}
|
||||
if len(batchForDepth) > 0 {
|
||||
if err := sqliteStore.CreateIssuesWithOptions(ctx, batchForDepth, "import", opts.OrphanHandling); err != nil {
|
||||
batchOpts := sqlite.BatchCreateOptions{
|
||||
OrphanHandling: opts.OrphanHandling,
|
||||
SkipPrefixValidation: opts.SkipPrefixValidation,
|
||||
}
|
||||
if err := sqliteStore.CreateIssuesWithFullOptions(ctx, batchForDepth, "import", batchOpts); err != nil {
|
||||
return fmt.Errorf("error creating depth-%d issues: %w", depth, err)
|
||||
}
|
||||
result.Created += len(batchForDepth)
|
||||
|
||||
Reference in New Issue
Block a user