Repository navigation
Move Linux HAL and hardware classes to oshi-common - #3138
Conversation
|
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 (41)
✅ Files skipped from review due to trivial changes (22)
🚧 Files skipped from review as they are similar to previous changes (16)
📜 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). (9)
🧰 Additional context used🧠 Learnings (11)📓 Common learnings📚 Learning: 2026-04-05T16:15:06.124ZApplied to files:
📚 Learning: 2026-04-06T04:45:47.644ZApplied to files:
📚 Learning: 2026-04-05T05:40:45.797ZApplied to files:
📚 Learning: 2026-04-05T05:39:21.126ZApplied to files:
📚 Learning: 2026-04-06T04:45:51.516ZApplied to files:
📚 Learning: 2026-04-05T05:40:43.357ZApplied to files:
📚 Learning: 2026-04-05T15:37:17.867ZApplied to files:
📚 Learning: 2026-04-03T02:07:47.621ZApplied to files:
📚 Learning: 2026-04-05T05:39:18.791ZApplied to files:
📚 Learning: 2026-03-29T20:01:06.452ZApplied to files:
🔇 Additional comments (5)
📝 WalkthroughWalkthroughMove many Linux/Unix platform classes into Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ 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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3138 +/- ##
============================================
+ Coverage 61.14% 62.30% +1.15%
Complexity 12 12
============================================
Files 39 39
Lines 2329 2329
Branches 407 407
============================================
+ Hits 1424 1451 +27
+ Misses 786 768 -18
+ Partials 119 110 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Move LinuxHardwareAbstractionLayer and its non-native dependencies (LinuxComputerSystem, LinuxFirmware, LinuxBaseboard, LinuxSensors, LinuxSoundCard) to oshi-common. Move UnixDisplay and Xrandr driver to oshi-common. Make getPrinters() use interface default (empty list) on common HAL, pushed down to JNA (UnixPrinter) and FFM (CupsPrinter) subclasses. Make getGraphicsCards() abstract on common HAL due to LinuxGraphicsCard -> LinuxGpuStats -> NvmlUtil JNA dependency chain. Move 8 native-free Linux hardware base classes to oshi-common: LinuxCentralProcessor, LinuxGlobalMemory, LinuxHWDiskStore, LinuxLogicalVolumeGroup, LinuxNetworkIF, LinuxPowerSource, LinuxUsbDevice, and LinuxVirtualMemory. LinuxCentralProcessor and LinuxLogicalVolumeGroup made public for cross-package subclass access. Updated imports in all JNA and FFM subclasses. Moved LinuxPowerSourceTest to oshi-common. LinuxGraphicsCard and LinuxGpuStats remain in oshi-core due to NvmlUtil (JNA) dependency in createStatsSession().
Moves the Linux hardware abstraction layer and all native-free Linux hardware base classes from
oshi-core(oshi.hardware.platform.linux) tooshi-common(oshi.hardware.common.platform.linux), so both JNA and FFM subclasses extend from a shared module.HAL and dependencies
LinuxHardwareAbstractionLayer(abstract) —getPrinters()removed (interface default returns empty list),getGraphicsCards()made abstractLinuxComputerSystem,LinuxFirmware,LinuxBaseboard,LinuxSensors,LinuxSoundCardUnixDisplay→oshi.hardware.common.platform.unixXrandrdriver →oshi.util.driver.unixHardware base classes
LinuxCentralProcessorpublic)LinuxHWDiskStoreLinuxLogicalVolumeGrouppublic)LinuxNetworkIFLinuxPowerSourceLinuxUsbDeviceLinuxGlobalMemoryLinuxVirtualMemoryNot moved
LinuxGraphicsCardandLinuxGpuStatsremain inoshi-core—createStatsSession()instantiatesLinuxGpuStatswhich depends onNvmlUtil(JNA). These need a JNA/FFM split before they can move.Import updates
All JNA subclasses in
oshi-coreand FFM subclasses inoshi-core-java25updated with explicit imports for the relocated base classes.LinuxPowerSourceTestmoved tooshi-commontest tree.module-info.javaalready exported the target package from the prior HAL work.Summary by CodeRabbit
New Features
Refactor