From 7b167af880f7be5557e4d3e39aa436f4e378fa17 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 7 Mar 2024 15:57:04 -0300 Subject: [PATCH] refactor(github): Change github-related field types for repo cache --- lib/modules/platform/github/pr.ts | 1 - lib/util/cache/repository/types.ts | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/modules/platform/github/pr.ts b/lib/modules/platform/github/pr.ts index 8451749b3c889d..e7152a34888239 100644 --- a/lib/modules/platform/github/pr.ts +++ b/lib/modules/platform/github/pr.ts @@ -12,7 +12,6 @@ function getPrApiCache(): ApiCache { const repoCache = getCache(); repoCache.platform ??= {}; repoCache.platform.github ??= {}; - delete repoCache.platform.github.prCache; repoCache.platform.github.pullRequestsCache ??= { items: {} }; const prApiCache = new ApiCache( repoCache.platform.github.pullRequestsCache as ApiPageCache, diff --git a/lib/util/cache/repository/types.ts b/lib/util/cache/repository/types.ts index d34303176a2f21..ac9a5ee175be4a 100644 --- a/lib/util/cache/repository/types.ts +++ b/lib/util/cache/repository/types.ts @@ -144,7 +144,13 @@ export interface RepoCacheData { gitea?: { pullRequestsCache?: GiteaPrCacheData; }; - github?: Record; + github?: { + /** + * To avoid circular dependency problem, we use `unknown` type here. + */ + pullRequestsCache?: unknown; + graphqlPageCache?: unknown; + }; bitbucket?: { pullRequestsCache?: BitbucketPrCacheData; };