From 674ace8ee51b4f31c4c8869f2022ef39ca8fafc6 Mon Sep 17 00:00:00 2001
From: Sergei Zharinov <zharinov@users.noreply.github.com>
Date: Sun, 10 Mar 2024 10:07:57 -0300
Subject: [PATCH] refactor(github): Change github-related field types for repo
 cache (#27784)

---
 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 8451749b3c..e7152a3488 100644
--- a/lib/modules/platform/github/pr.ts
+++ b/lib/modules/platform/github/pr.ts
@@ -12,7 +12,6 @@ function getPrApiCache(): ApiCache<GhPr> {
   const repoCache = getCache();
   repoCache.platform ??= {};
   repoCache.platform.github ??= {};
-  delete repoCache.platform.github.prCache;
   repoCache.platform.github.pullRequestsCache ??= { items: {} };
   const prApiCache = new ApiCache<GhPr>(
     repoCache.platform.github.pullRequestsCache as ApiPageCache<GhPr>,
diff --git a/lib/util/cache/repository/types.ts b/lib/util/cache/repository/types.ts
index d34303176a..ac9a5ee175 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<string, unknown>;
+    github?: {
+      /**
+       * To avoid circular dependency problem, we use `unknown` type here.
+       */
+      pullRequestsCache?: unknown;
+      graphqlPageCache?: unknown;
+    };
     bitbucket?: {
       pullRequestsCache?: BitbucketPrCacheData;
     };
-- 
GitLab