feat: add --remote flag to bd dolt push/pull + per-remote credential routing#3211
Open
harry-miller-trimble wants to merge 1 commit intogastownhall:mainfrom
Open
feat: add --remote flag to bd dolt push/pull + per-remote credential routing#3211harry-miller-trimble wants to merge 1 commit intogastownhall:mainfrom
harry-miller-trimble wants to merge 1 commit intogastownhall:mainfrom
Conversation
Add PushRemote/PullRemote methods to RemoteStore interface, allowing push/pull to target a specific named remote instead of the default. Implementation: - Refactor Push/ForcePush/Pull to delegate to internal pushToRemote/ pullFromRemote methods with parameterized remote name - Parameterize credential routing (isGitProtocolRemote, shouldUseCLIForCredentials, shouldUseCLIForCloudAuth) to accept remote name instead of using s.remote - Make shouldUseCLIForCloudAuth per-scheme-aware: Azure env vars only trigger CLI routing for az:// remotes, not dolthub:// remotes - Add credentialsForRemote() helper that only returns creds when the target remote matches the default remote (prevents sending wrong creds to wrong host) - Add --remote flag to doltPushCmd and doltPullCmd in CLI - Implement PushRemote/PullRemote on EmbeddedDoltStore Backwards compatibility: - Push(ctx)/Pull(ctx)/ForcePush(ctx) signatures unchanged - No --remote flag = exact same behavior as today - PushTo/PullFrom for federation peers unchanged Closes: bd-4v3 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
544ee47 to
9f6c77c
Compare
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
Adds
--remoteflag tobd dolt pushandbd dolt pullcommands, enabling push/pull to target a specific named remote. Also refactors credential routing to be per-remote-aware.Changes
Interface (
internal/storage/remote.go)PushRemote(ctx, remote, force)andPullRemote(ctx, remote)to RemoteStore interfaceCore (
internal/storage/dolt/store.go)credentialsForRemote()helper — only returns creds when target matches default remoteCredentials (
internal/storage/dolt/credentials.go)shouldUseCLIForCloudAuthnow per-scheme-aware: Azure env vars only trigger CLI foraz://remotes, notdolthub://cloudAuthSchemeMapandenvPrefixesForRemoteURL()for scheme-to-env mappingCLI (
cmd/bd/dolt.go)--remoteflag to doltPushCmd and doltPullCmdBackwards Compatibility
Push(ctx)/Pull(ctx)/ForcePush(ctx)signatures unchanged — all 11+ callers unaffected--remoteflag = exact same behavior as todayFiles changed (7 files, +363/-133)
Rebased from fork PR harry-miller-trimble#34