From 8f7f941aaffead10e7dcefadae0cf4170b9deb9a Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Wed, 30 Aug 2023 11:09:58 +0300 Subject: [PATCH] feat(docker): Increase DockerHub items to 1000 per page (#24157) --- lib/modules/datasource/docker/index.spec.ts | 12 ++++++------ lib/modules/datasource/docker/index.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/modules/datasource/docker/index.spec.ts b/lib/modules/datasource/docker/index.spec.ts index 4089c38cc6c77e..6e86d9c1f78165 100644 --- a/lib/modules/datasource/docker/index.spec.ts +++ b/lib/modules/datasource/docker/index.spec.ts @@ -1022,7 +1022,7 @@ describe('modules/datasource/docker/index', () => { 200, { tags }, { - link: '; rel="next", ', + link: '; rel="next", ', } ) .get('/') @@ -1031,7 +1031,7 @@ describe('modules/datasource/docker/index', () => { .reply(200); httpMock .scope('https://api.github.com') - .get('/user/9287/repos?page=3&per_page=100') + .get('/user/9287/repos?page=3&per_page=1000') .reply(200, { tags: ['latest'] }, {}); const config = { datasource: DockerDatasource.id, @@ -1526,7 +1526,7 @@ describe('modules/datasource/docker/index', () => { const tags = ['1.0.0']; httpMock .scope(dockerHubUrl) - .get('/library/node/tags?page_size=100') + .get('/library/node/tags?page_size=1000') .reply(404); httpMock .scope(baseUrl) @@ -1558,12 +1558,12 @@ describe('modules/datasource/docker/index', () => { process.env.RENOVATE_X_DOCKER_HUB_TAGS = 'true'; httpMock .scope(dockerHubUrl) - .get('/library/node/tags?page_size=100') + .get('/library/node/tags?page_size=1000') .reply(200, { - next: `${dockerHubUrl}/library/node/tags?page=2&page_size=100`, + next: `${dockerHubUrl}/library/node/tags?page=2&page_size=1000`, results: [{ name: '1.0.0' }], }) - .get('/library/node/tags?page=2&page_size=100') + .get('/library/node/tags?page=2&page_size=1000') .reply(200, { results: [{ name: '0.9.0' }], }); diff --git a/lib/modules/datasource/docker/index.ts b/lib/modules/datasource/docker/index.ts index 8ef267f9e069d7..6a975cac06ca74 100644 --- a/lib/modules/datasource/docker/index.ts +++ b/lib/modules/datasource/docker/index.ts @@ -829,7 +829,7 @@ export class DockerDatasource extends Datasource { let tags: string[] = []; let url: | string - | undefined = `https://hub.docker.com/v2/repositories/${dockerRepository}/tags?page_size=100`; + | undefined = `https://hub.docker.com/v2/repositories/${dockerRepository}/tags?page_size=1000`; do { const res: DockerHubTags = (await this.http.getJson(url)) .body;