fix(ci): update nix vendorHash and fix integration test compilation

- Update default.nix vendorHash to match current go.mod dependencies
- Fix NewSQLiteStorage calls to include required context.Context parameter
- Rename duplicate runCmd to runGitCmd in routing_integration_test.go

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-14 22:18:10 -08:00
parent 1e20d702f2
commit f83a8f5a38
3 changed files with 22 additions and 23 deletions

View File

@@ -9,7 +9,7 @@ pkgs.buildGoModule {
subPackages = [ "cmd/bd" ];
doCheck = false;
# Go module dependencies hash (computed via nix build)
vendorHash = "sha256-KRR6dXzsSw8OmEHGBEVDBOoIgfoZ2p0541T9ayjGHlI=";
vendorHash = "sha256-RJ8LMS2kdKvvkpsL7RcDnSyMfwsGKiMb/qpeLUvXZfA=";
# Git is required for tests
nativeBuildInputs = [ pkgs.git ];

View File

@@ -165,14 +165,14 @@ func TestLibraryIntegration(t *testing.T) {
defer os.RemoveAll(tmpDir)
dbPath := filepath.Join(tmpDir, "test.db")
store, err := beads.NewSQLiteStorage(dbPath)
ctx := context.Background()
store, err := beads.NewSQLiteStorage(ctx, dbPath)
if err != nil {
t.Fatalf("NewSQLiteStorage failed: %v", err)
}
defer store.Close()
// CRITICAL (bd-166): Set issue_prefix to prevent "database not initialized" errors
ctx := context.Background()
if err := store.SetConfig(ctx, "issue_prefix", "bd"); err != nil {
t.Fatalf("Failed to set issue_prefix: %v", err)
}
@@ -328,14 +328,13 @@ func TestBatchCreateIssues(t *testing.T) {
defer os.RemoveAll(tmpDir)
dbPath := filepath.Join(tmpDir, "test.db")
store, err := beads.NewSQLiteStorage(dbPath)
ctx := context.Background()
store, err := beads.NewSQLiteStorage(ctx, dbPath)
if err != nil {
t.Fatalf("NewSQLiteStorage failed: %v", err)
}
defer store.Close()
ctx := context.Background()
// CRITICAL (bd-166): Set issue_prefix to prevent "database not initialized" errors
if err := store.SetConfig(ctx, "issue_prefix", "bd"); err != nil {
t.Fatalf("Failed to set issue_prefix: %v", err)
@@ -404,14 +403,14 @@ func TestRoundTripIssue(t *testing.T) {
defer os.RemoveAll(tmpDir)
dbPath := filepath.Join(tmpDir, "test.db")
store, err := beads.NewSQLiteStorage(dbPath)
ctx := context.Background()
store, err := beads.NewSQLiteStorage(ctx, dbPath)
if err != nil {
t.Fatalf("NewSQLiteStorage failed: %v", err)
}
defer store.Close()
// CRITICAL (bd-166): Set issue_prefix to prevent "database not initialized" errors
ctx := context.Background()
if err := store.SetConfig(ctx, "issue_prefix", "bd"); err != nil {
t.Fatalf("Failed to set issue_prefix: %v", err)
}
@@ -492,7 +491,7 @@ func TestImportWithDeletedParent(t *testing.T) {
// Phase 2: Create fresh database and import only the child
// (simulating scenario where parent was deleted)
store, err := beads.NewSQLiteStorage(dbPath)
store, err := beads.NewSQLiteStorage(ctx, dbPath)
if err != nil {
t.Fatalf("NewSQLiteStorage failed: %v", err)
}

View File

@@ -30,9 +30,9 @@ func TestRoutingIntegration(t *testing.T) {
{
name: "maintainer detected by git config",
setupGit: func(t *testing.T, dir string) {
runCmd(t, dir, "git", "init")
runCmd(t, dir, "git", "config", "user.email", "maintainer@example.com")
runCmd(t, dir, "git", "config", "beads.role", "maintainer")
runGitCmd(t, dir, "git", "init")
runGitCmd(t, dir, "git", "config", "user.email", "maintainer@example.com")
runGitCmd(t, dir, "git", "config", "beads.role", "maintainer")
},
expectedRole: routing.Maintainer,
expectedTargetRepo: ".",
@@ -40,9 +40,9 @@ func TestRoutingIntegration(t *testing.T) {
{
name: "contributor detected by fork remote",
setupGit: func(t *testing.T, dir string) {
runCmd(t, dir, "git", "init")
runCmd(t, dir, "git", "remote", "add", "upstream", "https://github.com/original/repo.git")
runCmd(t, dir, "git", "remote", "add", "origin", "https://github.com/forker/repo.git")
runGitCmd(t, dir, "git", "init")
runGitCmd(t, dir, "git", "remote", "add", "upstream", "https://github.com/original/repo.git")
runGitCmd(t, dir, "git", "remote", "add", "origin", "https://github.com/forker/repo.git")
},
expectedRole: routing.Contributor,
expectedTargetRepo: "", // Will use default from config
@@ -50,8 +50,8 @@ func TestRoutingIntegration(t *testing.T) {
{
name: "maintainer with SSH remote",
setupGit: func(t *testing.T, dir string) {
runCmd(t, dir, "git", "init")
runCmd(t, dir, "git", "remote", "add", "origin", "git@github.com:owner/repo.git")
runGitCmd(t, dir, "git", "init")
runGitCmd(t, dir, "git", "remote", "add", "origin", "git@github.com:owner/repo.git")
},
expectedRole: routing.Maintainer, // SSH = maintainer
expectedTargetRepo: ".",
@@ -103,9 +103,9 @@ func TestRoutingWithExplicitOverride(t *testing.T) {
tmpDir := t.TempDir()
// Set up as contributor
runCmd(t, tmpDir, "git", "init")
runCmd(t, tmpDir, "git", "remote", "add", "upstream", "https://github.com/original/repo.git")
runCmd(t, tmpDir, "git", "remote", "add", "origin", "https://github.com/forker/repo.git")
runGitCmd(t, tmpDir, "git", "init")
runGitCmd(t, tmpDir, "git", "remote", "add", "upstream", "https://github.com/original/repo.git")
runGitCmd(t, tmpDir, "git", "remote", "add", "origin", "https://github.com/forker/repo.git")
role, err := routing.DetectUserRole(tmpDir)
if err != nil {
@@ -149,8 +149,8 @@ func TestMultiRepoEndToEnd(t *testing.T) {
defer store.Close()
// Set up as maintainer
runCmd(t, primaryDir, "git", "init")
runCmd(t, primaryDir, "git", "config", "beads.role", "maintainer")
runGitCmd(t, primaryDir, "git", "init")
runGitCmd(t, primaryDir, "git", "config", "beads.role", "maintainer")
// Configure multi-repo
planningDir := t.TempDir()
@@ -203,7 +203,7 @@ func TestMultiRepoEndToEnd(t *testing.T) {
}
// Helper to run git commands
func runCmd(t *testing.T, dir string, name string, args ...string) {
func runGitCmd(t *testing.T, dir string, name string, args ...string) {
t.Helper()
cmd := exec.Command(name, args...)
cmd.Dir = dir