Skip to content

Commit 93b18df

Browse files
committed
Unifies handling of pull request URL identities
by introducing a protected method for provider-specific implementations. (#3788, #3795)
1 parent 93869e7 commit 93b18df

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/plus/integrations/integration.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,5 +1363,9 @@ export abstract class HostingIntegration<
13631363
cancellation?: CancellationToken,
13641364
): Promise<PullRequest[] | undefined>;
13651365

1366-
getPullRequestIdentityFromMaybeUrl?(search: string): PullRequestUrlIdentity | undefined;
1366+
getPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined {
1367+
return this.getProviderPullRequestIdentityFromMaybeUrl?.(search);
1368+
}
1369+
1370+
protected getProviderPullRequestIdentityFromMaybeUrl?(search: string): PullRequestUrlIdentity | undefined;
13671371
}

src/plus/integrations/providers/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export class GitHubIntegration extends GitHubIntegrationBase<HostingIntegrationI
295295
}
296296
}
297297

298-
override getPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined {
298+
protected override getProviderPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined {
299299
return getGitHubPullRequestIdentityFromMaybeUrl(search);
300300
}
301301
}

src/plus/integrations/providers/gitlab.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ abstract class GitLabIntegrationBase<
396396
};
397397
}
398398

399-
override getPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined {
399+
protected override getProviderPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined {
400400
return getGitLabPullRequestIdentityFromMaybeUrl(search);
401401
}
402402
}

src/plus/launchpad/launchpadProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ export class LaunchpadProvider implements Disposable {
598598
for (const integrationId of supportedLaunchpadIntegrations) {
599599
if (connectedIntegrations.get(integrationId)) {
600600
const integration = await this.container.integrations.get(integrationId);
601-
const prIdentity = integration.getPullRequestIdentityFromMaybeUrl?.(search);
601+
const prIdentity = integration.getPullRequestIdentityFromMaybeUrl(search);
602602
if (prIdentity) {
603603
return prIdentity;
604604
}

0 commit comments

Comments
 (0)