git-remote-entire: delete the wrong-cluster hint, which cannot fire - #2384
Open
Soph wants to merge 1 commit into
Open
git-remote-entire: delete the wrong-cluster hint, which cannot fire#2384Soph wants to merge 1 commit into
Soph wants to merge 1 commit into
Conversation
fatalMessage special-cased an RFC 8693 invalid_target error whose description named the cluster actually serving the repo, turning it into "this repository is not hosted on X; it lives on Y" plus a corrected clone command. Nothing can produce that error any more, so the branch has never been reachable in main. It was added in #1575 (2026-06-30), built on the repo-scoped token exchange the helper performed at the time. #1621 removed that exchange for the interactive path — merged 2026-07-03 05:17, six hours BEFORE #1575 merged at 11:22 — and #1622 migrated the ENTIRE_TOKEN path the next morning. Both PRs were the same author's; neither conflicted with #1575 in any file, so nothing flagged it. The helper now presents a jurisdiction token as a bearer and never exchanges, so no invalid_target is ever returned to it. Measured rather than reasoned. Cloning a single-placement repo from the wrong cluster, against a helper built from main: $ git clone entire://aws-eu-central-1.entire.io/gh/entireio/cli-perf-benchmarks fatal: stateless-connect v2 info/refs: Repository not found with ENTIRE_DEBUG showing the wire: GET /gh/entireio/cli-perf-benchmarks/info/refs?service=git-upload-pack HTTP/1.1 404 Not Found Repository not found A plain 404 with a four-word body: no invalid_target, no error_description, nothing naming the correct host. The same repo on its own cluster clones fine with the same credentials, so that 404 is the wrong-cluster response rather than an access failure. So this is not repairable here. The 404 carries no information about where the repo lives, and no client-side matcher can invent it. Restoring the UX needs the data plane to say so on that response — worth noting the helper already looks for an X-Entire-Replicas header there and logs its absence, so the mechanism may partly exist. Filed separately; this commit only removes code that cannot run. TestFatalMessage went with it. It passed throughout by constructing the invalid_target error itself, which verified the formatting and could never observe that the input had no producer — the reason a dead branch survived two years of green CI. fatalMessage reduced to a single Sprintf with one caller, so it is inlined rather than kept as a seam. If the hint returns it will match a 404 body, not an OAuth error, and would not reuse this shape. Verified: identical stderr before and after (the point of the change), lint clean, GOOS=windows vet clean, helper and remotehelper suites pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 01M2863QYHMEQG3P93TAGG0FGW
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes remove unreachable code without changing current error behavior.
Pull request overview
Removes unreachable wrong-cluster error formatting while preserving generic fatal output.
Changes:
- Deletes obsolete
fatalMessagehandling and related imports. - Removes the fossilized unit test and unused regex/auth logic.
File summaries
| File | Summary |
|---|---|
cmd/git-remote-entire/main.go |
Removes dead wrong-cluster handling and simplifies error reporting. |
cmd/git-remote-entire/main_test.go |
Removes tests for the deleted formatter. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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/1311
Why
fatalMessagespecial-cased an RFC 8693invalid_targeterror whoseerror_descriptionnamed the cluster actually serving the repo, turning it into an actionable message plus a corrected clone command:Nothing can produce that error any more, and nothing has since July 2026. The helper no longer performs a token exchange — it presents a jurisdiction token as a bearer — so no
invalid_targetever reaches it. The branch compiles, its test passes, and it cannot run.Found by a trail finding on #2261 (
01M27VJ2Y7VS), which I verified rather than took on faith.Measured, not reasoned
Cloning a single-placement repo from the wrong cluster, against a helper built from
main:ENTIRE_DEBUGon the same run, showing the wire:A plain 404 with a four-word body. No
invalid_target, noerror_description, nothing naming the correct host.Control: the same repo on its own cluster (
aws-us-east-2), same credentials, clones fine. So that 404 is genuinely the wrong-cluster response, not an access or existence failure.How it got this way
mainwhere the repo-scoped exchange existedENTIRE_TOKENCI path migrated too#1621 and #1575 are the same author's, three days apart. They share no file, so nothing conflicted and nothing flagged it. For about 21 hours the hint could still fire for
ENTIRE_TOKENusers — CI runners, the population least likely to hand-type a cluster host. On the interactive path it was built for, it never worked inmainat all.The coupling was semantic: an error-formatting branch depending on a call still being made. #1621 was a good change — it cut
git ls-remotefrom ~1050ms to ~350ms by removing a per-command exchange. The exchange was pure overhead, except that one error path had taken a dependency on its failure mode.Why the test didn't catch it
TestFatalMessagebuilt theinvalid_targeterror itself:That verifies the formatting perfectly and can never observe that the input has no producer. A test constructing its own input cannot detect a missing producer — which is how a dead branch survived green CI for two months. Its wrapper string even names
repo-scoped token exchange, a path deleted in July: an accurate fossil of how the code used to work.What this does and does not do
Does: remove code that cannot run —
fatalMessage,wrongClusterRe,TestFatalMessage, and four imports that existed only to serve them.Does not: restore the feature. That is not repairable here — the 404 carries no information about where the repo lives, and no client-side matcher can invent it. It needs the data plane to say so on that response. Worth noting the helper already looks for an
X-Entire-Replicasheader there and logs its absence, so the mechanism may be partly built; filed as a follow-up.Worth stating plainly: the current UX is worse than the raw error the original PR was fixing. That JSON blob was ugly but it contained the answer.
Repository not foundis tidy and tells you nothing. Deleting this branch doesn't cause that — the branch has been inert throughout — but it shouldn't be read as the problem being solved.On inlining
fatalMessagereduced to a singleSprintfwith one caller, so it is inlined rather than kept as a seam. If the hint returns it will match a 404 body, not an OAuth error, so the seam would be speculative and the wrong shape. Happy to keep the named function if a reviewer prefers.Verification
Rebuilt the helper with the branch deleted and re-ran the wrong-cluster clone: stderr is byte-identical. That is the point of the change — if the branch had ever fired, deleting it would alter output.
mise run test:cigreen (90 packages, 0 failures),golangci-lint0 issues,GOOS=windows go vetclean.🤖 Generated with Claude Code
Note
Low Risk
Dead-code removal and simpler stderr formatting only; no auth or transport logic changes.
Overview
Removes dead error-handling in
git-remote-entirethat tried to turn OAuthinvalid_targetresponses (with a “lives on <host>” description) into a friendly fatal message and suggestedgit clone entire://…URL. That path depended on repo-scoped token exchange, which the helper no longer performs after jurisdiction-token bearer auth.githelper.Runfailures now always printfatal: %von stderr instead of going throughfatalMessage. Also dropswrongClusterRe, thests/errors/regexpimports, andTestFatalMessage.Behavior for real wrong-cluster clones is unchanged in practice: users still see the generic transfer error (e.g. “Repository not found”), not the old hint.
Reviewed by Cursor Bugbot for commit 0e8e8b3. Configure here.