Don't warn when parsing storeOptions for 'memory' cache

Currently, a fresh Backstage installation prints the following warning
at app startup:

"backstage warn No configuration found for cache store 'memory' at 'backend.cache.memory'. type="cacheManager""

The 'memory' cache store does not have any extra config, like
'redis' or 'infinispan'. Warning about missing configuration
can cause confusion to the users.

See config here:
https://github.com/backstage/backstage/blob/master/packages/backend-defaults/config.d.ts#L623

This warning was introduced here:
https://github.com/backstage/backstage/pull/30743/files#diff-42975462070406316e4534ce0579d1d12d54fc5cd62e239d1ae676c1e290b473R137

Signed-off-by: Valério Valério <vdv100@gmail.com>
This commit is contained in:
Valério Valério
2025-11-09 14:43:59 +02:00
parent 39591f4c27
commit 42db6a6a80
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-defaults': minor
---
Don't warn when parsing storeOptions for 'memory' cache
@@ -134,7 +134,7 @@ export class CacheManager {
): CacheStoreOptions | undefined {
const storeConfigPath = `backend.cache.${store}`;
if (!config.has(storeConfigPath)) {
if (store !== 'memory' && !config.has(storeConfigPath)) {
logger?.warn(
`No configuration found for cache store '${store}' at '${storeConfigPath}'.`,
);