From c7026f60ae7b5ac5257277c88c419e5e10f15078 Mon Sep 17 00:00:00 2001
From: Sergei Zharinov <zharinov@users.noreply.github.com>
Date: Tue, 27 Aug 2024 16:26:53 -0300
Subject: [PATCH] refactor(packagist): Use single cache namespace (#31053)

---
 lib/modules/datasource/packagist/index.ts | 8 ++++----
 lib/util/cache/package/types.ts           | 2 --
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/modules/datasource/packagist/index.ts b/lib/modules/datasource/packagist/index.ts
index f54129488f..1284745a7e 100644
--- a/lib/modules/datasource/packagist/index.ts
+++ b/lib/modules/datasource/packagist/index.ts
@@ -86,9 +86,9 @@ export class PackagistDatasource extends Datasource {
   }
 
   @cache({
-    namespace: `datasource-${PackagistDatasource.id}-public-files`,
+    namespace: `datasource-${PackagistDatasource.id}`,
     key: (regUrl: string, regFile: RegistryFile) =>
-      PackagistDatasource.getPackagistFileUrl(regUrl, regFile),
+      `getPackagistFile:${PackagistDatasource.getPackagistFileUrl(regUrl, regFile)}`,
     cacheable: (regUrl: string) =>
       !PackagistDatasource.isPrivatePackage(regUrl),
     ttlMinutes: 1440,
@@ -125,9 +125,9 @@ export class PackagistDatasource extends Datasource {
   }
 
   @cache({
-    namespace: `datasource-${PackagistDatasource.id}-org`,
+    namespace: `datasource-${PackagistDatasource.id}`,
     key: (registryUrl: string, metadataUrl: string, packageName: string) =>
-      `${registryUrl}:${metadataUrl}:${packageName}`,
+      `packagistV2Lookup:${registryUrl}:${metadataUrl}:${packageName}`,
     ttlMinutes: 10,
   })
   async packagistV2Lookup(
diff --git a/lib/util/cache/package/types.ts b/lib/util/cache/package/types.ts
index 1ec9ff11b8..41b991b224 100644
--- a/lib/util/cache/package/types.ts
+++ b/lib/util/cache/package/types.ts
@@ -83,8 +83,6 @@ export type PackageCacheNamespace =
   | 'datasource-npm:data'
   | 'datasource-nuget-v3'
   | 'datasource-orb'
-  | 'datasource-packagist-org'
-  | 'datasource-packagist-public-files'
   | 'datasource-packagist'
   | 'datasource-pod'
   | 'datasource-python-version'
-- 
GitLab