Repository navigation
fix(gitlab): recognize SSH-over-443 remotes - #30998
Conversation
Walkthrough
Priority: Merge Risk:
|
Reuse the existing GitLab transport-host normalizer in project identity, hosted links, and manual merge-request links. Cover alias variants, lookalikes, nested groups, and canonical encoded links. Fixes stablyai#30876 Co-authored-by: lorenzozanee <[email protected]>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Gate GitLab alias folding by SSH-over-443 transport. · git-remote-host-alias.ts:4-27
src/shared/git-remote-host-alias.ts:4-27
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winGate GitLab alias folding by SSH-over-443 transport.
normalizeGitLabRemoteHostis host-only, but the hosted-remote and source-control URL parsers apply it tourl.hostnamewithout checking the protocol or port. Therefore,https://altssh.gitlab.com:8443/team/project.gitcan produce public GitLab links and GitLab provider identity, even thoughaltssh.gitlab.comis documented only as an SSH-over-443 alias. Keep the shared helper host-only and gate alias folding in the protocol-aware callers.Suggested fix
diff --git a/src/main/git/hosted-remote-url.ts b/src/main/git/hosted-remote-url.ts @@ -function providerForHost(host: string): HostedRemoteHost | null { - const normalized = normalizeGitLabRemoteHost(host) +function providerForHost( + host: string, + allowGitLabAlias = true +): HostedRemoteHost | null { + const normalized = allowGitLabAlias + ? normalizeGitLabRemoteHost(host) + : host.trim().toLowerCase() @@ - const hosted = providerForHost(url.hostname) + const hosted = providerForHost( + url.hostname, + url.protocol.toLowerCase() === 'ssh:' && url.port === '443' + )diff --git a/src/renderer/src/components/right-sidebar/source-control/review/remote-repo.ts b/src/renderer/src/components/right-sidebar/source-control/review/remote-repo.ts @@ -function providerForHost(host: string): ManualReviewProvider | null { - const normalized = normalizeGitLabRemoteHost(host) +function providerForHost( + host: string, + allowGitLabAlias = true +): ManualReviewProvider | null { + const normalized = allowGitLabAlias + ? normalizeGitLabRemoteHost(host) + : host.trim().toLowerCase() @@ const remoteHost = url.hostname.toLowerCase() - const host = normalizeGitLabRemoteHost(remoteHost) + const allowGitLabAlias = protocol === 'ssh:' && url.port === '443' + const host = allowGitLabAlias ? normalizeGitLabRemoteHost(remoteHost) : remoteHost const hintedProvider = normalizeProvider(providerHint) - const inferredProvider = providerForHost(host) + const inferredProvider = providerForHost(remoteHost, allowGitLabAlias) @@ - } else if (remoteHost === 'altssh.gitlab.com') { + } else if (allowGitLabAlias && remoteHost === 'altssh.gitlab.com') {

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b5c6fc35-0873-4a24-ad0b-772f2a939057
Files selected for processing: 3-
src/main/git/hosted-remote-url.tssrc/main/gitlab/project-ref-parser.test.tssrc/main/gitlab/project-ref-parser.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
|
GitLab.com remotes using The light review found no production blocker. One additive test-only fixer round covered the actual CLI command and provider-hook-to-header-action consumers; the same reviewer accepted the follow-up. All 69 named regression tests passed. Main was integrated at The existing Source Control action now infers GitLab's “Create MR” wording for this alias. The branch-only M4Air run shows the real enabled action. The owned app stopped gracefully and all ten real-config hashes were unchanged. Hosted review lookup was unavailable because Original implementation and preserved commit history are credited to @lorenzozanee. For Brennan's review |

Problem and user-facing result
GitLab.com repositories using
ssh://[email protected]:443/team/project.gitcould miss GitLab recognition and fail to produce file or commit links. Manual merge-request links could use the SSH-only hostname. These remotes now resolve to the same GitLab.com project, and file, commit, and new merge-request links usehttps://gitlab.com. CLI worktree commands also accept GitLab.com issue and merge-request URLs matching the stored SSH-over-443 remote.Provider inference can now select the existing GitLab “Create MR” wording instead of the GitHub “Create PR” fallback while eligibility loads. This is an intended correction to provider recognition; no new control or notice is added. Git retains the configured transport remote.
What changed and plan
The three existing parsers reuse the existing exact-host GitLab alias normalizer for derived project identity and web URLs. Tests cover the parser boundaries, final link destinations, CLI project matching, and the provider-hook-to-header-action flow. Self-hosted service ports, foreign-project rejection, lookalike host rejection, and other providers keep their existing behavior. There is no new stored state, protocol, credential handling, or process operation.
Light review classification
git log origin/main --since=2026-09-23on the three production files contains no commits, including no same-symptom fix or revert in the last 30 days.Linked Issue
Tracked in #30876
Validation
The current review loop passed 52 tests in the three existing parser/manual-link suites on
c50edba4c7bfbf06671b0fcf58eea1818ba4b933. The test-only coverage follow-up1b4e7afe90cpassed 17 tests inindex-worktree-gitlab-links.test.tsanduse-hosted-review-state.test.tsx, using Node withORCA_BACKGROUND_LAUNCH=1and the machine-wide test queue. The latter drives the real provider hook through the existing header action and asserts disabled “Create MR” copy while eligibility loads. Existing CLI foreign-project/host/port rejection tests remain in the executed suite; the parser suites retain exact-alias lookalike rejection.Validation follows the current review QA table: pure parser and URL flows use regression tests, the CLI uses an integration test running its real command entry point, and provider wording uses a renderer/state/action test plus one branch-only app screenshot. No lifecycle, process, or login flow changed. A live SSH/WSL transport test, agent reply matrix, or hosted MR creation is outside this validation scope; no such pass is claimed.
Main was integrated at
5eb61acd64a45f49b375ec8935708244114f3748, where the branch-only M4Air screenshot shows the real enabled “Create MR” action for the alias remote. The app was stopped gracefully and all ten real-config hashes were unchanged. Missingglabprevented hosted review lookup on that machine; this screenshot does not claim lookup, authentication, transport or MR creation coverage.The initial integrated-head CI failure came from main's unrelated
JiraUserimport. A subsequent additive main merge097b162cdc64488a5233e263433c91907aa6e5d0includes the landed #32964 repair; narrow inspection confirms the reviewed PR additions and removals are preserved. The screenshot carries across that main merge. Final current-head PR Checks passed, including static/type checks, all five test shards, Git compatibility and Linux/Windows packaging; headless persistence and native smoke also passed.The normal follow-up commit hook and the prescribed main-merge staged checks passed. Earlier historical validation is not counted as current-head app evidence.
Attribution and AI disclosure
Original implementation by @lorenzozanee; exact original commit
7f5b284890934024ff3b95cec31cdadcab9af547and its author are preserved in the branch history. The contributor’s three production changes are preserved; additive follow-up commits strengthen tests and integrate main without rewriting history.The original contributor disclosed OpenCode (gpt-6-luna) assistance. Native OpenAI Codex workers assisted with reproduction, regression coverage, validation, and independent review.
Agent skill upstream boundary