You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(shared): recognize SSH remotes with a single path component - #31781
Git accepts gitserver:repo.git as SSH, taking the user from SSH config. T3's shared detector requires a slash inside the repository path, so this valid remote reads as non-SSH and parseGitRemoteHost returns null. The equivalent git@gitserver:repo.git already works.
Allow zero additional path components in the existing matcher. Extend its existing test tables for relative, absolute, and trailing-slash paths and for Windows drive, local path, empty path, and remote-helper exclusions.
This is a very small, focused obvious-bug fix: one regex quantifier rejects an existing transport's valid spelling. It corrects shared SSH detection and host recognition without changing repository identity normalization, SSH alias expansion, contracts, or settings. No frontend component or documentation changes are needed.
Duplicate search covered userless SSH, SCP remotes, and single-component paths. Related work: #29457 added multi-component detection; #14919 expands SSH aliases and normalizes identities; #30798 repairs IPv6 clone conversion. None fixes this matcher.
Verification on macOS arm64, Node 22.20.0, Git 2.54.0; upstream main c52df24d285a:
vp test run packages/shared/src/sourceControl.test.ts: before, 3 failed / 14 passed; after, 17 passed. All three failures were the new valid SSH forms.
Neighboring sourceControlDefinitions.test.ts and SourceControlProvider.test.ts: 14 passed.
vp run check:changed: format, lint, both knip passes, affected typechecks, and focused tests passed. Typechecking emitted existing schema-brand suggestions.
git diff --check: passed.
Native Git proof used a temporary GIT_SSH_COMMAND executable that printed arguments and exited without connecting. git ls-remote gitserver:repo.git passed it host gitserver and command git-upload-pack 'repo.git'. Absolute and trailing-slash forms also selected SSH and preserved their paths.
Direct execution of the original and updated modules confirmed:
The production parseGitRemoteHost now returns host/hostname gitserver for each form. Existing multi-component remotes remain SSH; Windows/local paths and remote-helper syntax stay excluded.
Not verified: live SSH authentication/fetches, native Windows/Linux execution, or a running client. This changes no UI markup or styling; proof exercises the parser and its host-resolution consumer directly.
Implemented and verified with GPT-6.1 Sol through the Codex harness in T3 Code.
Macroscope's review found this PR approvable — Recognizes single-component SSH remotes such as gitserver:repo.git, allowing existing host-discovery and transport-selection logic to handle them consistently. The change is narrowly scoped and retains existing Windows-drive and remote-helper exclusions.
You can add or adjust custom eligibility rules. Learn more.
Single-component SSH remotes are recognized. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly describes the main change to SSH remote detection.
Description check
The description covers the problem, change, scope, verification results, and unverified cases. It does not use the template's section headings.
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.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
Reviewing files that changed from the base of the PR and between c52df24 and cb90a27.
Files selected for processing: 2
packages/shared/src/sourceControl.test.ts
packages/shared/src/sourceControl.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.
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
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedPR author is not yet trusted in the VOUCHED list.
1 participant
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.
Git accepts
gitserver:repo.gitas SSH, taking the user from SSH config. T3's shared detector requires a slash inside the repository path, so this valid remote reads as non-SSH andparseGitRemoteHostreturnsnull. The equivalentgit@gitserver:repo.gitalready works.Allow zero additional path components in the existing matcher. Extend its existing test tables for relative, absolute, and trailing-slash paths and for Windows drive, local path, empty path, and remote-helper exclusions.
This is a very small, focused obvious-bug fix: one regex quantifier rejects an existing transport's valid spelling. It corrects shared SSH detection and host recognition without changing repository identity normalization, SSH alias expansion, contracts, or settings. No frontend component or documentation changes are needed.
Duplicate search covered userless SSH, SCP remotes, and single-component paths. Related work: #29457 added multi-component detection; #14919 expands SSH aliases and normalizes identities; #30798 repairs IPv6 clone conversion. None fixes this matcher.
Verification on macOS arm64, Node 22.20.0, Git 2.54.0; upstream main
c52df24d285a:vp test run packages/shared/src/sourceControl.test.ts: before, 3 failed / 14 passed; after, 17 passed. All three failures were the new valid SSH forms.sourceControlDefinitions.test.tsandSourceControlProvider.test.ts: 14 passed.vp run check:changed: format, lint, both knip passes, affected typechecks, and focused tests passed. Typechecking emitted existing schema-brand suggestions.git diff --check: passed.Native Git proof used a temporary
GIT_SSH_COMMANDexecutable that printed arguments and exited without connecting.git ls-remote gitserver:repo.gitpassed it hostgitserverand commandgit-upload-pack 'repo.git'. Absolute and trailing-slash forms also selected SSH and preserved their paths.Direct execution of the original and updated modules confirmed:
The production
parseGitRemoteHostnow returns host/hostnamegitserverfor each form. Existing multi-component remotes remain SSH; Windows/local paths and remote-helper syntax stay excluded.Not verified: live SSH authentication/fetches, native Windows/Linux execution, or a running client. This changes no UI markup or styling; proof exercises the parser and its host-resolution consumer directly.
Implemented and verified with GPT-6.1 Sol through the Codex harness in T3 Code.