fix(shared): detect Azure DevOps SSH remotes (ssh.dev.azure.com) - #6187
Conversation
`isAzureDevOpsHost` only matched the exact host `dev.azure.com` and any
`.visualstudio.com` domain. But the default Azure DevOps Git *SSH* clone URL is
`git@ssh.dev.azure.com:v3/{org}/{project}/{repo}`, whose host is
`ssh.dev.azure.com` — neither `dev.azure.com` nor a `.visualstudio.com` domain.
None of the other host detectors match it either (they look for the substrings
`github`/`gitlab`/`bitbucket`), so `detectSourceControlProviderFromRemoteUrl`
classified every Azure DevOps SSH remote as `kind: "unknown"`, while the HTTPS
remote for the same repo resolved to `azure-devops`.
Match any `*.dev.azure.com` subdomain in addition to the bare apex. The leading
dot keeps this tight — `evil-dev.azure.com.attacker.test` still does not match —
and the legacy `vs-ssh.visualstudio.com` SSH host stays classified via the
existing `.visualstudio.com` suffix.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved 24807c6 This PR adds a simple condition to recognize Azure DevOps SSH remotes ( You can customize Macroscope's approvability policy. Learn more. |
## What's Changed * feat(web): make environment artwork theme aware by @juliusmarminge in pingdotgg/t3code#6183 * fix(shared): normalize a bare Windows drive root the same as C:\ / C:/ by @arhxam in pingdotgg/t3code#6189 * fix(shared): detect Azure DevOps SSH remotes (ssh.dev.azure.com) by @arhxam in pingdotgg/t3code#6187 * feat(web): add back buttons for the pull requests and usage pages in the sidebar footer by @UtkarshUsername in pingdotgg/t3code#6031 * fix(web): render dropdowns above toasts by @Brechard in pingdotgg/t3code#6165 * fix(web): thread error banner dismiss survives reconnect and rerenders by @myacoub91 in pingdotgg/t3code#6123 * fix(web): use a clearer pull action icon by @extoci in pingdotgg/t3code#6194 * feat(web): use OKLCH for theme palettes by @StiensWout in pingdotgg/t3code#6036 ## New Contributors * @extoci made their first contribution in pingdotgg/t3code#6194 **Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260811.1068...v0.0.34-nightly.20260811.1069 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260811.1069
What Changed
isAzureDevOpsHost(packages/shared/src/sourceControl.ts) now matches any*.dev.azure.comsubdomain, not just the baredev.azure.com. Added a test.Why
The default Azure DevOps Git SSH clone URL is
git@ssh.dev.azure.com:v3/{org}/{project}/{repo}, whose host isssh.dev.azure.com— which is neither exactlydev.azure.comnor a.visualstudio.comdomain. None of the other detectors match it either (they look for the substringsgithub/gitlab/bitbucket), sodetectSourceControlProviderFromRemoteUrlclassified every Azure DevOps SSH remote askind: "unknown", even though the HTTPS remote for the same repo resolves toazure-devops.The leading dot in
.endsWith(".dev.azure.com")keeps this tight —evil-dev.azure.com.attacker.teststill does not match — and the legacyvs-ssh.visualstudio.comSSH host stays classified via the existing.visualstudio.comsuffix.Verified: the new test fails on the current code and passes with the change (confirmed by reverting only the source and re-running); full
packages/sharedtoolchain green (vp test,tsgo,vp lint,vp fmt).Checklist
Note
Low Risk
Small, targeted hostname rule change with new unit tests; no auth or data-path changes.
Overview
Azure DevOps SSH clone URLs (
git@ssh.dev.azure.com:v3/...) were classified asunknownbecause host detection only matcheddev.azure.comand*.visualstudio.com, notssh.dev.azure.comor other*.dev.azure.comhosts.isAzureDevOpsHostnow also treats hosts ending in.dev.azure.comas Azure DevOps (with the leading dot kept to avoid overly broad matches). Tests cover default SSH,ssh://with port, and legacyvs-ssh.visualstudio.com.Reviewed by Cursor Bugbot for commit 24807c6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix Azure DevOps SSH remote detection for
ssh.dev.azure.comhostsExpands
isAzureDevOpsHostin sourceControl.ts to match hosts ending with.dev.azure.com(e.g.ssh.dev.azure.com), in addition to the existingdev.azure.comand*.visualstudio.compatterns. A new test case covers bothssh://and scp-like SSH clone URL forms.Macroscope summarized 24807c6.