fix(dolt): resolve shared-server CLI dir from shared root#3223
Open
s-a-c wants to merge 1 commit intogastownhall:mainfrom
Open
fix(dolt): resolve shared-server CLI dir from shared root#3223s-a-c wants to merge 1 commit intogastownhall:mainfrom
s-a-c wants to merge 1 commit intogastownhall:mainfrom
Conversation
Limit CLI path resolution changes to shared-server mode, where the local machine has an authoritative shared Dolt root. Add direct path tests, routing-guard tests, and an end-to-end shared-server push workflow regression test. Co-authored-by: s-a-c <71233932+s-a-c@users.noreply.github.com> Co-authored-by: gh copilot via gpt 5.4 medium <gh-copilot-via-gpt-5-4-medium@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes how DoltStore.CLIDir() resolves the working directory for dolt CLI subprocesses in shared-server mode by deriving the path from the authoritative shared Dolt root (instead of the per-project .beads/dolt/<db> layout). This aligns CLI-based operations (e.g., remote, push, pull) with where the shared server actually stores database repos.
Changes:
- Update
DoltStore.CLIDir()to resolve fromdoltserver.ResolveDoltDir(beadsDir)whenserverMode+ shared-server mode are enabled. - Add unit coverage for shared-server vs non-shared-server
CLIDir()resolution. - Add routing/guard tests and an integration regression test validating shared-server credential-bearing CLI routing through the shared Dolt root.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/storage/dolt/store.go | Adjusts CLIDir() to use the shared Dolt root for shared-server mode, preserving legacy behavior elsewhere. |
| internal/storage/dolt/open_test.go | Adds direct tests asserting CLIDir() path resolution in shared-server vs non-shared-server mode. |
| internal/storage/dolt/credentials_test.go | Adds tests ensuring credential/cloud-auth CLI routing resolves remotes via the shared Dolt root in shared-server mode. |
| internal/storage/dolt/git_remote_shared_server_test.go | Adds an integration test proving end-to-end shared-server credential routing succeeds even when the per-project CLI dir is stale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In shared-server mode,
CLIDir()can resolve from the authoritative shared Dolt root instead of the per-project.beads/dolt/<db>path.This change is intentionally limited to shared-server mode. It does not change generic external-server behavior.
What changed
internal/storage/dolt/store.goserverModeis true andIsSharedServerMode()is true, resolveCLIDir()viadoltserver.ResolveDoltDir(beadsDir)dbPathbehavior everywhere elseinternal/storage/dolt/open_test.gointernal/storage/dolt/credentials_test.gointernal/storage/dolt/git_remote_shared_server_test.goWhy this scope
Shared-server mode has a local, authoritative Dolt root. Generic external-server mode does not necessarily have that property, so this PR avoids changing that behavior.
The goal here is to fix the shared-server CLI path case without claiming to solve the broader external-server path-authority problem.
Verification
CGO_ENABLED=0 go test ./internal/storage/dolt -run 'TestCLIDirUsesSharedDoltRootInSharedServerMode|TestCLIDirUsesDbPathOutsideSharedServerMode|TestCredentialCLIRoutingSharedServerUsesSharedDoltRoot|TestCloudAuthCLIRoutingSharedServerUsesSharedDoltRoot'CGO_ENABLED=0 go test -count=1 -tags integration ./internal/storage/dolt -run 'TestCredentialCLIRoutingE2ESharedServer|TestCredentialCLIRoutingE2E|TestGitRemoteExternalServerRouting'Both passed in a clean branch containing only this scoped slice.
Closes #3219