migrate-valkey-config
Backstage 1.46.0 codemod: Migrate Valkey cache configuration to new native options.
Background
The Valkey cache configuration in @backstage/backend-defaults@0.14.0 now uses Valkey-native options. Projects using store: valkey must update their app-config.yaml to replace namespace/keyPrefixSeparator with keyPrefix and remove unsupported clearBatchSize/useUnlink options.
What it does
- Scans
app-config.yamlandapp-config.*.yamlfiles - Detects
backend.cache.store: valkeyconfiguration - Combines
namespace+keyPrefixSeparatorintokeyPrefix - If only
namespaceexists (no separator), uses:as default separator - Removes
clearBatchSizeanduseUnlinkoptions (no Valkey equivalent) - Does NOT modify
store: redisconfigurations - Adds a migration comment documenting the change
Usage
bash
Known limitations
- Dotted-key form is not supported. The codemod only handles the nested
YAML form (backend: cache: store: …). If your config uses dotted keys
(e.g.backend.cache.store: valkey), you must migrate those entries manually.
Notes
- Only applies to
store: valkey— Redis configurations are untouched - If
keyPrefixalready exists alongsidenamespace,keyPrefixis preserved andnamespaceis removed - YAML comments near the modified keys are preserved where possible