feat: removes from_memory handling from API handlers to make them only serve data from DB - #4286
Conversation
…y serve data from DB
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR consolidates virtual key retrieval from in-memory governance lookups to DB-backed storage. The ChangesVirtual Key Handler DB Consolidation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Confidence Score: 5/5The change is a clean, intentional removal of a parallel read path with no correctness concerns in the remaining code. The deletion is surgical — two No files require special attention — the single changed file is straightforward. Important Files Changed
Reviews (1): Last reviewed commit: "feat: removes from_memory handling from ..." | Re-trigger Greptile |

Summary
Removes the
from_memoryquery parameter support from theGET /api/governance/virtual-keysandGET /api/governance/virtual-keys/{vk_id}endpoints. Previously, callers could bypass the config store and read virtual key data directly from in-memory governance state. These code paths have been removed so both endpoints exclusively use the config store.Changes
from_memorybranch fromgetVirtualKeys, which previously read fromGetGovernanceData, hydrated virtual keys with model config governance rules, and returned a sorted slice.from_memorybranch fromgetVirtualKey, which previously looked up a single virtual key by ID from in-memory state and applied model config governance before responding.Type of change
Affected areas
How to test
go test ./...Verify that
GET /api/governance/virtual-keys?from_memory=trueandGET /api/governance/virtual-keys/{vk_id}?from_memory=truebehave identically to requests without the parameter — the query argument should now be silently ignored and the config store response returned in both cases.Screenshots/Recordings
N/A
Breaking changes
Callers explicitly passing
from_memory=truewill no longer receive in-memory data. The parameter is now ignored and the config store is always queried. Any client relying on the in-memory read path must be updated to use the standard config store response.Related issues
N/A
Security considerations
Removing the in-memory read path reduces the surface area for stale or inconsistent data being served to callers. No auth, secrets, or PII implications.
Checklist
docs/contributing/README.mdand followed the guidelinesSummary by CodeRabbit