Repository navigation
Add NetBSD platform support - #3307
Conversation
Copy OpenBSD platform implementation to NetBSD with key adaptations: - ps uses -L flag with 'lid' keyword (not -H/tid) for LWP display - Process args from /proc/PID/cmdline (KERN_PROC_ARGS sysctl fails) - System.getenv() for current process environment variables - CPU info from machdep.cpu_brand and machdep.tsc_freq - _lwp_self() for thread IDs (not getthrid()) - KERN_CP_TIME (51) with per-CPU via third MIB element - vmstat -s for memory stats (no Bcachestats struct) - readlink /proc/PID/cwd for working directory - fstat -p for open file count - CTL_VM=2, removed OpenBSD-specific VFS/buffer cache code GitHub Actions workflow uses vmactions/netbsd-vm with JNA from pkgsrc. All tests pass (0 failures in both oshi-common and oshi-core).
📝 WalkthroughWalkthroughThis PR adds complete NetBSD 10.1 support to OSHI by implementing platform-specific hardware, OS, and process introspection across ~3,300 lines of new code spanning module exports, JNA bindings, hardware drivers, operating system abstractions, filesystem/network stacks, comprehensive testing, and GitHub Actions CI infrastructure. ChangesNetBSD Platform Support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested reviewers
🚥 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🧪 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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3307 +/- ##
============================================
- Coverage 76.38% 71.45% -4.94%
Complexity 76 76
============================================
Files 410 433 +23
Lines 15838 16917 +1079
Branches 2546 2752 +206
============================================
- Hits 12098 12088 -10
- Misses 2258 3340 +1082
- Partials 1482 1489 +7
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:
|
There was a problem hiding this comment.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
oshi-core/src/main/java/oshi/SystemInfo.java (1)
61-61:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd NetBSD to the supported-platforms list in the class Javadoc.
The
module-info.javaheader was updated to include NetBSD, but this class-level Javadoc still omits it from the supported-platform enumeration.📝 Proposed doc fix
- * all OSHI platforms (Windows, macOS, Linux, Android, DragonFly BSD, FreeBSD, OpenBSD, Solaris, AIX). Android is routed + * all OSHI platforms (Windows, macOS, Linux, Android, DragonFly BSD, FreeBSD, NetBSD, OpenBSD, Solaris, AIX). Android is + * routed🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@oshi-core/src/main/java/oshi/SystemInfo.java` at line 61, Update the class Javadoc for SystemInfo to include "NetBSD" in the supported-platforms enumeration so it matches the module-info.java change; locate the class-level comment above the SystemInfo class declaration and add "NetBSD" to the list of OSHI platforms (e.g., in the sentence that currently enumerates Windows, macOS, Linux, Android, DragonFly BSD, FreeBSD, OpenBSD, Solaris, AIX).
🧹 Nitpick comments (4)
oshi-core/src/test/java/oshi/driver/unix/netbsd/disk/DisklabelTest.java (1)
27-35: 💤 Low valueHoist the elevation check out of the loop.
new NetBsdOperatingSystem()andisElevated()are recomputed on every device iteration. Constructing the OS object and re-evaluating elevation per disk is unnecessary work; compute once before the loop.♻️ Proposed refactor
String[] devices = NetBsdSysctlUtil.sysctl("hw.disknames", "").trim().split("\\s+"); + boolean elevated = new NetBsdOperatingSystem().isElevated(); for (String device : devices) { String diskName = device; Quartet<String, String, Long, List<HWPartition>> diskdata = Disklabel.getDiskParams(diskName); // First 3 only available with elevation - if (new NetBsdOperatingSystem().isElevated()) { + if (elevated) { assertThat("Disk label is not null", diskdata.getA(), not(nullValue())); assertThat("Disk duid is not null", diskdata.getB(), not(nullValue())); assertThat("Disk size is nonnegative", diskdata.getC().longValue(), greaterThanOrEqualTo(0L)); } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@oshi-core/src/test/java/oshi/driver/unix/netbsd/disk/DisklabelTest.java` around lines 27 - 35, The elevation check and OS construction are repeated for each device; create a single NetBsdOperatingSystem instance and call isElevated() once before iterating over devices, store the result in a boolean (e.g., boolean elevated = new NetBsdOperatingSystem().isElevated()), then inside the for loop call Disklabel.getDiskParams(diskName) as before and only run the three assertThat checks when elevated is true; update references to NetBsdOperatingSystem and isElevated() accordingly and remove the per-iteration new NetBsdOperatingSystem() call.oshi-core/src/test/java/oshi/util/platform/unix/netbsd/FstatUtilTest.java (1)
22-34: 💤 Low valuePrefer
@EnabledIfSystemPropertyover a runtime guard for consistency.
DisklabelTestgates with@EnabledIfSystemProperty(named = "os.name", matches = "(?i)netbsd"), which reports the test as skipped off-platform. Here the innerifmakes the test pass with zero assertions on non-NetBSD hosts, hiding the fact that it never actually ran. Aligning with the annotation approach is clearer.♻️ Proposed refactor
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.Test; import oshi.SystemInfo; -import oshi.util.PlatformEnum; /** * Test general utility methods for {`@link` FstatUtil}. */ +@EnabledIfSystemProperty(named = "os.name", matches = "(?i)netbsd") class FstatUtilTest { `@Test` void testFstat() { - if (PlatformEnum.getCurrentPlatform().equals(NETBSD)) { - int pid = new SystemInfo().getOperatingSystem().getProcessId(); - assertThat("Number of open files must be nonnegative", FstatUtil.getOpenFiles(pid), - is(greaterThanOrEqualTo(0L))); - assertThat("Cwd should not be empty", FstatUtil.getCwd(pid), is(not(emptyString()))); - } + int pid = new SystemInfo().getOperatingSystem().getProcessId(); + assertThat("Number of open files must be nonnegative", FstatUtil.getOpenFiles(pid), + is(greaterThanOrEqualTo(0L))); + assertThat("Cwd should not be empty", FstatUtil.getCwd(pid), is(not(emptyString()))); } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@oshi-core/src/test/java/oshi/util/platform/unix/netbsd/FstatUtilTest.java` around lines 22 - 34, Replace the runtime platform guard inside FstatUtilTest.testFstat with a JUnit conditional annotation: remove the if (PlatformEnum.getCurrentPlatform().equals(NETBSD)) { ... } block and annotate the testFstat method with `@EnabledIfSystemProperty`(named = "os.name", matches = "(?i)netbsd") so the test is reported as skipped off-platform; keep the existing assertions calling FstatUtil.getOpenFiles(pid) and FstatUtil.getCwd(pid), and add the necessary import for org.junit.jupiter.api.condition.EnabledIfSystemProperty.oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdFileSystem.java (1)
22-25: 💤 Low valueClass Javadoc references "FreeBSD" instead of "NetBSD".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdFileSystem.java` around lines 22 - 25, The class Javadoc incorrectly refers to FreeBSD; update the documentation on the NetBsdFileSystem class (NetBsdFileSystem.java) to reference NetBSD instead of FreeBSD and adjust the description so it correctly describes that this NetBsdFileSystem contains oshi.software.os.OSFileStore entries representing storage pools/devices/partitions/volumes or other NetBSD-specific file storage entities.oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdPowerSource.java (1)
85-86: 💤 Low valueClarify
||/&&precedence in voltage detection (readability only)In
NetBsdPowerSourcethe condition at lines 85-86 is already evaluated assplit[0].contains("volt0") || (split[0].contains("volt") && line.contains("current")), and the same expression is used inOpenBsdPowerSource, so behavior should already match the intended grouping—adding explicit parentheses just improves clarity.♻️ Suggested clarification
- if (split[0].contains("volt0") || split[0].contains("volt") && line.contains("current")) { + if (split[0].contains("volt0") || (split[0].contains("volt") && line.contains("current"))) { psVoltage = ParseUtil.parseDoubleOrDefault(split[1], -1d);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdPowerSource.java` around lines 85 - 86, The boolean expression in NetBsdPowerSource that detects voltage is ambiguous; make the grouping explicit by changing the condition in the voltage-detection branch (the if that checks split[0].contains("volt0") || split[0].contains("volt") && line.contains("current")) to use parentheses so it reads split[0].contains("volt0") || (split[0].contains("volt") && line.contains("current")), mirroring the grouping used in OpenBsdPowerSource to improve readability without changing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/netbsd.yaml:
- Around line 4-8: The NetBSD workflow (.github/workflows/netbsd.yaml) only
triggers on workflow_dispatch and push to branch "netbsd-port", so NetBSD CI
won't run for pull_request or after merges to master; update the workflow
triggers to include pull_request (e.g., add a pull_request key alongside push)
or alternatively add the NetBSD job into the main PR workflow
(.github/workflows/pr.yaml) so NetBSD tests run on PRs and master pushes.
In `@oshi-core/src/main/java/oshi/driver/unix/netbsd/disk/Disklabel.java`:
- Around line 69-70: The code parses "total sectors" into an int via
ParseUtil.getFirstIntValue and stores it in totalSectors, which overflows for
large disks; change the parsing to use a long (e.g., call a
ParseUtil.getFirstLongValue or extract the numeric token and call
ParseUtil.parseLongOrDefault) and store the result in a long-typed totalSectors
variable, then use that long when computing totalBytes (totalSectors *
bytesPerSector) and returning the Quartet so the disk-size computation uses a
long instead of int; update any related variable declarations and the return
expression in the methods referencing totalSectors (and keep Quartet type
parameters consistent).
In
`@oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdCentralProcessor.java`:
- Around line 250-262: queryVmStats currently assigns contextSwitches and
interrupts as long but uses ParseUtil.getFirstIntValue (returns int) causing
truncation; fix by parsing the numeric tokens as long instead of int: either add
a ParseUtil.getFirstLongValue/getNthLongValue helper and call it from
queryVmStats, or in queryVmStats extract the numeric substring from each
matching vmstat line (e.g., via the same regex/utility used elsewhere) and use
Long.parseLong(...) before assigning to contextSwitches and interrupts so the
cumulative vmstat -s counters do not overflow.
- Line 151: The cpu regexes in initProcessorCounts use over-escaped patterns
("cpu(\\\\d+)") and Matcher.matches(), so they never match dmesg lines and leave
cpuMap empty; change the Pattern strings to use a single-escape form
("cpu(\\d+).*: ((ARM|AMD|Intel|Apple).+)" and the generic line "cpu(\\d+).*:
(.+)"), and use Matcher.find() (not matches()) when extracting groups to
populate cpuMap/physProcs and enable cache detection; separately, in
queryVmStats replace ParseUtil.getFirstIntValue(...) (which uses
Integer.parseInt and overflows) with a long-capable parser (e.g.,
ParseUtil.getFirstLongValue(...) or Long.parseLong on the first token) for
counters like context-switches/interrupts so values exceeding Integer.MAX_VALUE
are handled correctly.
In
`@oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdFirmware.java`:
- Around line 52-56: In the NetBsdFirmware.java block that handles lines
starting with "bios0: vendor" (inside the parse loop in class NetBsdFirmware),
the current vendor assignment vendor = line.split("vendor")[1].trim() captures
the entire remainder; change it to isolate only the manufacturer token
immediately after "vendor" (stop at the next whitespace or the keyword
"version"). Replace the assignment with logic that trims and extracts the first
token after "vendor" (or use a regex that captures vendor as the group between
"vendor" and either "\\s" or "\\sversion"), mirror the approach used in
OpenBsdFirmware, and ensure the extracted vendor is trimmed and stripped of any
surrounding quotes.
In
`@oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java`:
- Around line 83-84: The code intended to scale bytesPerSector by 1.5 before
snapping to the nearest lower power of two, but due to operator precedence the
expression in Long.highestOneBit(bytesPerSector + bytesPerSector >> 1) evaluates
incorrectly; change the arithmetic to explicitly compute 1.5× (e.g.,
bytesPerSector + (bytesPerSector >> 1)) before calling Long.highestOneBit so the
scaling works as intended in NetBsdHWDiskStore (variable bytesPerSector, call to
Long.highestOneBit).
In
`@oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdVirtualMemory.java`:
- Around line 53-61: The methods NetBsdVirtualMemory#getSwapPagesIn and
`#getSwapPagesOut` currently multiply the vmstat counters by global.getPageSize(),
returning bytes instead of the required page counts; change both to return the
raw counters from swapInfo.get().getC() and swapInfo.get().getD() (without
multiplying by global.getPageSize()), ensuring the return types remain long and
no unit conversion is applied.
In
`@oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdNetworkParams.java`:
- Around line 21-24: The getIpv6DefaultGateway() implementation calls
ExecutingCommand.runNative with the IPv4/unspecified family command; change the
command string in NetBsdNetworkParams.getIpv6DefaultGateway() to include the
IPv6 family flag (use "route -n get -inet6 default") so searchGateway parses the
IPv6 route output; ensure you only modify the argument passed to
ExecutingCommand.runNative in the getIpv6DefaultGateway() method.
In `@oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOSProcess.java`:
- Around line 441-448: In updateThreadCount(), the computed thread count from
ExecutingCommand.runNative("ps -axLwwo lid -p " + getProcessID()) is being
overwritten by an unconditional this.threadCount = 1; remove that unconditional
assignment and instead set this.threadCount to the computed value
(threadList.size() - 1) when the list is non-empty, otherwise default to 1;
update the method (updateThreadCount) to use threadList and getProcessID(), and
ensure threadCount is only set once based on the ps output or the safe default.
- Line 173: In queryEnvironmentVariables() in NetBsdOSProcess, guard against
ARGMAX <= 0 before allocating JNA Memory and CloseableSizeTByReference: if
ARGMAX is less than or equal to zero (it’s set to 0 when KERN_ARGMAX fails)
immediately return Collections.emptyMap() to avoid calling new Memory(ARGMAX) /
new CloseableSizeTByReference(ARGMAX) which throws IllegalArgumentException;
reference ARGMAX, queryEnvironmentVariables(), Memory, and
CloseableSizeTByReference when applying this early-return check.
---
Outside diff comments:
In `@oshi-core/src/main/java/oshi/SystemInfo.java`:
- Line 61: Update the class Javadoc for SystemInfo to include "NetBSD" in the
supported-platforms enumeration so it matches the module-info.java change;
locate the class-level comment above the SystemInfo class declaration and add
"NetBSD" to the list of OSHI platforms (e.g., in the sentence that currently
enumerates Windows, macOS, Linux, Android, DragonFly BSD, FreeBSD, OpenBSD,
Solaris, AIX).
---
Nitpick comments:
In
`@oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdPowerSource.java`:
- Around line 85-86: The boolean expression in NetBsdPowerSource that detects
voltage is ambiguous; make the grouping explicit by changing the condition in
the voltage-detection branch (the if that checks split[0].contains("volt0") ||
split[0].contains("volt") && line.contains("current")) to use parentheses so it
reads split[0].contains("volt0") || (split[0].contains("volt") &&
line.contains("current")), mirroring the grouping used in OpenBsdPowerSource to
improve readability without changing behavior.
In `@oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdFileSystem.java`:
- Around line 22-25: The class Javadoc incorrectly refers to FreeBSD; update the
documentation on the NetBsdFileSystem class (NetBsdFileSystem.java) to reference
NetBSD instead of FreeBSD and adjust the description so it correctly describes
that this NetBsdFileSystem contains oshi.software.os.OSFileStore entries
representing storage pools/devices/partitions/volumes or other NetBSD-specific
file storage entities.
In `@oshi-core/src/test/java/oshi/driver/unix/netbsd/disk/DisklabelTest.java`:
- Around line 27-35: The elevation check and OS construction are repeated for
each device; create a single NetBsdOperatingSystem instance and call
isElevated() once before iterating over devices, store the result in a boolean
(e.g., boolean elevated = new NetBsdOperatingSystem().isElevated()), then inside
the for loop call Disklabel.getDiskParams(diskName) as before and only run the
three assertThat checks when elevated is true; update references to
NetBsdOperatingSystem and isElevated() accordingly and remove the per-iteration
new NetBsdOperatingSystem() call.
In `@oshi-core/src/test/java/oshi/util/platform/unix/netbsd/FstatUtilTest.java`:
- Around line 22-34: Replace the runtime platform guard inside
FstatUtilTest.testFstat with a JUnit conditional annotation: remove the if
(PlatformEnum.getCurrentPlatform().equals(NETBSD)) { ... } block and annotate
the testFstat method with `@EnabledIfSystemProperty`(named = "os.name", matches =
"(?i)netbsd") so the test is reported as skipped off-platform; keep the existing
assertions calling FstatUtil.getOpenFiles(pid) and FstatUtil.getCwd(pid), and
add the necessary import for
org.junit.jupiter.api.condition.EnabledIfSystemProperty.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2a8b8f6d-f0fb-4ee7-aa1f-0120dd72d641
📒 Files selected for processing (35)
.github/workflows/netbsd.yamloshi-core/src/main/java/module-info.javaoshi-core/src/main/java/oshi/SystemInfo.javaoshi-core/src/main/java/oshi/driver/unix/netbsd/disk/Disklabel.javaoshi-core/src/main/java/oshi/driver/unix/netbsd/disk/package-info.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdCentralProcessor.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdComputerSystem.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdFirmware.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdGlobalMemory.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdGraphicsCard.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHardwareAbstractionLayer.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdNetworkIF.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdPowerSource.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdSensors.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdSoundCard.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdUsbDevice.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdVirtualMemory.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/package-info.javaoshi-core/src/main/java/oshi/jna/platform/unix/NetBsdLibc.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdFileSystem.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdInternetProtocolStats.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdNetworkParams.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOSFileStore.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOSProcess.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOSThread.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOperatingSystem.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/package-info.javaoshi-core/src/main/java/oshi/util/platform/unix/netbsd/FstatUtil.javaoshi-core/src/main/java/oshi/util/platform/unix/netbsd/NetBsdSysctlUtil.javaoshi-core/src/main/java/oshi/util/platform/unix/netbsd/package-info.javaoshi-core/src/test/java/module-info.testoshi-core/src/test/java/oshi/driver/unix/netbsd/disk/DisklabelTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/CentralProcessorTest.javaoshi-core/src/test/java/oshi/util/platform/unix/netbsd/FstatUtilTest.java
📜 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). (8)
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: JMH Benchmarks, windows-latest
- GitHub Check: JMH Benchmarks, ubuntu-latest
- GitHub Check: JMH Benchmarks, macos-latest
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: Analyze (java)
- GitHub Check: Codacy Static Code Analysis
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-04-06T04:45:47.644Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3121
File: oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java:53-53
Timestamp: 2026-04-06T04:45:47.644Z
Learning: In the oshi/oshi project, only interfaces and classes in the root packages `oshi`, `oshi.hardware`, and `oshi.software.os` are considered the public API. Code in subpackages that represent specific implementations/platforms (e.g., `oshi.software.os.linux`, `oshi.hardware.platform.linux`, and similar subpackages) is implementation detail. When reviewing, do not treat changes to classes in these platform-specific subpackages as public API breaks (for example: making `LinuxOperatingSystem` abstract, narrowing constructor visibility, or adding/removing abstract methods should not be flagged as breaking public API).
Applied to files:
oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdFirmware.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdVirtualMemory.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdInternetProtocolStats.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdNetworkParams.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdFileSystem.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOSFileStore.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHardwareAbstractionLayer.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/package-info.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdGlobalMemory.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdSoundCard.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdComputerSystem.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdNetworkIF.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdGraphicsCard.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdPowerSource.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdSensors.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdUsbDevice.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/package-info.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOSThread.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.javaoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdCentralProcessor.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOperatingSystem.javaoshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOSProcess.java
🪛 zizmor (1.25.2)
.github/workflows/netbsd.yaml
[warning] 15-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 18-18: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🔇 Additional comments (25)
oshi-core/src/main/java/module-info.java (1)
27-27: LGTM!oshi-core/src/main/java/oshi/SystemInfo.java (1)
132-133: LGTM!Also applies to: 167-168
oshi-core/src/test/java/module-info.test (1)
31-38: LGTM!oshi-core/src/test/java/oshi/hardware/platform/shared/CentralProcessorTest.java (1)
165-173: LGTM!.github/workflows/netbsd.yaml (1)
15-18: 💤 Low valueKeep workflow action references as version tags (no SHA pinning elsewhere).
Repo workflows consistently use tag-baseduses:(e.g.,actions/checkout@v6,vmactions/*@v1``) and none are pinned to commit SHAs, so this aligns with the existing convention for.github/workflows/netbsd.yaml.oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOperatingSystem.java (1)
63-243: LGTM!oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOSThread.java (1)
116-174: LGTM!oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdInternetProtocolStats.java (1)
17-25: LGTM!oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOSFileStore.java (1)
24-34: LGTM!oshi-core/src/main/java/oshi/jna/platform/unix/NetBsdLibc.java (1)
15-68: LGTM!oshi-core/src/main/java/oshi/util/platform/unix/netbsd/NetBsdSysctlUtil.java (1)
43-178: LGTM!oshi-core/src/main/java/oshi/util/platform/unix/netbsd/FstatUtil.java (1)
26-49: LGTM!oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdComputerSystem.java (1)
23-79: LGTM!oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdGlobalMemory.java (1)
23-77: LGTM!oshi-core/src/main/java/oshi/util/platform/unix/netbsd/package-info.java (1)
1-9: LGTM!oshi-core/src/main/java/oshi/driver/unix/netbsd/disk/package-info.java (1)
1-9: LGTM!oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdSensors.java (1)
44-86: LGTM!oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java (1)
108-116: ⚡ Quick winVerify
iostat -d -Ifield mapping for read/write counts and byte accounting inNetBsdHWDiskStore.The inline comment says
name KB/t xfrs MB, but the code assignssetReads(split[1])(looks likeKB/t) andsetWrites(split[2])(looks likexfrs), whilereadBytes/writeBytesare both computed as half of theMBvalue. Confirm NetBSD 10.1iostat -d -I’s exact column order and whether separate read/write columns (especially MB and transfer counts) exist, then update thesplit[]indices and howreadBytes/writeBytesare derived.oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdPowerSource.java (1)
26-83: LGTM!Also applies to: 87-147
oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdGraphicsCard.java (1)
46-107: LGTM!oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdNetworkIF.java (1)
28-77: LGTM!oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdUsbDevice.java (1)
42-152: LGTM!oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdSoundCard.java (1)
50-88: LGTM!oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/package-info.java (1)
1-8: LGTM!oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHardwareAbstractionLayer.java (1)
30-91: LGTM!
Output fixes: - Context switch: NetBSD vmstat says "CPU context switches" (capital) and "device interrupts" - Disk names: space-separated without colon suffixes - Filesystem: NetBSD mount output has 6 fields (no DUID), fix javadoc - Network: Create NetBSD-specific NetworkIF for netstat format - Disk I/O: Use iostat -d -I instead of OpenBSD's systat -ab iostat - Clean up workflow: remove debug, ensure procfs mounted Code review fixes: - Disklabel: parse totalSectors as long to avoid int overflow - CentralProcessor: fix over-escaped regex patterns (\\\\d -> \\d), parse vmstat counters as long instead of int - Firmware: extract only first token after "vendor" - HWDiskStore: fix operator precedence in bytesPerSector calculation - VirtualMemory: getSwapPagesIn/Out return page counts not bytes - NetworkParams: use -inet6 flag for IPv6 gateway lookup - OSProcess: fix unconditional threadCount=1 overwrite, guard ARGMAX<=0 before Memory allocation in env query - SystemInfo: add NetBSD to supported platforms javadoc - PowerSource: add explicit parentheses in boolean expression - Tests: use @EnabledIfSystemProperty, hoist isElevated() check
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/netbsd.yaml (1)
34-63: ⚡ Quick winConsider removing or conditionalizing the debug disk investigation block before final merge.
This 30-line debug section will clutter CI logs in production workflows. Since the PR objectives note this is for verifying iostat implementation details, you may want to remove it once verification is complete, or make it conditional (e.g., triggered by an environment variable or workflow input parameter).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/netbsd.yaml around lines 34 - 63, The debug disk investigation block (the series of iostat, dmesg, disklabel, and sysctl commands) should be removed or gated behind a conditional so it doesn't always pollute CI logs; either delete the whole block or wrap it so it runs only when a flag is set (e.g., an environment variable DEBUG_DISK or a workflow input like debug_disk == 'true') and check that condition before executing the iostat/dmesg/disklabel/sysctl commands; ensure the conditional uses GitHub Actions workflow inputs or env variables and reference the existing iostat, dmesg, disklabel, and sysctl invocations when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/netbsd.yaml:
- Line 65: The CI step currently runs the test command "./mvnw clean test -B
-Djacoco.skip=true || true" which masks failures; remove the trailing "|| true"
so the step runs "./mvnw clean test -B -Djacoco.skip=true" and will fail the job
on test failures, ensuring the workflow correctly fails when tests fail.
---
Nitpick comments:
In @.github/workflows/netbsd.yaml:
- Around line 34-63: The debug disk investigation block (the series of iostat,
dmesg, disklabel, and sysctl commands) should be removed or gated behind a
conditional so it doesn't always pollute CI logs; either delete the whole block
or wrap it so it runs only when a flag is set (e.g., an environment variable
DEBUG_DISK or a workflow input like debug_disk == 'true') and check that
condition before executing the iostat/dmesg/disklabel/sysctl commands; ensure
the conditional uses GitHub Actions workflow inputs or env variables and
reference the existing iostat, dmesg, disklabel, and sysctl invocations when
making the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0eed049b-6f97-421d-88ba-ca1320b20c68
📒 Files selected for processing (1)
.github/workflows/netbsd.yaml
📜 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)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Test JDK 11, macos-latest
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, macos-latest
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: JMH Benchmarks, macos-latest
- GitHub Check: JMH Benchmarks, windows-latest
- GitHub Check: JMH Benchmarks, ubuntu-latest
- GitHub Check: Analyze (java)
ed3c925 to
852f99c
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java`:
- Around line 102-117: The iostat -x parser in NetBsdHWDiskStore.java
incorrectly requires split.length >= 10 and uses wrong token indices for the
write-side and transfer time; change the guard to split.length >= 9, read writes
from split[6] (w/s) instead of split[7], read writeKBPerTransfer from split[5]
instead of split[6], and sum transfer time using split[3] and split[7] (read
time + write time) when calling
setReads/setWrites/setReadBytes/setWriteBytes/setTransferTime so the tokens
align with the header layout.
- Around line 125-126: The current queryIostat() returns output of "iostat -x"
which yields rate/averaged counters; update queryIostat() to call iostat in
running-totals mode (e.g., "iostat -Ix" or "iostat -x -I") so the disk
read/write counters map semantically to the cumulative reads/writes used by
NetBsdHWDiskStore.updateAttributes(); after changing the command, verify and
adjust any parsing logic in updateAttributes() that consumes iostat columns in
case the -I flag changes column positions or units so getReads/getWrites and
derived getReadBytes/getWriteBytes remain correct.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c33f6c7d-1e17-4aad-b644-0a86693f02e4
📒 Files selected for processing (1)
oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java
📜 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)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, macos-latest
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: JMH Benchmarks, ubuntu-latest
- GitHub Check: JMH Benchmarks, macos-latest
- GitHub Check: JMH Benchmarks, windows-latest
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-04-06T04:45:47.644Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3121
File: oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java:53-53
Timestamp: 2026-04-06T04:45:47.644Z
Learning: In the oshi/oshi project, only interfaces and classes in the root packages `oshi`, `oshi.hardware`, and `oshi.software.os` are considered the public API. Code in subpackages that represent specific implementations/platforms (e.g., `oshi.software.os.linux`, `oshi.hardware.platform.linux`, and similar subpackages) is implementation detail. When reviewing, do not treat changes to classes in these platform-specific subpackages as public API breaks (for example: making `LinuxOperatingSystem` abstract, narrowing constructor visibility, or adding/removing abstract methods should not be flagged as breaking public API).
Applied to files:
oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java
There was a problem hiding this comment.
🧹 Nitpick comments (1)
oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java (1)
32-32: ⚡ Quick winConsider making the
iostatsupplier static to avoid redundant command executions.Since
queryIostat()returns output for all disks, each instance maintaining its own memoized supplier causes redundantiostat -x -Iexecutions whengetDisks()iterates through devices and callsupdateAttributes()on each. A static supplier would let all instances share one cached result.♻️ Proposed refactor
- private final Supplier<List<String>> iostat = memoize(NetBsdHWDiskStore::queryIostat, defaultExpiration()); + private static final Supplier<List<String>> IOSTAT = memoize(NetBsdHWDiskStore::queryIostat, defaultExpiration());Then update line 101 to use
IOSTAT.get()instead ofiostat.get().🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java` at line 32, The instance field iostat should be changed to a static memoized Supplier so all NetBsdHWDiskStore instances share one cached iostat result: replace the instance field Supplier<List<String>> iostat = memoize(NetBsdHWDiskStore::queryIostat, defaultExpiration()) with a static final Supplier<List<String>> IOSTAT = memoize(NetBsdHWDiskStore::queryIostat, defaultExpiration()), and then update usages (e.g., in updateAttributes and any calls from getDisks) to call IOSTAT.get() instead of iostat.get() so the command output is executed once and shared across instances.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java`:
- Line 32: The instance field iostat should be changed to a static memoized
Supplier so all NetBsdHWDiskStore instances share one cached iostat result:
replace the instance field Supplier<List<String>> iostat =
memoize(NetBsdHWDiskStore::queryIostat, defaultExpiration()) with a static final
Supplier<List<String>> IOSTAT = memoize(NetBsdHWDiskStore::queryIostat,
defaultExpiration()), and then update usages (e.g., in updateAttributes and any
calls from getDisks) to call IOSTAT.get() instead of iostat.get() so the command
output is executed once and shared across instances.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 928fa4cf-c16c-4565-82c5-a5249bbb3024
📒 Files selected for processing (1)
oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java
📜 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)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, macos-latest
- GitHub Check: JMH Benchmarks, ubuntu-latest
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: JMH Benchmarks, macos-latest
- GitHub Check: JMH Benchmarks, windows-latest
- GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-04-06T04:45:47.644Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3121
File: oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java:53-53
Timestamp: 2026-04-06T04:45:47.644Z
Learning: In the oshi/oshi project, only interfaces and classes in the root packages `oshi`, `oshi.hardware`, and `oshi.software.os` are considered the public API. Code in subpackages that represent specific implementations/platforms (e.g., `oshi.software.os.linux`, `oshi.hardware.platform.linux`, and similar subpackages) is implementation detail. When reviewing, do not treat changes to classes in these platform-specific subpackages as public API breaks (for example: making `LinuxOperatingSystem` abstract, narrowing constructor visibility, or adding/removing abstract methods should not be flagged as breaking public API).
Applied to files:
oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java
🔇 Additional comments (3)
oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java (3)
43-95: LGTM!
126-128: LGTM!
115-116: Reconcile NetBSDiostat -x -Ibyte calculation with theMBcolumn totals.NetBSD’s
iostat -x -Ioutputs running total values, and theMBfields are total megabytes transferred (not interval averages). The current code derives bytes fromKB/t * xfrand multiplies by1024, which may diverge if NetBSD’sKB/t/xfrand the printedMBtotals use different base units or rounding. Verify NetBSD’s definitions/units forKB/t,xfr, and theMBcolumns; ifMBis the authoritative running total, compute bytes fromsplit[4]/split[8](with the correct MB→bytes base).
- Disk size: Parse dmesg for "bytes/sect x sectors" (physical disks) and "blocks at offset" (wedge devices like dk0, dk1) - Disk I/O: Use iostat -x -I for cumulative per-device extended stats - Fix field count (9 fields) and column indices for write stats - Disk model: Only match SCSI-style "<Vendor, Model, Rev>" from dmesg (not virtio feature flags in angle brackets) - Affinity: Return all-CPUs mask since NetBSD has no cpuset command
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/netbsd.yaml (1)
62-62:⚠️ Potential issue | 🔴 Critical | ⚡ Quick win
|| truestill masks test failuresThis is still unresolved from earlier feedback: at Line 62,
|| truemakes the test step succeed even when Maven fails, so CI won’t catch regressions.Suggested minimal fix
- ./mvnw clean test -B -Djacoco.skip=true || true + ./mvnw clean test -B -Djacoco.skip=true🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/netbsd.yaml at line 62, The step running tests currently appends "|| true" to the command string "./mvnw clean test -B -Djacoco.skip=true || true", which masks Maven test failures; remove the "|| true" from that command so the step fails when "./mvnw clean test -B -Djacoco.skip=true" fails (or alternatively, if you intended to allow failures, set the step's continue-on-error flag explicitly instead of using "|| true").
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In @.github/workflows/netbsd.yaml:
- Line 62: The step running tests currently appends "|| true" to the command
string "./mvnw clean test -B -Djacoco.skip=true || true", which masks Maven test
failures; remove the "|| true" from that command so the step fails when "./mvnw
clean test -B -Djacoco.skip=true" fails (or alternatively, if you intended to
allow failures, set the step's continue-on-error flag explicitly instead of
using "|| true").
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 02807e58-4a89-432a-a0d4-95112e0b2784
📒 Files selected for processing (1)
.github/workflows/netbsd.yaml
📜 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)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, macos-latest
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
- GitHub Check: JMH Benchmarks, windows-latest
- GitHub Check: JMH Benchmarks, macos-latest
- GitHub Check: JMH Benchmarks, ubuntu-latest
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: Analyze (java)
🔇 Additional comments (1)
.github/workflows/netbsd.yaml (1)
34-60: LGTM!
- Thread count: Use ps -axo nlwp and sum values instead of ps -L (NetBSD's -L flag lists keywords, not LWPs) - Per-process thread count: Use ps -o nlwp -p <pid> - Thread details: Remove -L flag from ps commands (lid keyword in format spec is sufficient for NetBSD to show per-LWP rows) - Affinity: Use schedctl -p <pid> to check CPU binding; fall back to all-CPUs mask when not bound - Remove debug output from workflow
- Move NetBSD test job from standalone netbsd.yaml into unix.yaml alongside other BSD/Unix tests - Fix AIX job name capitalization in unix.yaml - Make iostat supplier static (shared across disk instances) - Add NetBSD to supported platforms in README, FAQ, CHANGELOG, and site index
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/unix.yaml (1)
9-9: 💤 Low valueVerify whether the
netbsd-portbranch trigger should remain after merge.This trigger enables CI runs on pushes to the
netbsd-portbranch. Once this PR is merged tomaster, consider whether this branch trigger should be removed or retained for future NetBSD-specific development work.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/unix.yaml at line 9, Check whether the extra push trigger for the branch named "netbsd-port" should remain in the workflow's push branches list; if NetBSD-specific CI is no longer needed remove the "netbsd-port" entry from the push branches array, otherwise keep it (or add a comment explaining its purpose) so future NetBSD work still triggers CI. Locate the "netbsd-port" string in the workflow's push.branches configuration and either delete that element or leave it with an inline comment describing why it must be preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/unix.yaml:
- Line 9: Check whether the extra push trigger for the branch named
"netbsd-port" should remain in the workflow's push branches list; if
NetBSD-specific CI is no longer needed remove the "netbsd-port" entry from the
push branches array, otherwise keep it (or add a comment explaining its purpose)
so future NetBSD work still triggers CI. Locate the "netbsd-port" string in the
workflow's push.branches configuration and either delete that element or leave
it with an inline comment describing why it must be preserved.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6ae5c094-aae4-4e98-9c56-6d4817f27e51
📒 Files selected for processing (6)
.github/workflows/unix.yamlCHANGELOG.mdFAQ.mdREADME.mdoshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.javasrc/site/markdown/index.md
✅ Files skipped from review due to trivial changes (4)
- CHANGELOG.md
- FAQ.md
- src/site/markdown/index.md
- README.md
🚧 Files skipped from review as they are similar to previous changes (1)
- oshi-core/src/main/java/oshi/hardware/platform/unix/netbsd/NetBsdHWDiskStore.java
📜 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)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, macos-latest
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Analyze (java)
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: JMH Benchmarks, ubuntu-latest
- GitHub Check: JMH Benchmarks, macos-latest
- GitHub Check: JMH Benchmarks, windows-latest
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
🧰 Additional context used
🪛 zizmor (1.25.2)
.github/workflows/unix.yaml
[warning] 173-173: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 173-173: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 176-176: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🔇 Additional comments (2)
.github/workflows/unix.yaml (2)
109-109: LGTM!
168-189: LGTM!
Summary
java-jnapackage (libjnidispatch.so)Key NetBSD-specific adaptations from OpenBSD
ps -Lwithlidkeyword (not-H/tid) for thread/LWP display/proc/PID/cmdlinefor process arguments (KERN_PROC_ARGS sysctl unavailable)System.getenv()fallback for current process environmentmachdep.cpu_brandandmachdep.tsc_freqfor CPU identification_lwp_self()for thread IDs (notgetthrid())KERN_CP_TIME(51) with per-CPU via third MIB elementvmstat -sfor memory and context switch stats (noBcachestatsstruct)readlink /proc/PID/cwdfor process working directoryhw.disknames(no colon suffixes like OpenBSD)mountoutput with 6 fields (no DUID field like OpenBSD'smount -v)netstat -bI/-iIfor network stats (fewer columns than FreeBSD/OpenBSD)iostat -d -Ifor disk I/O statisticsKnown follow-up items
iostatformat verificationgetCurrentThread()shows state=INVALID (thread lookup refinement)java-jnapackage for native library; may add helpful error message in futureTest plan
Summary by CodeRabbit
New Features
Documentation