Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
refactor(bitbucket): use paginated api for tags (#22336)
  • Loading branch information
setchy committed May 22, 2023
1 parent 5000a62 commit 550ab80
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/modules/datasource/bitbucket-tags/index.ts
Expand Up @@ -2,7 +2,6 @@ import { cache } from '../../../util/cache/package/decorator';
import { BitbucketHttp } from '../../../util/http/bitbucket';
import { ensureTrailingSlash } from '../../../util/url';
import type { PagedResult, RepoInfoBody } from '../../platform/bitbucket/types';
import * as utils from '../../platform/bitbucket/utils';
import { Datasource } from '../datasource';
import type { DigestConfig, GetReleasesConfig, ReleaseResult } from '../types';
import type { BitbucketCommit, BitbucketTag } from './types';
Expand Down Expand Up @@ -56,7 +55,11 @@ export class BitbucketTagsDatasource extends Datasource {
packageName: repo,
}: GetReleasesConfig): Promise<ReleaseResult | null> {
const url = `/2.0/repositories/${repo}/refs/tags`;
const bitbucketTags = await utils.accumulateValues(url);
const bitbucketTags = (
await this.bitbucketHttp.getJson<PagedResult<BitbucketTag>>(url, {
paginate: true,
})
).body.values;

const dependency: ReleaseResult = {
sourceUrl: BitbucketTagsDatasource.getSourceUrl(repo, registryUrl),
Expand Down

0 comments on commit 550ab80

Please sign in to comment.