Skip to content

Commit

Permalink
fix(versionCompatibility): support digest updates (#25518)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Oct 31, 2023
1 parent bece5a1 commit 4850110
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
18 changes: 17 additions & 1 deletion lib/workers/repository/process/lookup/index.spec.ts
Expand Up @@ -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 = '^(?<version>[^-]+)(?<compatibility>-.*)?$';
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',
},
],
});
});

Expand Down
3 changes: 1 addition & 2 deletions lib/workers/repository/process/lookup/index.ts
Expand Up @@ -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) {
Expand Down

0 comments on commit 4850110

Please sign in to comment.