From 4850110f3635a6ee52540d58442ffcd257cfae0b Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Tue, 31 Oct 2023 09:55:24 -0400 Subject: [PATCH] fix(versionCompatibility): support digest updates (#25518) --- .../repository/process/lookup/index.spec.ts | 18 +++++++++++++++++- lib/workers/repository/process/lookup/index.ts | 3 +-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index 8b51b70312..3c4b49507f 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -1747,20 +1747,36 @@ describe('workers/repository/process/lookup/index', () => { it('applies versionCompatibility for 18.10.0', async () => { config.currentValue = '18.10.0-alpine'; + config.currentDigest = 'aaa111'; config.packageName = 'node'; config.versioning = nodeVersioningId; config.versionCompatibility = '^(?[^-]+)(?-.*)?$'; config.datasource = DockerDatasource.id; getDockerReleases.mockResolvedValueOnce({ releases: [ + { version: '18.10.0' }, { version: '18.18.0' }, { version: '18.19.0-alpine' }, { version: '18.20.0' }, ], }); + getDockerDigest.mockResolvedValueOnce('bbb222'); + getDockerDigest.mockResolvedValueOnce('ccc333'); const res = await lookup.lookupUpdates(config); + expect(res.updates).toHaveLength(2); expect(res).toMatchObject({ - updates: [{ newValue: '18.19.0-alpine', updateType: 'minor' }], + updates: [ + { + newValue: '18.19.0-alpine', + newDigest: 'bbb222', + updateType: 'minor', + }, + { + newValue: '18.10.0-alpine', + newDigest: 'ccc333', + updateType: 'digest', + }, + ], }); }); diff --git a/lib/workers/repository/process/lookup/index.ts b/lib/workers/repository/process/lookup/index.ts index 6e6273069e..d061bf8fec 100644 --- a/lib/workers/repository/process/lookup/index.ts +++ b/lib/workers/repository/process/lookup/index.ts @@ -419,8 +419,7 @@ export async function lookupUpdates( // digest update res.updates.push({ updateType: 'digest', - // TODO #22198 - newValue: config.currentValue!, + newValue: compareValue, }); } } else if (config.pinDigests) {