mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 08:36:26 +00:00
refactor(bitbucket): use paginated api for commit statuses (#22329)
This commit is contained in:
parent
5597560c92
commit
48d4cf3e18
1 changed files with 9 additions and 7 deletions
|
@ -375,13 +375,15 @@ async function getStatus(
|
||||||
memCache = true
|
memCache = true
|
||||||
): Promise<BitbucketStatus[]> {
|
): Promise<BitbucketStatus[]> {
|
||||||
const sha = await getBranchCommit(branchName);
|
const sha = await getBranchCommit(branchName);
|
||||||
return utils.accumulateValues<BitbucketStatus>(
|
return (
|
||||||
// TODO: types (#7154)
|
await bitbucketHttp.getJson<PagedResult<BitbucketStatus>>(
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
`/2.0/repositories/${config.repository}/commit/${sha!}/statuses`,
|
||||||
`/2.0/repositories/${config.repository}/commit/${sha}/statuses`,
|
{
|
||||||
'get',
|
paginate: true,
|
||||||
{ memCache }
|
memCache,
|
||||||
);
|
}
|
||||||
|
)
|
||||||
|
).body.values;
|
||||||
}
|
}
|
||||||
// Returns the combined status for a branch.
|
// Returns the combined status for a branch.
|
||||||
export async function getBranchStatus(
|
export async function getBranchStatus(
|
||||||
|
|
Loading…
Reference in a new issue