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
1 change: 1 addition & 0 deletions src/git/remotes/remoteProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type RemoteProviderId =
| 'gerrit'
| 'gitea'
| 'github'
| 'cloud-github-enterprise'
| 'gitlab'
| 'google-source';

Expand Down
17 changes: 12 additions & 5 deletions src/plus/integrations/integrationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,9 @@ export class IntegrationService implements Disposable {
return key == null ? this._connectedCache.size !== 0 : this._connectedCache.has(key);
}

get(id: SupportedHostingIntegrationIds): Promise<HostingIntegration>;
get(
id: SupportedHostingIntegrationIds | SelfHostedIntegrationId.CloudGitHubEnterprise,
): Promise<HostingIntegration>;
get(id: SupportedIssueIntegrationIds): Promise<IssueIntegration>;
get(id: SupportedSelfHostedIntegrationIds, domain: string): Promise<HostingIntegration>;
get(id: SupportedIntegrationIds, domain?: string): Promise<Integration>;
Expand Down Expand Up @@ -760,8 +762,10 @@ export class IntegrationService implements Disposable {
@log<IntegrationService['getMyCurrentAccounts']>({
args: { 0: integrationIds => (integrationIds?.length ? integrationIds.join(',') : '<undefined>') },
})
async getMyCurrentAccounts(integrationIds: HostingIntegrationId[]): Promise<Map<HostingIntegrationId, Account>> {
const accounts = new Map<HostingIntegrationId, Account>();
async getMyCurrentAccounts(
integrationIds: (HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise)[],
): Promise<Map<HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise, Account>> {
const accounts = new Map<HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise, Account>();
await Promise.allSettled(
integrationIds.map(async integrationId => {
const integration = await this.get(integrationId);
Expand All @@ -780,13 +784,16 @@ export class IntegrationService implements Disposable {
args: { 0: integrationIds => (integrationIds?.length ? integrationIds.join(',') : '<undefined>'), 1: false },
})
async getMyPullRequests(
integrationIds?: HostingIntegrationId[],
integrationIds?: (HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise)[],
cancellation?: CancellationToken,
silent?: boolean,
): Promise<IntegrationResult<SearchedPullRequest[] | undefined>> {
const integrations: Map<HostingIntegration, ResourceDescriptor[] | undefined> = 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);
Expand Down
2 changes: 2 additions & 0 deletions src/plus/integrations/providers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
1 change: 1 addition & 0 deletions src/plus/launchpad/enrichmentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ const supportedRemoteProvidersToEnrich: Record<RemoteProvider['id'], EnrichedIte
gerrit: undefined,
gitea: undefined,
github: 'github',
'cloud-github-enterprise': 'github',
gitlab: 'gitlab',
'google-source': undefined,
};
Expand Down
2 changes: 2 additions & 0 deletions src/plus/launchpad/launchpad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1567,6 +1567,7 @@ function getOpenOnGitProviderQuickInputButton(integrationId: string): QuickInput
return OpenOnGitLabQuickInputButton;
case HostingIntegrationId.GitHub:
case SelfHostedIntegrationId.GitHubEnterprise:
case SelfHostedIntegrationId.CloudGitHubEnterprise:
return OpenOnGitHubQuickInputButton;
default:
return undefined;
Expand All @@ -1585,6 +1586,7 @@ function getIntegrationTitle(integrationId: string): string {
return 'GitLab';
case HostingIntegrationId.GitHub:
case SelfHostedIntegrationId.GitHubEnterprise:
case SelfHostedIntegrationId.CloudGitHubEnterprise:
return 'GitHub';
default:
return integrationId;
Expand Down
5 changes: 3 additions & 2 deletions src/plus/launchpad/launchpadProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Disposable, env, EventEmitter, Uri, window } from 'vscode';
import { md5 } from '@env/crypto';
import { GlCommand } from '../../constants.commands';
import type { IntegrationId } from '../../constants.integrations';
import { HostingIntegrationId } from '../../constants.integrations';
import { HostingIntegrationId, SelfHostedIntegrationId } from '../../constants.integrations';
import type { Container } from '../../container';
import { CancellationError } from '../../errors';
import { openComparisonChanges } from '../../git/actions/commit';
Expand Down Expand Up @@ -109,7 +109,8 @@ type PullRequestsWithSuggestionCounts = {

export type LaunchpadRefreshEvent = LaunchpadCategorizedResult;

export const supportedLaunchpadIntegrations = [HostingIntegrationId.GitHub, HostingIntegrationId.GitLab];
export const supportedLaunchpadIntegrations: (HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise)[] =
[HostingIntegrationId.GitHub, SelfHostedIntegrationId.CloudGitHubEnterprise, HostingIntegrationId.GitLab];
type SupportedLaunchpadIntegrationIds = (typeof supportedLaunchpadIntegrations)[number];
function isSupportedLaunchpadIntegrationId(id: string): id is SupportedLaunchpadIntegrationIds {
return supportedLaunchpadIntegrations.includes(id as SupportedLaunchpadIntegrationIds);
Expand Down
Loading