Skip to content

Commit

Permalink
Checks the Azure's domain and only return if it's non-enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeibbb committed Jan 28, 2025
1 parent a317c9c commit 9912e81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/plus/integrations/integrationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import type {
SupportedIssueIntegrationIds,
SupportedSelfHostedIntegrationIds,
} from './integration';
import { isAzureCloudDomain } from './providers/azureDevOps';
import { isCloudSelfHostedIntegrationId, isHostingIntegrationId, isSelfHostedIntegrationId } from './providers/models';
import type { ProvidersApi } from './providers/providersApi';
import { isGitHubDotCom, isGitLabDotCom } from './providers/utils';
Expand Down Expand Up @@ -671,7 +672,10 @@ export class IntegrationService implements Disposable {
// case 'bitbucket':
// return get(HostingIntegrationId.Bitbucket) as RT;
case 'azure-devops':
return get(HostingIntegrationId.AzureDevOps) as RT;
if (isAzureCloudDomain(remote.provider.domain)) {
return get(HostingIntegrationId.AzureDevOps) as RT;
}
return (getOrGetCached === this.get ? Promise.resolve(undefined) : undefined) as RT;
case 'github':
if (remote.provider.domain != null && !isGitHubDotCom(remote.provider.domain)) {
return get(
Expand Down
5 changes: 5 additions & 0 deletions src/plus/integrations/providers/azureDevOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,8 @@ export class AzureDevOpsIntegration extends HostingIntegration<
return Promise.resolve(undefined);
}
}

const azureCloudDomainRegex = /^dev\.azure\.com$|\bvisualstudio\.com$/i;
export function isAzureCloudDomain(domain: string | undefined): boolean {
return domain != null && azureCloudDomainRegex.test(domain);
}

0 comments on commit 9912e81

Please sign in to comment.