Skip to content

Commit

Permalink
refactor(bitbucket): use paginated api for commit statuses (#22329)
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed May 22, 2023
1 parent 5597560 commit 48d4cf3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/modules/platform/bitbucket/index.ts
Expand Up @@ -375,13 +375,15 @@ async function getStatus(
memCache = true
): Promise<BitbucketStatus[]> {
const sha = await getBranchCommit(branchName);
return utils.accumulateValues<BitbucketStatus>(
// TODO: types (#7154)
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`/2.0/repositories/${config.repository}/commit/${sha}/statuses`,
'get',
{ memCache }
);
return (
await bitbucketHttp.getJson<PagedResult<BitbucketStatus>>(
`/2.0/repositories/${config.repository}/commit/${sha!}/statuses`,
{
paginate: true,
memCache,
}
)
).body.values;
}
// Returns the combined status for a branch.
export async function getBranchStatus(
Expand Down

0 comments on commit 48d4cf3

Please sign in to comment.