ROX-30352: add vmcve view layer for severity aggregations#19664
ROX-30352: add vmcve view layer for severity aggregations#19664ajheflin wants to merge 1 commit intoaheflin/ROX-30352/vm-v2-service-protofrom
Conversation
Add a SQL view layer for VM CVE data following the imagecve/nodecve pattern. Provides Count, CountBySeverity, Get, and GetVMIDs methods that aggregate CVE data across VMs using the VirtualMachineCVEV2 schema. The direct vm_v2_id FK on the CVE table enables efficient VM-scoped queries without joining through scans/components. Partially generated by AI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
|
This change is part of the following stack:
Change managed by git-spice. |
|
Images are ready for the commit at d5aaca5. To use with deploy scripts, first |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## aheflin/ROX-30352/vm-v2-service-proto #19664 +/- ##
=========================================================================
- Coverage 49.38% 49.37% -0.01%
=========================================================================
Files 2743 2743
Lines 207037 207020 -17
=========================================================================
- Hits 102235 102224 -11
+ Misses 97219 97214 -5
+ Partials 7583 7582 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Part 2/6 of the VirtualMachineV2Service API stack (ROX-30352).
Adds a SQL view layer at
central/views/vmcve/following the establishedimagecve/nodecvepattern. ProvidesCount,CountBySeverity,Get, andGetVMIDsmethods that aggregate CVE data across VMs using theVirtualMachineCVEV2schema.The direct
vm_v2_idFK on the CVE table enables efficient VM-scoped queries without joining through scans/components. Multiple service endpoints in follow-up PRs depend on this view for severity-by-fixability aggregations.User-facing documentation
Testing and quality
Automated testing
Integration tests (sql_integration) to be added in a follow-up. View layer follows the same pattern as
imagecveandnodecvewhich have comprehensive test coverage.How I validated my change
go build ./central/views/vmcve/...compiles cleanlygo generatesucceeds