@@ -19,8 +19,9 @@ import type {
19
19
IntegrationAuthenticationProviderDescriptor ,
20
20
IntegrationAuthenticationService ,
21
21
} from '../authentication/integrationAuthentication' ;
22
- import type { RepositoryDescriptor , SupportedIntegrationIds } from '../integration' ;
22
+ import type { RepositoryDescriptor } from '../integration' ;
23
23
import { HostingIntegration } from '../integration' ;
24
+ import type { GitHubRelatedIntegrationIds } from './github/github.utils' ;
24
25
import { getGitHubPullRequestIdentityFromMaybeUrl } from './github/github.utils' ;
25
26
import { providersMetadata } from './models' ;
26
27
import type { ProvidersApi } from './providersApi' ;
@@ -44,7 +45,7 @@ const cloudEnterpriseAuthProvider: IntegrationAuthenticationProviderDescriptor =
44
45
45
46
export type GitHubRepositoryDescriptor = RepositoryDescriptor ;
46
47
47
- abstract class GitHubIntegrationBase < ID extends SupportedIntegrationIds > extends HostingIntegration <
48
+ abstract class GitHubIntegrationBase < ID extends GitHubRelatedIntegrationIds > extends HostingIntegration <
48
49
ID ,
49
50
GitHubRepositoryDescriptor
50
51
> {
@@ -266,6 +267,16 @@ abstract class GitHubIntegrationBase<ID extends SupportedIntegrationIds> extends
266
267
baseUrl : this . apiBaseUrl ,
267
268
} ) ;
268
269
}
270
+
271
+ protected override getProviderPullRequestIdentityFromMaybeUrl ( search : string ) : PullRequestUrlIdentity | undefined {
272
+ const identity = getGitHubPullRequestIdentityFromMaybeUrl ( search ) ;
273
+ if ( identity == null ) return undefined ;
274
+
275
+ return {
276
+ ...identity ,
277
+ provider : this . id ,
278
+ } ;
279
+ }
269
280
}
270
281
271
282
export class GitHubIntegration extends GitHubIntegrationBase < HostingIntegrationId . GitHub > {
@@ -300,10 +311,6 @@ export class GitHubIntegration extends GitHubIntegrationBase<HostingIntegrationI
300
311
super . refresh ( ) ;
301
312
}
302
313
}
303
-
304
- protected override getProviderPullRequestIdentityFromMaybeUrl ( search : string ) : PullRequestUrlIdentity | undefined {
305
- return getGitHubPullRequestIdentityFromMaybeUrl ( search ) ;
306
- }
307
314
}
308
315
309
316
export class GitHubEnterpriseIntegration extends GitHubIntegrationBase <
0 commit comments