Skip to content

Commit 1f353a5

Browse files
committed
Reproduces the "Field 'statusCheckRollup' doesn't exist on type 'PullRequest'" problem
(#3923)
1 parent cb7e263 commit 1f353a5

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

src/git/remotes/remoteProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type RemoteProviderId =
2020
| 'gerrit'
2121
| 'gitea'
2222
| 'github'
23+
| 'cloud-github-enterprise'
2324
| 'gitlab'
2425
| 'google-source';
2526

src/plus/integrations/integrationService.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,9 @@ export class IntegrationService implements Disposable {
451451
return key == null ? this._connectedCache.size !== 0 : this._connectedCache.has(key);
452452
}
453453

454-
get(id: SupportedHostingIntegrationIds): Promise<HostingIntegration>;
454+
get(
455+
id: SupportedHostingIntegrationIds | SelfHostedIntegrationId.CloudGitHubEnterprise,
456+
): Promise<HostingIntegration>;
455457
get(id: SupportedIssueIntegrationIds): Promise<IssueIntegration>;
456458
get(id: SupportedSelfHostedIntegrationIds, domain: string): Promise<HostingIntegration>;
457459
get(id: SupportedIntegrationIds, domain?: string): Promise<Integration>;
@@ -758,8 +760,10 @@ export class IntegrationService implements Disposable {
758760
@log<IntegrationService['getMyCurrentAccounts']>({
759761
args: { 0: integrationIds => (integrationIds?.length ? integrationIds.join(',') : '<undefined>') },
760762
})
761-
async getMyCurrentAccounts(integrationIds: HostingIntegrationId[]): Promise<Map<HostingIntegrationId, Account>> {
762-
const accounts = new Map<HostingIntegrationId, Account>();
763+
async getMyCurrentAccounts(
764+
integrationIds: (HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise)[],
765+
): Promise<Map<HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise, Account>> {
766+
const accounts = new Map<HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise, Account>();
763767
await Promise.allSettled(
764768
integrationIds.map(async integrationId => {
765769
const integration = await this.get(integrationId);
@@ -778,7 +782,7 @@ export class IntegrationService implements Disposable {
778782
args: { 0: integrationIds => (integrationIds?.length ? integrationIds.join(',') : '<undefined>'), 1: false },
779783
})
780784
async getMyPullRequests(
781-
integrationIds?: HostingIntegrationId[],
785+
integrationIds?: (HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise)[],
782786
cancellation?: CancellationToken,
783787
silent?: boolean,
784788
): Promise<IntegrationResult<SearchedPullRequest[] | undefined>> {

src/plus/integrations/providers/github/github.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ repository {
116116
viewerPermission
117117
}
118118
`;
119+
// Removing statusCheckRollup from this fragment fixes the request, but vanishes the categorized result
119120
const gqlPullRequestFragment = `
120121
${gqlPullRequestLiteFragment}
121122
additions

src/plus/integrations/providers/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ function fromStringToEntityIdentifierProviderType(str: string): EntityIdentifier
9292
switch (str) {
9393
case 'github':
9494
return EntityIdentifierProviderType.Github;
95+
case 'cloud-github-enterprise':
96+
return EntityIdentifierProviderType.GithubEnterprise;
9597
case 'gitlab':
9698
return EntityIdentifierProviderType.Gitlab;
9799
case 'jira':

src/plus/launchpad/enrichmentService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ const supportedRemoteProvidersToEnrich: Record<RemoteProvider['id'], EnrichedIte
217217
gerrit: undefined,
218218
gitea: undefined,
219219
github: 'github',
220+
'cloud-github-enterprise': 'github',
220221
gitlab: 'gitlab',
221222
'google-source': undefined,
222223
};

src/plus/launchpad/launchpadProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Disposable, env, EventEmitter, Uri, window } from 'vscode';
88
import { md5 } from '@env/crypto';
99
import { GlCommand } from '../../constants.commands';
1010
import type { IntegrationId } from '../../constants.integrations';
11-
import { HostingIntegrationId } from '../../constants.integrations';
11+
import { HostingIntegrationId, SelfHostedIntegrationId } from '../../constants.integrations';
1212
import type { Container } from '../../container';
1313
import { CancellationError } from '../../errors';
1414
import { openComparisonChanges } from '../../git/actions/commit';
@@ -109,7 +109,8 @@ type PullRequestsWithSuggestionCounts = {
109109

110110
export type LaunchpadRefreshEvent = LaunchpadCategorizedResult;
111111

112-
export const supportedLaunchpadIntegrations = [HostingIntegrationId.GitHub, HostingIntegrationId.GitLab];
112+
export const supportedLaunchpadIntegrations: (HostingIntegrationId | SelfHostedIntegrationId.CloudGitHubEnterprise)[] =
113+
[HostingIntegrationId.GitHub, SelfHostedIntegrationId.CloudGitHubEnterprise, HostingIntegrationId.GitLab];
113114
type SupportedLaunchpadIntegrationIds = (typeof supportedLaunchpadIntegrations)[number];
114115
function isSupportedLaunchpadIntegrationId(id: string): id is SupportedLaunchpadIntegrationIds {
115116
return supportedLaunchpadIntegrations.includes(id as SupportedLaunchpadIntegrationIds);

0 commit comments

Comments
 (0)