Skip to content

fix: rebind selected workspace before db command startup#3230

Open
julianknutsen wants to merge 5 commits intomainfrom
fix/rebind-command-context
Open

fix: rebind selected workspace before db command startup#3230
julianknutsen wants to merge 5 commits intomainfrom
fix/rebind-command-context

Conversation

@julianknutsen
Copy link
Copy Markdown
Collaborator

Summary

  • rebind db-targeted commands to the selected workspace before migration, store open, and dolt/server setup
  • keep no-store commands consistent with explicit --db and selector env precedence
  • add regression coverage for target config/env rebinding, no-db command behavior, dolt target selection, init guard mode detection, and external BEADS_DIR config isolation

Root cause

bd resolved the target workspace for DB commands too late. Global config and ambient caller state could leak into commands targeting another workspace, which let dolt server mode, auto-start settings, and config values come from the caller repo instead of the selected repo.

Testing

  • go test ./cmd/bd -count=1
  • make test
  • golangci-lint run ./cmd/bd/... ./internal/config/...

Notes

  • I ran this through repeated review/fix passes locally and addressed the blocker/major findings that surfaced during review.

@julianknutsen
Copy link
Copy Markdown
Collaborator Author

Tracking down some gnarly rogue dbs in gascity and I think this may be one of the culprits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant