Skip to content

Commit f883fa7

Browse files
committed
Requires baseUrl be provided to methods of BitbucketApi class
(#4045, #4070)
1 parent ad54cdf commit f883fa7

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

src/plus/integrations/providers/bitbucket.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,17 @@ export class BitbucketIntegration extends HostingIntegration<
8080
id: string,
8181
type: undefined | IssueOrPullRequestType,
8282
): Promise<IssueOrPullRequest | undefined> {
83-
return (await this.container.bitbucket)?.getIssueOrPullRequest(this, accessToken, repo.owner, repo.name, id, {
84-
baseUrl: this.apiBaseUrl,
85-
type: type,
86-
});
83+
return (await this.container.bitbucket)?.getIssueOrPullRequest(
84+
this,
85+
accessToken,
86+
repo.owner,
87+
repo.name,
88+
id,
89+
this.apiBaseUrl,
90+
{
91+
type: type,
92+
},
93+
);
8794
}
8895

8996
protected override async getProviderIssue(
@@ -109,9 +116,7 @@ export class BitbucketIntegration extends HostingIntegration<
109116
repo.owner,
110117
repo.name,
111118
branch,
112-
{
113-
baseUrl: this.apiBaseUrl,
114-
},
119+
this.apiBaseUrl,
115120
);
116121
}
117122

src/plus/integrations/providers/bitbucket/bitbucket.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ export class BitbucketApi implements Disposable {
6565
owner: string,
6666
repo: string,
6767
branch: string,
68-
options: {
69-
baseUrl: string;
70-
},
68+
baseUrl: string,
7169
): Promise<PullRequest | undefined> {
7270
const scope = getLogScope();
7371

@@ -79,7 +77,7 @@ export class BitbucketApi implements Disposable {
7977
}>(
8078
provider,
8179
token,
82-
options.baseUrl,
80+
baseUrl,
8381
`repositories/${owner}/${repo}/pullrequests?q=source.branch.name="${branch}"&fields=%2Bvalues.reviewers,%2Bvalues.participants`,
8482
{
8583
method: 'GET',
@@ -100,8 +98,8 @@ export class BitbucketApi implements Disposable {
10098
owner: string,
10199
repo: string,
102100
id: string,
103-
options: {
104-
baseUrl: string;
101+
baseUrl: string,
102+
options?: {
105103
type?: IssueOrPullRequestType;
106104
},
107105
): Promise<IssueOrPullRequest | undefined> {
@@ -112,7 +110,7 @@ export class BitbucketApi implements Disposable {
112110
const prResponse = await this.request<BitbucketPullRequest>(
113111
provider,
114112
token,
115-
options.baseUrl,
113+
baseUrl,
116114
`repositories/${owner}/${repo}/pullrequests/${id}?fields=%2Bvalues.reviewers,%2Bvalues.participants`,
117115
{
118116
method: 'GET',
@@ -136,7 +134,7 @@ export class BitbucketApi implements Disposable {
136134
const issueResponse = await this.request<BitbucketIssue>(
137135
provider,
138136
token,
139-
options.baseUrl,
137+
baseUrl,
140138
`repositories/${owner}/${repo}/issues/${id}`,
141139
{
142140
method: 'GET',
@@ -172,8 +170,8 @@ export class BitbucketApi implements Disposable {
172170
token: string,
173171
baseUrl: string,
174172
route: string,
175-
options: { method: RequestInit['method'] } & Record<string, unknown>,
176-
scope: LogScope | undefined,
173+
options?: { method: RequestInit['method'] } & Record<string, unknown>,
174+
scope?: LogScope | undefined,
177175
cancellation?: CancellationToken | undefined,
178176
): Promise<T | undefined> {
179177
const url = `${baseUrl}/${route}`;

0 commit comments

Comments
 (0)