Skip to content

Commit 94babd5

Browse files
committed
Requires baseUrl be provided to methods of BitbucketApi class
(#4045, 4070)
1 parent 2297cf5 commit 94babd5

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

src/plus/integrations/providers/bitbucket.ts

+12-7
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,17 @@ export class BitbucketIntegration extends HostingIntegration<
8585
id: string,
8686
type: undefined | IssueOrPullRequestType,
8787
): Promise<IssueOrPullRequest | undefined> {
88-
return (await this.container.bitbucket)?.getIssueOrPullRequest(this, accessToken, repo.owner, repo.name, id, {
89-
baseUrl: this.apiBaseUrl,
90-
type: type,
91-
});
88+
return (await this.container.bitbucket)?.getIssueOrPullRequest(
89+
this,
90+
accessToken,
91+
repo.owner,
92+
repo.name,
93+
id,
94+
this.apiBaseUrl,
95+
{
96+
type: type,
97+
},
98+
);
9299
}
93100

94101
protected override async getProviderIssue(
@@ -114,9 +121,7 @@ export class BitbucketIntegration extends HostingIntegration<
114121
repo.owner,
115122
repo.name,
116123
branch,
117-
{
118-
baseUrl: this.apiBaseUrl,
119-
},
124+
this.apiBaseUrl,
120125
);
121126
}
122127

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

+8-10
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)