fix(storage): use factory for cross-repo routing to respect backend config

When routing issues to other repos (via contributor routing or --rig flag),
the code was hardcoding sqlite.New instead of using the storage factory.
This meant Dolt-configured repos would fail when receiving routed issues.

Changed two locations:
- Contributor routing (line 357): use factory.NewFromConfig
- createInRig --rig flag (line 789): use factory.NewFromConfig

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
mayor
2026-01-15 12:44:12 -08:00
committed by gastown/crew/dennis
parent 28a7f10955
commit d3db8253ff

View File

@@ -16,6 +16,7 @@ import (
"github.com/steveyegge/beads/internal/routing"
"github.com/steveyegge/beads/internal/rpc"
"github.com/steveyegge/beads/internal/storage"
"github.com/steveyegge/beads/internal/storage/factory"
"github.com/steveyegge/beads/internal/storage/sqlite"
"github.com/steveyegge/beads/internal/timeparsing"
"github.com/steveyegge/beads/internal/types"
@@ -353,10 +354,10 @@ var createCmd = &cobra.Command{
FatalError("failed to initialize target repo: %v", err)
}
// Open new store for target repo
targetDBPath := filepath.Join(targetBeadsDir, ".beads", "beads.db")
// Open new store for target repo using factory to respect backend config
targetBeadsDirPath := filepath.Join(targetBeadsDir, ".beads")
var err error
targetStore, err = sqlite.New(rootCtx, targetDBPath)
targetStore, err = factory.NewFromConfig(rootCtx, targetBeadsDirPath)
if err != nil {
FatalError("failed to open target store: %v", err)
}
@@ -785,9 +786,8 @@ func createInRig(cmd *cobra.Command, rigName, title, description, issueType stri
FatalError("%v", err)
}
// Open storage for the target rig
targetDBPath := filepath.Join(targetBeadsDir, "beads.db")
targetStore, err := sqlite.New(ctx, targetDBPath)
// Open storage for the target rig using factory to respect backend config
targetStore, err := factory.NewFromConfig(ctx, targetBeadsDir)
if err != nil {
FatalError("failed to open rig %q database: %v", rigName, err)
}