Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/shared/src/sourceControl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ describe("detectSourceControlProviderFromRemoteUrl", () => {
).toBe("bitbucket");
});

it("detects Azure DevOps SSH remotes", () => {
// The default Azure DevOps SSH clone URL uses the ssh.dev.azure.com host.
expect(
detectSourceControlProviderFromRemoteUrl("git@ssh.dev.azure.com:v3/org/project/repo")?.kind,
).toBe("azure-devops");
expect(
detectSourceControlProviderFromRemoteUrl("ssh://git@ssh.dev.azure.com:22/v3/org/project/repo")
?.kind,
).toBe("azure-devops");
// Legacy visualstudio.com SSH host stays classified too.
expect(
detectSourceControlProviderFromRemoteUrl("git@vs-ssh.visualstudio.com:v3/org/project/repo")
?.kind,
).toBe("azure-devops");
});

it("preserves ports while classifying by hostname", () => {
expect(
detectSourceControlProviderFromRemoteUrl("https://gitlab.com:8443/group/repo.git"),
Expand Down
10 changes: 9 additions & 1 deletion packages/shared/src/sourceControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,15 @@ function isGitLabHost(host: string): boolean {
}

function isAzureDevOpsHost(host: string): boolean {
return host === "dev.azure.com" || host.endsWith(".visualstudio.com");
// `ssh.dev.azure.com` is the default Azure DevOps SSH clone host
// (git@ssh.dev.azure.com:v3/org/project/repo), so match any `*.dev.azure.com`
// subdomain, not just the bare `dev.azure.com`. Legacy hosts stay under
// `.visualstudio.com` (including `vs-ssh.visualstudio.com`).
return (
host === "dev.azure.com" ||
host.endsWith(".dev.azure.com") ||
host.endsWith(".visualstudio.com")
);
}

function isBitbucketHost(host: string): boolean {
Expand Down
Loading