fix(config): remove duplicate declarations and fix test failures (#1160)

* fix(config): remove duplicate declarations between config.go and sync.go

Commit e82e15a8 created sync.go with typed constants (SyncMode,
ConflictStrategy, Sovereignty) but didn't remove the original untyped
constants from config.go that were added in 16f8c3d3. This caused
redeclaration errors preventing the project from building.

Changes:
- Remove duplicate SyncMode, ConflictStrategy, Sovereignty constants
  from config.go (keep typed versions in sync.go)
- Remove duplicate GetSyncMode, GetConflictStrategy, GetSovereignty
  functions from config.go (keep sync.go versions with warnings)
- Update SyncConfig, ConflictConfig, FederationConfig structs to use
  typed fields instead of string
- Add IsSyncModeValid, IsConflictStrategyValid, IsSovereigntyValid
  wrapper functions that use sync.go's validation maps
- Update cmd/bd/sync.go to use typed ConflictStrategy parameter
- Update tests to work with typed constants

* fix(dolt): handle Merge return values in concurrent test

* fix(test): add --repo flag to show_test.go to bypass auto-routing

The tests were failing because the create command was routing issues
to ~/.beads-planning instead of the test's temp directory. Adding
--repo . overrides auto-routing and creates issues in the test dir.
This commit is contained in:
Subhrajit Makur
2026-01-19 23:41:14 +05:30
committed by GitHub
parent 2cbf3a5497
commit 065ca3d6af
5 changed files with 50 additions and 152 deletions

View File

@@ -32,8 +32,9 @@ func TestShow_ExternalRef(t *testing.T) {
}
// Create issue with external ref
// Use --repo . to override auto-routing and create in the test directory
createCmd := exec.Command(tmpBin, "--no-daemon", "create", "External ref test", "-p", "1",
"--external-ref", "https://example.com/spec.md", "--json")
"--external-ref", "https://example.com/spec.md", "--json", "--repo", ".")
createCmd.Dir = tmpDir
createOut, err := createCmd.CombinedOutput()
if err != nil {
@@ -86,7 +87,8 @@ func TestShow_NoExternalRef(t *testing.T) {
}
// Create issue WITHOUT external ref
createCmd := exec.Command(tmpBin, "--no-daemon", "create", "No ref test", "-p", "1", "--json")
// Use --repo . to override auto-routing and create in the test directory
createCmd := exec.Command(tmpBin, "--no-daemon", "create", "No ref test", "-p", "1", "--json", "--repo", ".")
createCmd.Dir = tmpDir
createOut, err := createCmd.CombinedOutput()
if err != nil {