Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(bitbucket): use paginated api for tags #22336

Merged
merged 2 commits into from May 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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