Repository navigation
Migrate simple WMI Windows classes to FFM - #3175
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 (15)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (7)
📜 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). (6)
🧰 Additional context used🧠 Learnings (8)📓 Common learnings📚 Learning: 2026-04-18T03:18:03.725ZApplied to files:
📚 Learning: 2026-04-19T01:28:43.529ZApplied to files:
📚 Learning: 2026-04-15T04:56:18.352ZApplied to files:
📚 Learning: 2026-04-18T22:53:49.248ZApplied to files:
📚 Learning: 2026-04-06T04:45:47.644ZApplied to files:
📚 Learning: 2026-04-08T00:58:10.736ZApplied to files:
📚 Learning: 2026-04-03T02:07:47.621ZApplied to files:
🔇 Additional comments (7)
📝 WalkthroughWalkthroughRefactors Windows hardware drivers into a three-tier pattern: common abstract bases in oshi-common, JNA concrete implementations in oshi-core, and FFM concrete implementations in oshi-core-java25; adds new WindowsPrinter base and JNA/FFM printer implementations, renames several JNA classes, and updates HAL wiring and CHANGELOG entries. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Client/App
participant HAL as WindowsHAL
participant Impl as WindowsPrinterJNA / WindowsPrinterFFM
participant Win32 as Win32PrinterJNA / Win32PrinterFFM
participant WMI as WMI
App->>HAL: request getPrinters()
HAL->>Impl: WindowsPrinter*/getPrinters()
Impl->>Win32: queryPrinters()
Win32->>WMI: execute Win32_Printer query
WMI-->>Win32: rows of printer properties
Win32-->>Impl: parsed WmiResult rows
Impl-->>HAL: List<Printer> (constructed via parseStatus/parseErrorState)
HAL-->>App: return printers list
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 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✨ 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 #3175 +/- ##
==========================================
+ Coverage 58.41% 58.43% +0.01%
==========================================
Files 390 395 +5
Lines 18191 18295 +104
Branches 3183 3205 +22
==========================================
+ Hits 10627 10691 +64
- Misses 5992 6009 +17
- Partials 1572 1595 +23
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:
|
Create FFM implementations for WindowsBaseboard, WindowsFirmware, WindowsComputerSystem, and WindowsPrinter. These classes only depend on WMI queries, so the migration is a straightforward driver swap. - Rename JNA classes to *JNA suffix (WindowsBaseboardJNA, etc.) - Extract shared printer parsing logic to common superclass WindowsPrinter in oshi.hardware.common.platform.windows - Create FFM counterparts using WmiUtilFFM and FFM WMI drivers - Wire up FFM HAL to use new FFM implementations
36e3104 to
3ba7bc8
Compare
Create FFM implementations for WindowsBaseboard, WindowsFirmware, WindowsComputerSystem, and WindowsPrinter. These classes only depend on WMI queries, so the migration is a straightforward driver swap.
Changes
oshi-common (new):
oshi.hardware.common.platform.windows.WindowsPrinter— abstract superclass with sharedparseStatus(),parseErrorState(), andERROR_STATE_NAMESoshi-core (renames):
WindowsBaseboard→WindowsBaseboardJNAWindowsFirmware→WindowsFirmwareJNAWindowsComputerSystem→WindowsComputerSystemJNA(factory methods create JNA Firmware/Baseboard)WindowsPrinter→WindowsPrinterJNA(extends commonWindowsPrinter)WindowsHardwareAbstractionLayerupdated to use JNA-suffixed namesoshi-core-java25 (new):
WindowsBaseboardFFM— WMI viaWin32BaseBoardFFM/WmiUtilFFMWindowsFirmwareFFM— WMI viaWin32BiosFFM/WmiUtilFFMWindowsComputerSystemFFM— WMI via FFM drivers; creates FFM Firmware/BaseboardWindowsPrinterFFM— WMI viaWin32PrinterFFM/WmiUtilFFMWindowsHardwareAbstractionLayerFFMoverridescreateComputerSystem()andgetPrinters()Summary by CodeRabbit
Refactor
Improvements
Changelog
Tests