fix(repo): resolve mirror get clone URLs via that cluster's login server - #1676
Merged
Conversation
`entire repo mirror get entire://<cluster>/gh/<owner>/<repo>` listed mirrors on the active context's core, so a clone URL for a cluster in a different federation failed with "no mirror matching" until the user manually switched contexts with `entire auth use`. The clone URL already names its cluster; dial the core fronting it — discovered from the cluster's /.well-known/entire-cluster.json and authenticated with the matching local context — the same routing `mirror create`/`remove` (PR #1475) and `repo clone --cluster` (PR #1529) already use. A ULID ref carries no cluster coordinate and stays on the active context. Adds runCoreObjectForCluster (mirroring runCoreListForCluster) and a clusterCoreClient test seam alongside activeCoreClient so the routing decision is pinned by command-level tests without live discovery. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Entire-Checkpoint: 01KX0ENQ9M4C5P85G431G5YR2E
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Entire-Checkpoint: 01KX0FEMM9PGRDVWZTJ95RGXAJ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Entire-Checkpoint: 01KX0FGHZAT1G7CBBZ8ECS8G90
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes entire repo mirror get so that when the user passes an entire://<cluster>/gh/<owner>/<repo> clone URL, the command resolves the mirror by dialing the login server (core) that fronts that cluster rather than the active auth context—bringing mirror get in line with the established cluster-routing behavior of other mirror commands.
Changes:
- Route
mirror getclone-URL lookups throughrunCoreObjectForCluster(discovered/authenticated viacoreapi.NewForCluster), while keeping ULID lookups on the active context. - Add shared object-rendering plumbing (
renderCoreObject) and aclusterCoreClientseam to enable command-level tests without live/.well-knowndiscovery. - Add
TestRepoMirrorGet_Routingto pin routing behavior for clone URL vs ULID vs invalid ref (no dialing).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/entire/cli/repo_mirror.go | Routes mirror get by ref type (ULID vs clone URL), improves help text, and centralizes parse-error messaging. |
| cmd/entire/cli/repo_mirror_test.go | Adds routing-focused command test ensuring correct core selection and no-dial on parse failure. |
| cmd/entire/cli/corecmd.go | Introduces runCoreObjectForCluster/renderCoreObject and adds clusterCoreClient test seam used by cluster-routed object commands. |
Soph
approved these changes
Jul 8, 2026
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.
https://entire.io/gh/entireio/cli/trails/796
Why
entire repo mirror get entire://<cluster>/gh/<owner>/<repo>resolved the mirror on the active context's login server, so a clone URL for a cluster in another federation failed withno mirror matchinguntil the user switched contexts withentire auth use. Not a regression: the clone-URL form was born with this in #1531, which shipped without the cluster routing that #1475 (mirror create/remove/collaborators) and #1529 (repo clone --cluster) already established.What
mirror get <clone-url>now dials the login server fronting the URL's cluster (viacoreapi.NewForCluster— cached well-known discovery + matching local context), so it works regardless of the active context. A ULID ref has no cluster coordinate and stays on the active context; an unparseable ref errors before dialing anything.runCoreObjectForCluster(mirroringrunCoreListForCluster) and aclusterCoreClienttest seam alongsideactiveCoreClient, making cluster-routed commands testable at command level for the first time..gittolerance; says "login server", not "core".Verification
TestRepoMirrorGet_Routingpins all three paths: clone URL must dial the cluster's core and must NOT touch the active context; ULID the reverse; bad ref dials nothing.mise run fmt && mise run lintclean;go test ./cmd/entire/cli/passes.🤖 Generated with Claude Code
Note
Low Risk
Behavior fix and testable refactors in CLI mirror lookup; no auth or data-model changes beyond dialing the correct control plane for clone URLs.
Overview
entire repo mirror getwith anentire://…clone URL now talks to the login server for the URL’s cluster (runCoreObjectForCluster/coreapi.NewForCluster), matching create/remove—so mirrors in another federation no longer fail with “no mirror matching” while the wrong context is active. ULID refs still use the active context; invalid refs fail during parse with no API dial.Shared CLI plumbing adds
renderCoreObject,runCoreObjectForCluster, and aclusterCoreClienttest seam (like list commands). Help text documents per-ref routing and trailing.git;badMirrorRefErrunifies parse errors.TestRepoMirrorGet_Routingasserts clone URL vs ULID vs bad-ref dialing behavior.Reviewed by Cursor Bugbot for commit f8721e8. Configure here.