diff --git a/src/git/remotes/remoteProvider.ts b/src/git/remotes/remoteProvider.ts index 7a18ab1eccf28..e556f59d09e2e 100644 --- a/src/git/remotes/remoteProvider.ts +++ b/src/git/remotes/remoteProvider.ts @@ -20,6 +20,7 @@ export type RemoteProviderId = | 'gerrit' | 'gitea' | 'github' + | 'cloud-github-enterprise' | 'gitlab' | 'google-source'; diff --git a/src/plus/integrations/integrationService.ts b/src/plus/integrations/integrationService.ts index b408da716bc79..bdef3bbd2d1d2 100644 --- a/src/plus/integrations/integrationService.ts +++ b/src/plus/integrations/integrationService.ts @@ -451,7 +451,9 @@ export class IntegrationService implements Disposable { return key == null ? this._connectedCache.size !== 0 : this._connectedCache.has(key); } - get(id: SupportedHostingIntegrationIds): Promise; + get( + id: SupportedHostingIntegrationIds | SelfHostedIntegrationId.CloudGitHubEnterprise, + ): Promise; get(id: SupportedIssueIntegrationIds): Promise; get(id: SupportedSelfHostedIntegrationIds, domain: string): Promise; get(id: SupportedIntegrationIds, domain?: string): Promise; @@ -760,8 +762,10 @@ export class IntegrationService implements Disposable { @log({ args: { 0: integrationIds => (integrationIds?.length ? integrationIds.join(',') : '') }, }) - async getMyCurrentAccounts(integrationIds: HostingIntegrationId[]): Promise> { - const accounts = new Map(); + async getMyCurrentAccounts( + integrationIds: (HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise)[], + ): Promise> { + const accounts = new Map(); await Promise.allSettled( integrationIds.map(async integrationId => { const integration = await this.get(integrationId); @@ -780,13 +784,16 @@ export class IntegrationService implements Disposable { args: { 0: integrationIds => (integrationIds?.length ? integrationIds.join(',') : ''), 1: false }, }) async getMyPullRequests( - integrationIds?: HostingIntegrationId[], + integrationIds?: (HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise)[], cancellation?: CancellationToken, silent?: boolean, ): Promise> { const integrations: Map = new Map(); for (const integrationId of integrationIds?.length ? integrationIds : Object.values(HostingIntegrationId)) { - const integration = await this.get(integrationId); + let integration; + try { + integration = await this.get(integrationId); + } catch {} if (integration == null) continue; integrations.set(integration, undefined); diff --git a/src/plus/integrations/providers/utils.ts b/src/plus/integrations/providers/utils.ts index 63a3d2082fb19..1afb66562ef29 100644 --- a/src/plus/integrations/providers/utils.ts +++ b/src/plus/integrations/providers/utils.ts @@ -92,6 +92,8 @@ function fromStringToEntityIdentifierProviderType(str: string): EntityIdentifier switch (str) { case 'github': return EntityIdentifierProviderType.Github; + case 'cloud-github-enterprise': + return EntityIdentifierProviderType.GithubEnterprise; case 'gitlab': return EntityIdentifierProviderType.Gitlab; case 'jira': diff --git a/src/plus/launchpad/enrichmentService.ts b/src/plus/launchpad/enrichmentService.ts index 41df13d68f9f4..82f528df09ee6 100644 --- a/src/plus/launchpad/enrichmentService.ts +++ b/src/plus/launchpad/enrichmentService.ts @@ -217,6 +217,7 @@ const supportedRemoteProvidersToEnrich: Record