From 2a16ed44637cfca1c944f9c1d06bbc9d0d44f1be Mon Sep 17 00:00:00 2001 From: Travis Shivers Date: Wed, 31 Jan 2024 15:34:16 -0600 Subject: [PATCH] feat: support digests for custom datasource Support digets for custom datasource. The getDigest method needs to exist on the custom datasource for renovate to use the digest provided from the main versions/releases endpoint. If the versions response always includes the digest, the getDigest method doesn't actually need to be implemented. https://github.com/renovatebot/renovate/blob/14b67888307e2a83219e4bb90f7f0f71f5e608bd/lib/workers/repository/process/lookup/index.ts#L446 See https://github.com/renovatebot/renovate/pull/26299 --- lib/modules/datasource/custom/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/modules/datasource/custom/index.ts b/lib/modules/datasource/custom/index.ts index 64d0fcfff9d757..384463c0aac3e3 100644 --- a/lib/modules/datasource/custom/index.ts +++ b/lib/modules/datasource/custom/index.ts @@ -2,7 +2,7 @@ import is from '@sindresorhus/is'; import jsonata from 'jsonata'; import { logger } from '../../../logger'; import { Datasource } from '../datasource'; -import type { GetReleasesConfig, ReleaseResult } from '../types'; +import type { DigestConfig, GetReleasesConfig, ReleaseResult } from '../types'; import { fetchers } from './formats'; import { ReleaseResultZodSchema } from './schema'; import { getCustomConfig } from './utils'; @@ -57,4 +57,11 @@ export class CustomDatasource extends Datasource { return null; } } + + override async getDigest( + config: DigestConfig, + newValue?: string + ): Promise { + return await Promise.reject('Not implemented'); + } }