fix: gate cached meta overlay on version newer than embedded#1376
fix: gate cached meta overlay on version newer than embedded#1376GeekyMax wants to merge 1 commit into
Conversation
Change-Id: I4117eaef2c24b91745a7b3cf01af314b1ea47a11
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR gates cached service registry overlays on version comparison: embedded baseline definitions are now replaced by cached definitions only when the cache version is strictly newer. The change adds an ChangesRegistry overlay version gating
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Cached remote meta was overlaid onto the embedded
meta_data.jsonunconditionally. Because the embedded data version is not bumped on each CLI release, a cache with the same (or older) version would shadow the freshly shipped embedded command definitions — so after upgrading the CLI, newly bundled commands were never used.Changes
InitWithBrand(internal/registry/loader.go) onupdate.IsNewer(cached.Version, embeddedVersion): only overlay when the cache version is strictly newer than the embedded baselineinternal/registry/loader_test.gowith unit tests for the gate (equal / older / newer / unparseable / empty-embedded)internal/registry/remote_test.gofrom the ambient embedded version (the CI-fetchedmeta_data.json)Test Plan
make unit-testpassed (go test ./internal/registry/, both real and default embedded meta, deterministic)version == embedded) → injected service absent; bumped cache to a newer version → service overlaid; unparseable version → falls back to embedded, exit 0Related Issues
N/A
Summary by CodeRabbit