fix(source-control): remotes like github.com:owner/repo reach their host #29457
main fromrefs/pull/29457/head·merged by maria-rcks View on GitHubProblem#
Git reads github.com:owner/repo.git as an SSH remote and takes the user from ssh config, so this is a working remote for anyone whose ~/.ssh/config sets User git. T3 Code keyed the repository correctly, but only user@host:path counted as naming a host, so the remote got no source control provider.
Call path: parseGitRemoteHost (packages/source-control-core/src/shared/definition.ts) falls through to new URL("github.com:owner/repo.git"), which parses as a custom scheme with an empty host, and returns null. recognizeRemote then returns null, which has two effects:
RepositoryIdentityResolver.buildRepositoryIdentityleavesprovideroff the identity, andPullRequestServiceskips projects with no provider, so their pull requests never list.SourceControlProviderRegistry.selectProviderContextfinds no candidate, soresolveHandlereturns theunknownprovider and every call fails with "No unknown source control provider is registered."
The same repository on git@github.com:owner/repo.git works. The GitLab provider already had a local workaround with the comment "Remote host parsing does not recognize userless SCP remotes", and normalizeGitRemoteUrl and parseForgejoRemote already have tests for this form.
Change#
packages/shared/src/sourceControl.ts gains userlessScpRemoteHost, and the places that needed user@ now also accept host:path:
parseGitRemoteHost, sorecognizeRemotefinds the host.isSshRemoteUrl, so these remotes keep preferring SSH and SSH-only host handling applies, the same as theirgit@spelling.repositoryPathFromRemoteUrl, so the display name keeps its case and head-owner lookups find an owner.parseGitCafeRemote, because GitCafe reads the repository from the remote itself.
The GitLab workaround is gone, since parseGitRemoteHost now does that job.
A remote on a host no forge claims, such as an ssh alias gh:owner/repo, now reads as unknown with its server's address, exactly as git@gh:owner/repo already did. It does not resolve the alias; that is #17805.
These still find no host: Windows drives (C:/repos/x), local paths (/srv/git/x, ./team:group/repo), file://, and remote helpers (hg::owner/repo, codecommit::us-east-1://repo).
Scope and approval#
A small, focused fix of an obvious bug, with no prior issue. One underlying problem: one form of remote that git accepts was not recognized as naming a host. The code already acknowledged the gap in a comment, and nothing here adds behavior beyond making this form match its git@ spelling. No contract or client changes.
Searched open issues and PRs for this. Nearest are #17805 and #14919 (ssh aliases resolved with ssh -G), which address a different problem and touch RepositoryIdentityResolver rather than parseGitRemoteHost, and #22620 / #22625 (forge SSH hosts such as ssh.bitbucket.org).
Verification#
Each focused test ran against the unfixed code first, then with the fix.
Before:
× reads the host of an SSH remote that leaves its user to ssh config: github.com:team/project.git
AssertionError: expected 'unknown' to equal 'github'
× reads the host of an SSH remote that leaves its user to ssh config: gitlab.com:team/project.git
AssertionError: expected 'unknown' to equal 'gitlab'
× reads the host of an SSH remote that leaves its user to ssh config: bitbucket.org:team/project.git
AssertionError: expected 'unknown' to equal 'bitbucket'
× reads the host of an SSH remote that leaves its user to ssh config: code.example.test:team/project.git
AssertionError: expected undefined to equal 'code.example.test:team/project.git'
× identifies the host of an SSH remote that leaves its user to ssh config
AssertionError: expected undefined to be 'github'
× reads github.com:owner/repo.git as SSH
× reads github-work:owner/repo.git as SSH
× reads the repository path of github.com:T3Tools/t3code.git
× reads the repository path of gitlab.com:T3Tools/platform/t3code
× reads the host and repository of git.cafe:team/project.git
After:
apps/server (SourceControlProviderRegistry, sourceControlDefinitions, RepositoryIdentityResolver) 34 passed
packages/shared (sourceControl) 10 passed
packages/source-control-core (SourceControlProvider) 6 passed
packages/source-control-gitcafe (gitCafeHosts) 8 passed
The RepositoryIdentityResolver test uses a real git init and git remote add origin github.com:T3Tools/t3code.git. The cases that must stay hostless were already passing and still pass, so they guard against over-matching.
Neighbouring suites also pass: GitLab provider and discovery (15), GitHub provider and discovery (42), GitCafe provider (8), Forgejo provider (37), packages/shared git.test.ts (30). Targeted vp fmt, vp lint and tsc --noEmit are clean in every changed package, and the commit hook's knip check passed.
Not checked: a live forge. The real gh, glab and Bitbucket calls were not run against a remote of this form; the tests stop at the provider chosen for it, and the providers downstream read the host and path through helpers that already handle this form. No visible UI strings or layout changed, though projects on these remotes will now show pull requests where they showed none.
Claude Opus 5.5 (Claude Code desktop app)
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
73a8153Macroscope's review found this PR approvable — Userless SSH remotes such as github.com:owner/repo now reach the existing provider and retain SSH transport. The change is limited to remote recognition and routing, with existing host validation retained.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Walkthrough
-
The changes add recognition for supported SCP-style Git remotes without a username. Shared parsing and provider handling use this recognition, and tests cover remote classification, repository paths, provider resolution, and repository identity.
Changes: Userless SCP Remote Recognition
Layer / File(s) Summary Shared remote parsing
packages/shared/src/sourceControl.ts,packages/shared/src/sourceControl.test.ts,packages/source-control-core/src/shared/definition.tsA shared helper recognizes supported userless host:pathremotes. SSH classification and host parsing use this helper. Tests cover supported and rejected remote formats.Repository path parsing
packages/source-control-core/src/server/SourceControlProvider.ts,packages/source-control-core/src/server/SourceControlProvider.test.ts,packages/source-control-gitlab/src/server/GitLabSourceControlProvider.tsRepository path parsing accepts userless SCP-style remotes. GitLab remote detection passes the original URL to host parsing instead of converting it first. Provider and identity integration
packages/source-control-gitcafe/src/server/*,apps/server/src/project/RepositoryIdentityResolver.test.ts,apps/server/src/sourceControl/*GitCafe host parsing accepts remotes without a username, and its SSH detection uses the shared helper. Application tests cover provider resolution, remote retention, rejected formats, and repository identity. Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk:
Low · up to73a81-
Userless
host:pathremotes now get a provider and fork checkouts for them use the GitCafessh@URL. That could matter for someone whose SSH config selects an identity by user, but this is unconfirmed and limited to GitCafe fork checkouts. The change is mergeable with that caveat in mind.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the main change: remotes written as host:path, such as github.com:owner/repo, are now resolved to their host. It follows the conventional commit format. The changeset adds userlessScpR… Description check The description follows the template. It has Problem, Change, Scope and approval, and Verification sections. The problem, the call path, and the affected behavior are explained. The change lists the m… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Title check
-
Explanation
The title names the main change: remotes written as host:path, such as github.com:owner/repo, are now resolved to their host. It follows the conventional commit format. The changeset adds userlessScpRemoteHost and uses it in host parsing, SSH detection, repository path parsing, and GitCafe parsing, which matches the title.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope and approval, and Verification sections. The problem, the call path, and the affected behavior are explained. The change lists the modified functions and the forms that still stay hostless. Scope names the small-fix exemption, cites related open issues and PRs, and gives reasons. Verification shows before and after test output, the neighboring suites that ran, and states what was not checked, which is the live forge calls. The description does not include a template-required note about the CONTRIBUTING.md read, but this is a minor, non-critical item. It also does not state a maintainer-approval link. The author explains why the small-fix exemption applies, which the template allows.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Additional comments: 1-
packages/source-control-gitcafe/src/server/GitCafeSourceControlProvider.ts: 1
-
481-481: Major · Functional Correctness · Quick win **Unverified finding** Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Preserve the configured SSH user for fork checkouts.
For a userless
git.cafe:team/projectremote, the new SSH check selects thisssh@URL when checkout needs a fork remote. That overrides the configured user. If SSH config selects the identity withMatch user, the fork fetch can fail even though the original remote works. Preserve the userless form for userless remotes. (man.openbsd.org)
-
Review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: c8a601c
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f2dc5a73-f94e-4331-ac08-be92c196aa0c
Commits-
Reviewing files that changed from the base of the PR and between c8a601c0dfa5c7626e51e06d727076f6b840a005 and 73a81531d1b018c5f553b713e29f4dc5a3186b18.
Files selected for processing: 12-
apps/server/src/project/RepositoryIdentityResolver.test.tsapps/server/src/sourceControl/SourceControlProviderRegistry.test.tsapps/server/src/sourceControl/sourceControlDefinitions.test.tspackages/shared/src/sourceControl.test.tspackages/shared/src/sourceControl.tspackages/source-control-core/src/server/SourceControlProvider.test.tspackages/source-control-core/src/server/SourceControlProvider.tspackages/source-control-core/src/shared/definition.tspackages/source-control-gitcafe/src/server/GitCafeSourceControlProvider.tspackages/source-control-gitcafe/src/server/gitCafeHosts.test.tspackages/source-control-gitcafe/src/server/gitCafeHosts.tspackages/source-control-gitlab/src/server/GitLabSourceControlProvider.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
-
Declining the unverified CodeRabbit note on
GitCafeSourceControlProvider.ts:481(preserve the userless form for fork checkouts). GitCafe fork remotes hard-codessh@, the same usercloneUrlsadvertises, and every other SSH spelling of the remote already takes this path. A userless remote that works must already resolve to that user through ssh config, sossh@selects the same user and aMatch userrule still applies. Keeping a separate userless form would add a special case for a failure that does not arise.Claude Opus 5.5 (Claude Code desktop app)
Note
Written by
gpt-6.1-solon behalf of MariaVerified in a real dev environment#
verified as-is at
73a81531d1b018c5f553b713e29f4dc5a3186b18on a linux boat vm. installed both revisions withvp iand ran one background dev server at a time. used repo playwright with/usr/bin/google-chrome, isolated app state, app-created projects and a real codexgpt-6.1-solturn. no mocks or demo data.- reproduced on
github/main(30b9c4a956): a real repository with onlyorigin=github.com:pingdotgg/t3code.githad an empty project-filtered pull-request list. authenticatedgit.resolvePullRequestfailed withNo unknown source control provider is registered. - on this head, the same remote resolves #29457 through the running server. the project-filtered web list shows it; opening it loads the live description, branches, checks and 12 changed files in the code tab.
- neighboring server checks passed for the explicit-user github ssh remote,
https://github.com/pingdotgg/t3code.git, and userlessgit.cafe:pingdotgg/t3code.git, each resolving this pr through its real forge provider. - the real codex turn completed and reported the userless origin and clean working tree.
- blacksmith
vp run check:changed c8a601c0dfa5c7626e51e06d727076f6b840a005passed: 82 tests across 10 files, format, lint, knip, graphql and affected-package typechecks. existing ci reports 30/30 successful. no source changes needed.




Not verified#
ssh network fetch/push and git.cafe fork checkout: this vm has no ssh private key. live gitlab and bitbucket calls: no credentials. native desktop, ios/android, macos/windows, and relay/tunnel connections were not exercised. the web client and local running-server paths above were exercised.
- reproduced on
maria-rcks merged this2b4d6a3
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes