| author | |
| committer | |
| log | 220e573b14cea84b6662a7d69047129047433b63 |
| tree | 002fa0ff1879d2fa26b707fe58fc29ebcb51f8d0 |
| parent | 6befe42eb09633f3adb500ae906a0e1da3f15f64 |
| signature | Signed by PGP key B5690EEEBB952194 |
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>2 files changed, 25 insertions(+), 1 deletions(-)
packages/shared/src/sourceControl.test.ts+16| ... | @@ -57,6 +57,22 @@ describe("detectSourceControlProviderFromRemoteUrl", () => { | ... | @@ -57,6 +57,22 @@ describe("detectSourceControlProviderFromRemoteUrl", () => { |
| 57 | ).toBe("bitbucket"); | 57 | ).toBe("bitbucket"); |
| 58 | }); | 58 | }); |
| 59 | 59 | ||
| 60 | it("detects Azure DevOps SSH remotes", () => { | ||
| 61 | // The default Azure DevOps SSH clone URL uses the ssh.dev.azure.com host. | ||
| 62 | expect( | ||
| 63 | detectSourceControlProviderFromRemoteUrl("git@ssh.dev.azure.com:v3/org/project/repo")?.kind, | ||
| 64 | ).toBe("azure-devops"); | ||
| 65 | expect( | ||
| 66 | detectSourceControlProviderFromRemoteUrl("ssh://git@ssh.dev.azure.com:22/v3/org/project/repo") | ||
| 67 | ?.kind, | ||
| 68 | ).toBe("azure-devops"); | ||
| 69 | // Legacy visualstudio.com SSH host stays classified too. | ||
| 70 | expect( | ||
| 71 | detectSourceControlProviderFromRemoteUrl("git@vs-ssh.visualstudio.com:v3/org/project/repo") | ||
| 72 | ?.kind, | ||
| 73 | ).toBe("azure-devops"); | ||
| 74 | }); | ||
| 75 | |||
| 60 | it("preserves ports while classifying by hostname", () => { | 76 | it("preserves ports while classifying by hostname", () => { |
| 61 | expect( | 77 | expect( |
| 62 | detectSourceControlProviderFromRemoteUrl("https://gitlab.com:8443/group/repo.git"), | 78 | detectSourceControlProviderFromRemoteUrl("https://gitlab.com:8443/group/repo.git"), |
packages/shared/src/sourceControl.ts+9-1| ... | @@ -176,7 +176,15 @@ function isGitLabHost(host: string): boolean { | ... | @@ -176,7 +176,15 @@ function isGitLabHost(host: string): boolean { |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | function isAzureDevOpsHost(host: string): boolean { | 178 | function isAzureDevOpsHost(host: string): boolean { |
| 179 | return host === "dev.azure.com" || host.endsWith(".visualstudio.com"); | 179 | // `ssh.dev.azure.com` is the default Azure DevOps SSH clone host |
| 180 | // (git@ssh.dev.azure.com:v3/org/project/repo), so match any `*.dev.azure.com` | ||
| 181 | // subdomain, not just the bare `dev.azure.com`. Legacy hosts stay under | ||
| 182 | // `.visualstudio.com` (including `vs-ssh.visualstudio.com`). | ||
| 183 | return ( | ||
| 184 | host === "dev.azure.com" || | ||
| 185 | host.endsWith(".dev.azure.com") || | ||
| 186 | host.endsWith(".visualstudio.com") | ||
| 187 | ); | ||
| 180 | } | 188 | } |
| 181 | 189 | ||
| 182 | function isBitbucketHost(host: string): boolean { | 190 | function isBitbucketHost(host: string): boolean { |