Repository navigation
fix(server): detect a recognized remote when origin's host is unknown - #41912
Closed
2SinceJuly wants to merge 1 commit into
Closed
2SinceJuly wants to merge 1 commit into
2SinceJuly wants to merge 1 commit into
Conversation
selectProviderContext prefers a remote named origin even when no registered CLI recognizes its host, so a repository whose origin points at a self-hosted server resolves to the unknown provider and createChangeRequest fails with "No unknown source control provider is registered", while a second remote on github.com goes unused. When the origin candidate refines to unknown, fall back to the first remote whose host a provider does recognize before asking the discovery CLIs about origin. An origin a CLI claims still wins.
2 tasks done
Member
|
Thanks for this. #34025 makes the same change and is the one being kept. #34025 implements the same fallback while reusing the remote candidates already collected for provider selection. That keeps the fix smaller and avoids adding a second remote-recognition loop. Your regression test preserving a recognized origin's priority is useful coverage that could be carried into the retained fix. Closing as a duplicate. |
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.
Problem
With more than one git remote, a repository whose
originis a self-hosted server that no source control integration recognizes resolves to theunknownprovider, even when another remote points at github.com. Every later source control call then fails withNo unknown source control provider is registered., so creating a pull request is impossible.Reported in #34022 (0.1.9-nightly.20261110.4478, Linux).
selectProviderContextreturns the remote namedoriginwhenever any provider recognizes its URL — including the URL parser'sunknownverdict — so the recognizedgithubremote is never considered.Change
In
detectProviderContext, when the selected context is stillunknownafter refinement, fall back to the first remote whose host a registered integration does recognize, and refine that context instead. A remote namedoriginthat a CLI does claim still wins, and a repository whose remotes are all unrecognized keeps today's behavior.Scope
Bug fix only. Closes #34022.
Verification
Added two cases to
apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts:prefers a recognized remote over an unrecognized originbuilds the report's remote set (unrecognizedorigin,githubsecond) and asserts the handle resolves togithubwithremoteName: "github".keeps a recognized origin over a recognized remote further downasserts the existing precedence is unchanged.Ran the new test on the unmodified source to confirm it reproduces the bug:
With the fix, the whole file passes on current
main(93318111):vp checkreports all changed files correctly formatted. Nothing else was checked: the fix is covered by the provider registry unit tests, and I did not create a pull request against a live multi-remote repository.Claude Code.