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:
committed by
gastown/crew/dennis
parent
28a7f10955
commit
d3db8253ff
@@ -16,6 +16,7 @@ import (
|
|||||||
"github.com/steveyegge/beads/internal/routing"
|
"github.com/steveyegge/beads/internal/routing"
|
||||||
"github.com/steveyegge/beads/internal/rpc"
|
"github.com/steveyegge/beads/internal/rpc"
|
||||||
"github.com/steveyegge/beads/internal/storage"
|
"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/storage/sqlite"
|
||||||
"github.com/steveyegge/beads/internal/timeparsing"
|
"github.com/steveyegge/beads/internal/timeparsing"
|
||||||
"github.com/steveyegge/beads/internal/types"
|
"github.com/steveyegge/beads/internal/types"
|
||||||
@@ -353,10 +354,10 @@ var createCmd = &cobra.Command{
|
|||||||
FatalError("failed to initialize target repo: %v", err)
|
FatalError("failed to initialize target repo: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open new store for target repo
|
// Open new store for target repo using factory to respect backend config
|
||||||
targetDBPath := filepath.Join(targetBeadsDir, ".beads", "beads.db")
|
targetBeadsDirPath := filepath.Join(targetBeadsDir, ".beads")
|
||||||
var err error
|
var err error
|
||||||
targetStore, err = sqlite.New(rootCtx, targetDBPath)
|
targetStore, err = factory.NewFromConfig(rootCtx, targetBeadsDirPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
FatalError("failed to open target store: %v", err)
|
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)
|
FatalError("%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open storage for the target rig
|
// Open storage for the target rig using factory to respect backend config
|
||||||
targetDBPath := filepath.Join(targetBeadsDir, "beads.db")
|
targetStore, err := factory.NewFromConfig(ctx, targetBeadsDir)
|
||||||
targetStore, err := sqlite.New(ctx, targetDBPath)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
FatalError("failed to open rig %q database: %v", rigName, err)
|
FatalError("failed to open rig %q database: %v", rigName, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user