Repository navigation
Switch Solaris SPARC CI to cfarm216/JDK 17, OpenBSD to JDK 25 - #3323
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📜 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). (14)
📝 WalkthroughWalkthroughOpenBSD and Solaris SPARC CI jobs are reconfigured: OpenBSD upgrades to JDK 25, and Solaris SPARC targets a new remote host with module-scoped Maven testing. SystemInfoHelper switches to true file-store enumeration when printing filesystem details. ChangesUnix CI and Runtime Diagnostics
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
14e7d2f to
88e7bf2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3323 +/- ##
=========================================
Coverage 74.91% 74.91%
Complexity 76 76
=========================================
Files 455 455
Lines 17492 17492
Branches 2872 2872
=========================================
Hits 13105 13105
- Misses 2788 2790 +2
+ Partials 1599 1597 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
88e7bf2 to
43d7c88
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
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/test/java/oshi/SystemInfoTest.java (1)
78-90:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winCritical: Timing measurements are off-by-one.
The elapsed time logged at line 88 with the message "Checking Installed Apps... ({}ms)" actually measures the time for the previous operations (SystemInfo initialization + printOperatingSystem, lines 79-86), not for Installed Apps. The pattern repeats throughout: each "Checking X... ({}ms)" log prints the duration of the prior section, not section X.
This makes the timing information fundamentally misleading. Users will interpret "Checking Installed Apps... (100ms)" as meaning Installed Apps took 100ms, when it actually means the prior operations took 100ms.
🔧 Proposed fix: Move timing log after each operation
Restructure to log timing after each operation completes:
logger.info("Initializing System..."); -long t = System.currentTimeMillis(); SystemInfo si = new SystemInfo(); HardwareAbstractionLayer hal = si.getHardware(); OperatingSystem os = si.getOperatingSystem(); List<String> lines = new ArrayList<>(); +long t = System.currentTimeMillis(); printOperatingSystem(lines, os); +logger.info("Checked Operating System ({}ms)", System.currentTimeMillis() - t); -logger.info("Checking Installed Apps... ({}ms)", System.currentTimeMillis() - t); t = System.currentTimeMillis(); printInstalledApps(lines, os.getInstalledApplications()); +logger.info("Checked Installed Apps ({}ms)", System.currentTimeMillis() - t); -logger.info("Checking computer system... ({}ms)", System.currentTimeMillis() - t); t = System.currentTimeMillis(); printComputerSystem(lines, hal.getComputerSystem()); +logger.info("Checked computer system ({}ms)", System.currentTimeMillis() - t);Apply this pattern to all remaining sections (lines 96-170) so each timing log accurately reflects the duration of the operation it describes.
🤖 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/SystemInfoTest.java` around lines 78 - 90, The timing logs are off-by-one because t is set before the operation but logged before the next operation; update the pattern around SystemInfo initialization and subsequent calls (variables t, SystemInfo, hal, os, printOperatingSystem, printInstalledApps, logger.info) so each "Checking X... ({}ms)" is logged after the corresponding operation finishes: capture t before the operation, run the operation (e.g., printOperatingSystem(lines, os) or printInstalledApps(lines, os.getInstalledApplications())), then call logger.info with System.currentTimeMillis() - t; apply this change to all similar sections so each timing message measures the operation it describes.
🤖 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/unix.yaml:
- Line 92: The workflow's testsolaris_sparc job is targeting host:
cfarm216.cfarm.net but CI logs show it's hitting gcc211.fsffrance.org and
failing SSH auth with secrets.GCC_CI_KEY; update the unix.yaml testsolaris_sparc
job so the host entry is the actual reachable Solaris SPARC machine that has the
GCC_CI_KEY public key installed for user oshi (or install the public key for
oshi on cfarm216.cfarm.net), ensure the workflow runner has access to the
secrets.GCC_CI_KEY and that the SSH step uses that secret for authentication
before any CD command (e.g., validate host value, confirm authorized_keys
contains the public key for user oshi, and rerun the job to verify SSH succeeds
prior to running cd ~/oshi).
In `@oshi-core/src/test/java/oshi/SystemInfoTest.java`:
- Around line 168-170: The timer for the final section is never logged: after
resetting t and calling printPrinters(lines, hal.getPrinters()) you must compute
the elapsed time using t and log it via logger.info with an appropriate label
(e.g., "Checking Printers... ({}ms)"); ensure you reference the same variable t
and the call printPrinters(lines, hal.getPrinters()) so the duration is measured
and logged, and once you apply the earlier off-by-one fix to the preceding
sections also make sure this final timing remains consistent with the other
logger.info calls.
---
Outside diff comments:
In `@oshi-core/src/test/java/oshi/SystemInfoTest.java`:
- Around line 78-90: The timing logs are off-by-one because t is set before the
operation but logged before the next operation; update the pattern around
SystemInfo initialization and subsequent calls (variables t, SystemInfo, hal,
os, printOperatingSystem, printInstalledApps, logger.info) so each "Checking
X... ({}ms)" is logged after the corresponding operation finishes: capture t
before the operation, run the operation (e.g., printOperatingSystem(lines, os)
or printInstalledApps(lines, os.getInstalledApplications())), then call
logger.info with System.currentTimeMillis() - t; apply this change to all
similar sections so each timing message measures the operation it describes.
🪄 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: 9bd6ee69-faca-4d7d-9d18-03d5180d4790
📒 Files selected for processing (3)
.github/workflows/unix.yamloshi-common/src/main/java/oshi/util/SystemInfoHelper.javaoshi-core/src/test/java/oshi/SystemInfoTest.java
🚧 Files skipped from review as they are similar to previous changes (1)
- oshi-common/src/main/java/oshi/util/SystemInfoHelper.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). (16)
- GitHub Check: Analyze (java)
- GitHub Check: Test JDK 26, windows-latest
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, windows-latest
- GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
- GitHub Check: Test JDK 26, ubuntu-latest
- GitHub Check: Test JDK 21, ubuntu-latest
- GitHub Check: Test JDK 26, macos-latest
- GitHub Check: Test JDK 21, macos-latest
- 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: Test JDK 25, FreeBSD (+ JNA==FFM)
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: Codacy Static Code Analysis
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3310
File: oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOperatingSystem.java:164-166
Timestamp: 2026-05-31T04:49:16.646Z
Learning: In the oshi/oshi project, the NetBSD platform intentionally removes all JNA/native library dependencies (PR `#3310`). `NetBsdOperatingSystem.getThreadId()` uses `(int) Thread.currentThread().getId()` rather than `NetBsdLibc._lwp_self()` because the JNA native library is not bundled with the Maven dependency for the NetBSD platform. The mismatch between Java thread ids and kernel LWP ids is an accepted trade-off. Do not suggest reintroducing JNA-based calls (such as `NetBsdLibc._lwp_self()`) in NetBSD platform code.
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3307
File: .github/workflows/netbsd.yaml:4-8
Timestamp: 2026-05-30T02:27:59.447Z
Learning: In the oshi/oshi repository, the `.github/workflows/netbsd.yaml` CI workflow intentionally triggers only on `push` to the `netbsd-port` branch during development. Before the final merge to master, NetBSD CI will be integrated into the main Unix CI workflow (e.g., `.github/workflows/pr.yaml` or equivalent). Do not flag the limited trigger scope as an issue on this PR.
📚 Learning: 2026-05-30T02:27:59.447Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3307
File: .github/workflows/netbsd.yaml:4-8
Timestamp: 2026-05-30T02:27:59.447Z
Learning: In the oshi/oshi repository, the `.github/workflows/netbsd.yaml` CI workflow intentionally triggers only on `push` to the `netbsd-port` branch during development. Before the final merge to master, NetBSD CI will be integrated into the main Unix CI workflow (e.g., `.github/workflows/pr.yaml` or equivalent). Do not flag the limited trigger scope as an issue on this PR.
Applied to files:
.github/workflows/unix.yaml
📚 Learning: 2026-03-29T20:01:06.452Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3014
File: oshi-core-java11/src/main/java/module-info.java:10-17
Timestamp: 2026-03-29T20:01:06.452Z
Learning: In the oshi project, `oshi-core-java25/src/main/java/module-info.java` intentionally does NOT export `oshi.util.platform.unix.freebsd`, `oshi.util.platform.unix.openbsd`, or `oshi.util.platform.unix.solaris`, because the FFM (Foreign Function & Memory) implementation only supports Windows, macOS, and Linux. This differs from `oshi-core-java11/src/main/java/module-info.java` which exports all Unix platform packages. The asymmetry is by design.
Applied to files:
.github/workflows/unix.yaml
📚 Learning: 2026-05-31T05:53:04.246Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3311
File: .github/workflows/site.yaml:21-21
Timestamp: 2026-05-31T05:53:04.246Z
Learning: When a GitHub Actions workflow verifies that a pinned commit SHA matches a version tag, dereference annotated tags before comparing to a commit SHA. The API `GET /repos/{owner}/{repo}/git/refs/tags/{tag}` returns the tag *object* SHA for annotated tags (not the underlying commit SHA), so comparing it directly to a commit SHA will cause false mismatches. Instead: (1) fetch the tag object SHA via `GET /repos/{owner}/{repo}/git/refs/tags/{tag}`; (2) resolve that tag object to the underlying commit by calling `GET /repos/{owner}/{repo}/git/tags/{tag_object_sha}`; (3) compare the pinned commit SHA to the resolved commit at `.object.sha`.
Applied to files:
.github/workflows/unix.yaml
🔇 Additional comments (4)
.github/workflows/unix.yaml (4)
47-47: LGTM!Also applies to: 59-59
82-86: LGTM!
100-103: Verify the remote working directory path on the new host.The working directory changed from
~/git/oshito~/oshi(line 103). This path must match the actual directory structure oncfarm216.cfarm.net, or all subsequentgitcommands will fail.Confirm during the first workflow run that:
- The directory
~/oshiexists on the new host- The oshi repository is cloned at this location
- The directory is writable by the
oshiuserThe kstat debug commands (lines 100-102) are well-guarded with error fallbacks and will help diagnose Solaris-specific issues without breaking the build.
108-108: Clarify-Doshi.os.solaris.allowkstat2=falseand confirm-pl oshi-common,oshi-corecovers Solaris
oshi.os.solaris.allowkstat2is defined inoshi-common(GlobalConfig.OSHI_OS_SOLARIS_ALLOWKSTAT2) with documented behavior: it gates using the Solaris 11.4+ kstat2 API; setting it tofalseforces the original kstat API (to avoid the documented file-descriptor leak risk under parallel GC).- That key is consumed by
oshi-core(SolarisOperatingSystemsetsALLOW_KSTAT2andHAS_KSTAT2), so the workflow flag directly changes which Solaris backend is used by the Solaris classes/tests.- Solaris-specific implementation and tests reside in
oshi-core(with the config key inoshi-common), and other modules don’t appear to contain Solaris/kstat2 code paths, so restricting-pltooshi-common,oshi-coreshouldn’t skip relevant Solaris coverage.- Retry loop
{1..2}matches the “retries flaky test once” comment.
| logger.info("Checking Printers... ({}ms)", System.currentTimeMillis() - t); | ||
| t = System.currentTimeMillis(); | ||
| printPrinters(lines, hal.getPrinters()); |
There was a problem hiding this comment.
Inconsistency: Final section timing is never reported.
After logging "Checking Printers... ({}ms)" at line 168 (which actually times the Graphics Cards section due to the off-by-one issue), the timer is reset at line 169 but the elapsed time for printPrinters is never logged. This creates an inconsistency—all other sections have their timing reported (albeit with incorrect labels), but the final section's duration is silently discarded.
Additionally, once the off-by-one issue from lines 78-90 is fixed, ensure the final section timing is also logged.
🤖 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/SystemInfoTest.java` around lines 168 - 170, The
timer for the final section is never logged: after resetting t and calling
printPrinters(lines, hal.getPrinters()) you must compute the elapsed time using
t and log it via logger.info with an appropriate label (e.g., "Checking
Printers... ({}ms)"); ensure you reference the same variable t and the call
printPrinters(lines, hal.getPrinters()) so the duration is measured and logged,
and once you apply the earlier off-by-one fix to the preceding sections also
make sure this final timing remains consistent with the other logger.info calls.
- Replace gcc211 (Solaris 11.3, JDK 11) with cfarm216 (Solaris 11.4, JDK 17) - Only test oshi-common,oshi-core (skip ffm/benchmark/metrics) - Disable kstat2 on cfarm216 (CPU ticks issue on LDOM, see #3066) - Use localOnly in SystemInfoHelper.printFileSystem debug output - Upgrade OpenBSD from JDK 21 to JDK 25
43d7c88 to
c4c9dc3
Compare
-Dlicense.skip=true(not needed with JDK 17)Closes #3066
Summary by CodeRabbit
Release Notes
Bug Fixes
Chores