You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor: Align CUE compatibility caching with pkg/cache #161
Is your feature request related to a problem? Please describe. cue/upgrade keeps its own LRU for template compatibility checks (cue/upgrade/cache.go: lruCache, keyed by the SHA-256 of the template, with its own eviction loop). pkg now has a shared LRU, cache.LRUStore (cache/lru.go, #138), so there are two LRU implementations in the same module to maintain.
Describe the solution you'd like
Back the compatibility cache with cache.LRUStore and delete the private lruCache, keeping behaviour the same:
--cue-compatibility-cache-size / CompatibilityCacheSize still sets the entry limit, and InitCompatibilityCache can still be called more than once (tests do), stopping the previous store's sweeper.
Size 0 disables the cache today (put returns early when capacity is 0). LRUStore treats MaxSize <= 0 as unlimited, so 0 needs handling explicitly.
Entries expire an hour after they were last used (CacheEntryTTL, refreshed on every hit). LRUStore's TTL counts from when the entry was stored, so either refresh the entry on a hit or add sliding expiry to LRUStore; say which in the PR.
Tests cover both of those, plus eviction at the size limit.
Describe alternatives you've considered
Leaving both LRUs in place: works, but two caches with slightly different rules is what this tidies up.
Additional context
Moved from kubevela/workflow#256. Once this is released, workflow and kubevela pick it up with their next pkg bump; nothing to change on their side.
changed the title [-]Decision: No workflow change for CUE compatibility cache (pkg/cue/upgrade)[/-][+]Consider aligning CUE compatibility caching with pkg/cache (if needed)[/+]on Aug 24, 2026
changed the title [-]Consider aligning CUE compatibility caching with pkg/cache (if needed)[/-][+]Refactor: Align CUE compatibility caching with pkg/cache[/+]on Aug 24, 2026
Hi! I'm new to open source and was reading this issue about aligning the CUE compatibility caching with the shared pkg/cache surface. The workflow-side work being mostly a dependency bump plus smoke tests sounds nicely scoped, and I like that it avoids duplicating the cache inside workflow. I'd love to take this on — would a PR be welcome?
Sorry for the slow reply on this. It's moved from workflow to pkg and the scope has changed: it's now just the pkg side (see the updated description), with a couple of behaviour details to watch. Still keen? If so it's yours.
Activity
[-]Decision: No workflow change for CUE compatibility cache (pkg/cue/upgrade)[/-][+]Consider aligning CUE compatibility caching with pkg/cache (if needed)[/+][-]Consider aligning CUE compatibility caching with pkg/cache (if needed)[/-][+]Refactor: Align CUE compatibility caching with pkg/cache[/+]rahimuddin140 commentedon Oct 17, 2026
Hi! I'm new to open source and was reading this issue about aligning the CUE compatibility caching with the shared
pkg/cachesurface. The workflow-side work being mostly a dependency bump plus smoke tests sounds nicely scoped, and I like that it avoids duplicating the cache inside workflow. I'd love to take this on — would a PR be welcome?briankane commentedon Nov 21, 2026
Sorry for the slow reply on this. It's moved from workflow to pkg and the scope has changed: it's now just the pkg side (see the updated description), with a couple of behaviour details to watch. Still keen? If so it's yours.