Repository navigation
Extract parsing logic from lspci/lshw commands - #3202
Conversation
Separate command execution from output parsing in 4 methods across 2 classes, enabling deterministic testing with fixture data: - LinuxGraphicsCard.getGraphicsCardsFromLspci() — lspci -vnnm - LinuxGraphicsCard.queryLspciMemorySize() — lspci -v -s - Lshw static initializer (parseSystemInfo) — lshw -C system - Lshw.queryCpuCapacity() — lshw -class processor Each method now has a package-private overload accepting List<String>, with the public/private method delegating after running the command. No public API changes. Added fixture-based tests covering lspci VGA/3D controller parsing, prefetchable memory size parsing, lshw system info and CPU capacity.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🧰 Additional context used🧠 Learnings (7)📚 Learning: 2026-04-06T04:45:51.516ZApplied to files:
📚 Learning: 2026-04-12T19:22:09.716ZApplied to files:
📚 Learning: 2026-04-19T01:28:47.155ZApplied to files:
📚 Learning: 2026-04-18T03:18:06.205ZApplied to files:
📚 Learning: 2026-04-11T05:51:52.684ZApplied to files:
📚 Learning: 2026-04-14T23:28:18.252ZApplied to files:
📚 Learning: 2026-04-06T22:30:07.083ZApplied to files:
🔇 Additional comments (4)
📝 WalkthroughWalkthroughRefactored Linux graphics card and system info discovery to decouple command execution from parsing. Added package-private overloads accepting precomputed output and injected lookup functions, enabling testability without system calls. Existing public methods delegate to new parsing logic. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
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✨ Simplify code
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3202 +/- ##
==========================================
+ Coverage 58.39% 58.61% +0.22%
==========================================
Files 421 421
Lines 20351 20355 +4
Branches 3576 3576
==========================================
+ Hits 11883 11932 +49
+ Misses 6716 6674 -42
+ Partials 1752 1749 -3
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:
|
Resolves part of #3189.
Separates command execution from output parsing in 4 methods across 2 classes:
Refactored methods:
LinuxGraphicsCard.getGraphicsCardsFromLspci()—lspci -vnnmLinuxGraphicsCard.queryLspciMemorySize()—lspci -v -sLshwstatic initializer → newparseSystemInfo(List<String>)—lshw -C systemLshw.queryCpuCapacity()—lshw -class processorTests added to LinuxGraphicsCardTest:
Tests added to LshwTest:
No public API changes. No new dependencies.
Summary by CodeRabbit
Refactor
Tests