Skip to content

Update CI Java versions to current LTS baseline - #3314

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:update-jdk-versions
Jun 1, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:update-jdk-versions

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Jun 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Update CI Java versions across all workflows to target current LTS releases:

Main platforms (Linux, macOS, Windows):

  • Matrix: [21, 25, 26] — previous LTS, current LTS, current release
  • Replaces [11, 21, 25]
  • ARM and Intel includes updated to JDK 21 (was 17)
  • Container cgroup test updated to JDK 21 (was 17)

Unix VMs (bumped to highest available):

  • FreeBSD: JDK 25 (was 11)
  • OpenBSD: JDK 21 (was 11)
  • DragonFly BSD: JDK 21 (was 11)
  • NetBSD: JDK 21 (was 11)
  • OpenIndiana: JDK 21, replaces Solaris 11.4 VM (illumos covers same platform code)

Unchanged (constrained environments):

  • Solaris SPARC (gcc211): JDK 11
  • AIX (gcc119): JDK 17

Lint & Benchmarks: Remain on JDK 25 (required for oshi-core-ffm)

All version-based conditionals (contains(matrix.java, '25') for coverage/FFM) remain correct since 25 is still in the matrix.

Test plan

  • Verify FreeBSD VM can install openjdk25
  • Verify OpenBSD VM can install jdk%21
  • Verify DragonFly BSD VM can install openjdk21
  • Verify NetBSD VM can install openjdk21
  • Verify OpenIndiana VM works with openjdk21
  • Verify JDK 26 is available via Zulu/Temurin for setup-java

Summary by CodeRabbit

  • Chores
    • CI workflows updated to newer JDKs (21, 25, 26); test matrices, runner provisioning, and many per-OS CI jobs adjusted, added, or renamed to target newer JDKs.
  • Bug Fixes
    • Tests made more resilient: disk-related checks now skip when metrics are absent; process-memory assertions accommodate BSD variants; several native/FFM tests now only run on Linux, macOS, and Windows to avoid unsupported platforms.

@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

GitHub Actions workflows now test JDKs 21, 25, 26 across Linux, macOS, Windows, PR, and multiple Unix/BSD jobs; Linux container-cgroup uses Temurin 21; FFM tests are gated to Linux/macOS/Windows; OshiMetrics tests use JUnit assumptions and platform-aware assertions to skip or relax checks when metrics are absent.

Changes

JDK Version Upgrade & Test Guards

Layer / File(s) Summary
Core test matrix JDK version updates
.github/workflows/linux.yaml, .github/workflows/macos.yaml, .github/workflows/pr.yaml, .github/workflows/windows.yaml
Testmatrix jobs updated: JDK lists moved from including 11 (and an include for 17) to using 21, 25, 26 (with include overrides adjusted where applicable).
Linux container-cgroup image setup
.github/workflows/linux.yaml
container-cgroup job: actions/setup-java switched from 17→21 and the Docker JDK image tag changed to eclipse-temurin:21-jdk.
Unix/BSD platform-specific JDK updates
.github/workflows/unix.yaml
FreeBSD now uses OpenJDK 25; OpenBSD, OpenIndiana, DragonFly, and NetBSD updated to JDK 21 with JAVA_HOME/PATH adjustments; Solaris x86 VM job removed; several SSH job secrets switched to GCC_CI_KEY and job owner gating removed.
FFM tests: OS gating
oshi-core-ffm/src/test/java/oshi/ffm/*
Added @EnabledOnOs({ OS.LINUX, OS.MAC, OS.WINDOWS }) and imports to multiple FFM test classes to restrict execution platforms.
OshiMetrics test guards and platform assertions
oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.java
Disk-related metric assertions changed to Assumptions.assumeTrue(... != null, ...) so tests skip when metrics are absent; process memory assertions branch on PlatformEnum to allow non-negative values on certain BSDs and require positive elsewhere.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • oshi/oshi#3300: Modifies OperatingSystemFFMTest (same class annotated with OS gating in this PR).
  • oshi/oshi#3184: Related CI matrix changes and JMH/benchmark gating tied to matrix.java.
  • oshi/oshi#3155: Overlapping workflow JDK matrix and Codecov/Jacoco upload behavior updates.

Poem

🐰 I hopped through CI, swapped old JDKs for new,
21, 25, 26 — the matrix grew.
When disks are shy the tests step light,
BSD memory checks now mind their height.
A tiny hop for builds, a carrot in view.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: updating CI Java versions across multiple workflows to target current LTS releases (21, 25, 26).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/unix.yaml (1)

186-207: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

testnetbsd-gcc70 “Test JDK 21” label isn’t enforced in the SSH script.
The SSH job’s script: only resets/pulls and runs ./mvnw ...—it sets neither JAVA_HOME nor PATH, and doesn’t run java -version, so the JDK is whatever the gcc70.fsffrance.org account defaults to. Either pin OpenJDK 21 explicitly in the SSH script (or add a java -version/fail-fast check), or adjust the job name to match the actual runtime.

🤖 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 around lines 186 - 207, The SSH step under the
testnetbsd-gcc70 job doesn’t enforce JDK 21 because the script block in the step
(script:) never sets JAVA_HOME or updates PATH nor validates the runtime; update
the script in the testnetbsd-gcc70 job (the SSH action step using
appleboy/ssh-action) to either install/select OpenJDK 21 or export JAVA_HOME and
adjust PATH to point to a validated JDK 21 before running ./mvnw, and add a
quick verification like java -version (and fail-fast if it’s not 21) so the job
label truly reflects the runtime.
🤖 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.

Outside diff comments:
In @.github/workflows/unix.yaml:
- Around line 186-207: The SSH step under the testnetbsd-gcc70 job doesn’t
enforce JDK 21 because the script block in the step (script:) never sets
JAVA_HOME or updates PATH nor validates the runtime; update the script in the
testnetbsd-gcc70 job (the SSH action step using appleboy/ssh-action) to either
install/select OpenJDK 21 or export JAVA_HOME and adjust PATH to point to a
validated JDK 21 before running ./mvnw, and add a quick verification like java
-version (and fail-fast if it’s not 21) so the job label truly reflects the
runtime.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a97d6e00-6465-488a-85c8-9c7b12b5812f

📥 Commits

Reviewing files that changed from the base of the PR and between 9cd0c48 and 3a34eca.

📒 Files selected for processing (5)
  • .github/workflows/linux.yaml
  • .github/workflows/macos.yaml
  • .github/workflows/pr.yaml
  • .github/workflows/unix.yaml
  • .github/workflows/windows.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). (1)
  • GitHub Check: Codacy Static Code Analysis
🧰 Additional context used
🧠 Learnings (1)
📚 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/windows.yaml
  • .github/workflows/macos.yaml
  • .github/workflows/linux.yaml
  • .github/workflows/pr.yaml
  • .github/workflows/unix.yaml
🪛 zizmor (1.25.2)
.github/workflows/unix.yaml

[warning] 61-61: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🔇 Additional comments (6)
.github/workflows/linux.yaml (1)

46-50: LGTM!

Also applies to: 85-103

.github/workflows/macos.yaml (1)

20-25: LGTM!

.github/workflows/pr.yaml (1)

43-43: LGTM!

.github/workflows/windows.yaml (1)

20-20: LGTM!

.github/workflows/unix.yaml (2)

15-33: LGTM!

Also applies to: 38-53, 145-183


55-72: ⚡ Quick win

OpenIndiana OpenJDK 21: openjdk21 + /usr/jdk/openjdk21 align
OpenIndiana Hipster’s IPS defines the OpenJDK 21 runtime component as openjdk21, and the installed JDK directory is under /usr/jdk/openjdk21 (commonly using /usr/jdk/openjdk21/bin on PATH). This matches the workflow’s pkg install openjdk21 and JAVA_HOME=/usr/jdk/openjdk21.

@dbwiddis
dbwiddis force-pushed the update-jdk-versions branch from 3a34eca to 5ab6797 Compare June 1, 2026 19:25
@codecov

codecov Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.34%. Comparing base (9cd0c48) to head (899372a).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3314      +/-   ##
============================================
- Coverage     76.38%   76.34%   -0.04%     
  Complexity       76       76              
============================================
  Files           412      412              
  Lines         15974    15974              
  Branches       2583     2583              
============================================
- Hits          12201    12196       -5     
- Misses         2281     2285       +4     
- Partials       1492     1493       +1     
Flag Coverage Δ
linux 41.08% <ø> (-0.01%) ⬇️
macos 41.39% <ø> (-0.01%) ⬇️
windows 49.29% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dbwiddis
dbwiddis force-pushed the update-jdk-versions branch from 5ab6797 to 2566f77 Compare June 1, 2026 19:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/unix.yaml (1)

15-32: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix FreeBSD workflow to install the correct OpenJDK 25 package name (not openjdk25).

The FreeBSD packagesite for FreeBSD:14:amd64 does not contain a package named exactly openjdk25, so pkg install -y openjdk25 will fail. Adjust the workflow to install the available variant(s) (e.g., the openjdk25-* packages from java/openjdk25) and confirm the resulting JAVA_HOME install path matches the chosen package.

🤖 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 around lines 15 - 32, The FreeBSD job
(testfreebsd / step id test-freebsd) is attempting to install a nonexistent
package `openjdk25`; update the prepare script to install the actual OpenJDK 25
package(s) available in the FreeBSD repo (for example the `java/openjdk25`
collection or the specific `openjdk25-*` runtime/jdk package names) and then set
JAVA_HOME and PATH in the run step to the real install location returned by that
package (adjust the exported JAVA_HOME in the run block if the package places
OpenJDK under a different path). Ensure the prepare step uses the correct pkg
install invocation for the chosen package(s) and the run step’s export
JAVA_HOME=/usr/local/openjdk25 is replaced with the correct install path for the
package you pick.
🤖 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-metrics/src/test/java/oshi/metrics/OshiMetricsTest.java`:
- Around line 157-163: The test diskIoRegistered uses assumeTrue(read != null)
but then asserts write is non-null with assertNotNull, which can fail on
disk-less systems; change the write null-check to the same skip pattern by
replacing assertNotNull(write, ...) with assumeTrue(write != null, "No disks
detected on this platform; skipping") (or an equivalent assumeTrue with a clear
message) so both read and write counters use consistent assume-based skipping;
locate this in the diskIoRegistered test where
registry.find("system.disk.io").tag("disk.io.direction",
"write").functionCounter() is assigned to write.

---

Outside diff comments:
In @.github/workflows/unix.yaml:
- Around line 15-32: The FreeBSD job (testfreebsd / step id test-freebsd) is
attempting to install a nonexistent package `openjdk25`; update the prepare
script to install the actual OpenJDK 25 package(s) available in the FreeBSD repo
(for example the `java/openjdk25` collection or the specific `openjdk25-*`
runtime/jdk package names) and then set JAVA_HOME and PATH in the run step to
the real install location returned by that package (adjust the exported
JAVA_HOME in the run block if the package places OpenJDK under a different
path). Ensure the prepare step uses the correct pkg install invocation for the
chosen package(s) and the run step’s export JAVA_HOME=/usr/local/openjdk25 is
replaced with the correct install path for the package you pick.
🪄 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: 75cb790a-5d28-44f7-b636-6a738b6a3c26

📥 Commits

Reviewing files that changed from the base of the PR and between 3a34eca and 5ab6797.

📒 Files selected for processing (6)
  • .github/workflows/linux.yaml
  • .github/workflows/macos.yaml
  • .github/workflows/pr.yaml
  • .github/workflows/unix.yaml
  • .github/workflows/windows.yaml
  • oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.java
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/pr.yaml
  • .github/workflows/windows.yaml
  • .github/workflows/linux.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). (13)
  • GitHub Check: Test JDK 21, windows-latest
  • GitHub Check: Analyze (java)
  • GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 26, windows-latest
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 21, macos-latest
  • GitHub Check: Test JDK 26, macos-latest
  • GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
  • GitHub Check: JMH Benchmarks, windows-latest
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: JMH Benchmarks, ubuntu-latest
  • GitHub Check: JMH Benchmarks, macos-latest
  • GitHub Check: Codacy Static Code Analysis
🧰 Additional context used
🧠 Learnings (1)
📚 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/macos.yaml
  • .github/workflows/unix.yaml
🪛 zizmor (1.25.2)
.github/workflows/unix.yaml

[warning] 59-59: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🔇 Additional comments (8)
oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.java (2)

10-10: LGTM!

Also applies to: 19-19, 160-160, 169-169, 176-176, 183-183


284-297: ⚖️ Poor tradeoff

Validate NetBSD/DragonFly “>= 0” expectations for process memory metrics

The processMemoryRegistered test now allows process.memory.usage and process.memory.virtual to be zero on PlatformEnum.NETBSD and PlatformEnum.DRAGONFLYBSD. Confirm on actual BSD CI runners whether OSHI genuinely reports zeros or whether the NetBSD/DragonFly process memory collectors sometimes return 0 due to an implementation/measurement issue; if zeros are not expected, adjust the OSHI platform code (or tighten the assertions) rather than relaxing the test.

.github/workflows/macos.yaml (1)

20-25: ⚡ Quick win

Confirm Zulu JDK 26 availability for the macOS matrix

The Azul Zulu metadata API returns macOS “AVAILABLE” artifacts for Java 26 for both architectures (macosx_x64 and macosx_aarch64), so actions/setup-java@v5 with distribution: 'zulu' should be able to provision JDK 26 for the macOS runners in this matrix.

        # Previous LTS, Current LTS, Current release
        java: [21, 25, 26]
        os: [macos-14, macos-15, macos-26]
        include:
          - java: 21
            os: 'macos-26-intel'
.github/workflows/unix.yaml (5)

54-70: ⚡ Quick win

Check OpenJDK 21 package + validate JAVA_HOME path on OpenIndiana.

OpenJDK 21 is present in OpenIndiana’s packaging sources (runtime FMRI runtime/java/openjdk21 / “openjdk-21”), so pkg install openjdk21 is likely correct. The public evidence gathered doesn’t show the on-disk install prefix, so the JAVA_HOME=/usr/jdk/openjdk21 assumption should be validated on the VM (e.g., via pkg contents -H runtime/java/openjdk21* and confirming the resulting JDK directory).


139-158: ⚡ Quick win

OpenJDK 21 availability + JAVA_HOME path for DragonFly BSD look correct.

openjdk21 is available via the DragonFly BSD package repository (pkg install openjdk21), and the install prefix used by the package is /usr/local/openjdk21, so JAVA_HOME=/usr/local/openjdk21 in the workflow is appropriate.


101-137: ⚖️ Poor tradeoff

Add a repo-owner guard for the AIX SSH job (or document fork behavior)

In .github/workflows/unix.yaml, the AIX testaix job runs appleboy/ssh-action without any if: github.repository_owner == 'oshi' conditional, so it would attempt the SSH host gcc119.fsffrance.org even on forks where ${{ secrets.AIX_OSHI_KEY }} won’t be available. Was that removal intentional—if not, restore a job/step-level owner conditional (or adjust workflow triggers) to avoid fork CI failures.


160-202: ⚡ Quick win

Confirm OpenJDK 21 (pkgsrc) availability and JAVA_HOME path on NetBSD

  • NetBSD pkgsrc provides lang/openjdk21, so pkg_add openjdk21 is available.
  • With the default pkgsrc prefix (LOCALBASE=/usr/pkg), the JDK is installed under /usr/pkg/java/openjdk21, which matches the workflow’s JAVA_HOME=/usr/pkg/java/openjdk21 (and corresponding PATH update).

34-52: ⚡ Quick win

OpenBSD 7.7 has JDK 21, but pkg_add jdk%21 needs selector validation (it’s not a version wildcard).

  • OpenBSD 7.7 includes OpenJDK 21 (e.g., 21.0.6).
  • However, pkg_add documents pkgname%branch semantics for % (not generic jdk-21 selection). The actual packages are published with a jdk-21... stem, so ensure pkg_add jdk%21 resolves to the jdk-21... packages in the 7.7 repos; otherwise switch to an explicit jdk-21.../correct branch form for the JDK 21 port.

@dbwiddis
dbwiddis force-pushed the update-jdk-versions branch from 2566f77 to 6175e9e Compare June 1, 2026 19:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/unix.yaml (1)

15-32: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix FreeBSD workflow: validate openjdk25 pkg availability (and add fallback)
In .github/workflows/unix.yaml (testfreebsd), the VM job runs pkg install -y openjdk25. Quick checks against FreeBSD’s ports.cgi and FreshPorts didn’t find openjdk25, so this step may fail at runtime. Confirm openjdk25 is available as a binary package for the specific FreeBSD release used by vmactions/freebsd-vm; if not, update the workflow to install an available OpenJDK package (and adjust JAVA_HOME accordingly).

🤖 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 around lines 15 - 32, The workflow job
testfreebsd currently installs openjdk25 in the prepare step and hardcodes
JAVA_HOME in the run step, but openjdk25 may not be available; update the
prepare/run blocks to first check which OpenJDK package exists on the FreeBSD
image (e.g., pkg search or pkg info for openjdk*), choose a known-available
package (fallback to openjdk17 or openjdk18 if openjdk25 is missing), install
that package instead of openjdk25, and update the JAVA_HOME export in the run
step to match the installed package path so the testfreebsd job
(vmactions/freebsd-vm usage) uses a valid JDK.
🧹 Nitpick comments (2)
.github/workflows/unix.yaml (2)

34-52: ⚡ Quick win

Consider setting JAVA_HOME explicitly for consistency.

Unlike FreeBSD, DragonFly BSD, and NetBSD jobs, the OpenBSD job doesn't explicitly set JAVA_HOME or update PATH after installing JDK 21. While the OpenBSD maven package may locate Java automatically, adding explicit environment configuration would improve consistency and reliability across all BSD jobs.

Suggested addition for consistency
          run: |
+           export JAVA_HOME=/usr/local/jdk-21
+           export PATH=$JAVA_HOME/bin:$PATH
            mvn clean test -B -Djacoco.skip=true

Note: Verify the correct JAVA_HOME path for OpenBSD's jdk%21 package (commonly /usr/local/jdk-21 or /usr/local/jdk-21.0.x).

🤖 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 around lines 34 - 52, The OpenBSD job (job name
testopenbsd, step id test-openbsd using vmactions/openbsd-vm) should explicitly
set JAVA_HOME and update PATH after installing jdk%21; modify the prepare or run
block to export the correct OpenBSD JDK install path (e.g., /usr/local/jdk-21 or
/usr/local/jdk-21.0.x) into JAVA_HOME and prepend $JAVA_HOME/bin to PATH, and
ensure these exports occur before invoking mvn so Maven picks up the intended
JDK.

20-20: ⚡ Quick win

Add persist-credentials: false to checkout actions for security.

Multiple checkout actions in this workflow don't set persist-credentials: false, which is a security best practice. This setting prevents the GitHub token from persisting in the .git/config and being accessible to subsequent steps, reducing the risk of credential exfiltration.

Recommended security hardening
       - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
+        with:
+          persist-credentials: false

Apply this pattern to all actions/checkout invocations at lines 20, 39, 59, 146, and 167.

Also applies to: 39-39, 59-59, 146-146, 167-167

🤖 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 20, The workflow uses actions/checkout
at several steps (entries using the string "uses: actions/checkout@...") without
the persist-credentials setting; update each checkout step to include
persist-credentials: false under the step's with: block so the GITHUB_TOKEN is
not written to .git/config—apply this change to every checkout invocation found
(the ones currently pinned like
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd and the other checkout
occurrences) to follow the security best practice.
🤖 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.

Outside diff comments:
In @.github/workflows/unix.yaml:
- Around line 15-32: The workflow job testfreebsd currently installs openjdk25
in the prepare step and hardcodes JAVA_HOME in the run step, but openjdk25 may
not be available; update the prepare/run blocks to first check which OpenJDK
package exists on the FreeBSD image (e.g., pkg search or pkg info for openjdk*),
choose a known-available package (fallback to openjdk17 or openjdk18 if
openjdk25 is missing), install that package instead of openjdk25, and update the
JAVA_HOME export in the run step to match the installed package path so the
testfreebsd job (vmactions/freebsd-vm usage) uses a valid JDK.

---

Nitpick comments:
In @.github/workflows/unix.yaml:
- Around line 34-52: The OpenBSD job (job name testopenbsd, step id test-openbsd
using vmactions/openbsd-vm) should explicitly set JAVA_HOME and update PATH
after installing jdk%21; modify the prepare or run block to export the correct
OpenBSD JDK install path (e.g., /usr/local/jdk-21 or /usr/local/jdk-21.0.x) into
JAVA_HOME and prepend $JAVA_HOME/bin to PATH, and ensure these exports occur
before invoking mvn so Maven picks up the intended JDK.
- Line 20: The workflow uses actions/checkout at several steps (entries using
the string "uses: actions/checkout@...") without the persist-credentials
setting; update each checkout step to include persist-credentials: false under
the step's with: block so the GITHUB_TOKEN is not written to .git/config—apply
this change to every checkout invocation found (the ones currently pinned like
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd and the other checkout
occurrences) to follow the security best practice.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cba6c018-0bd6-435f-bba2-a9cb7a651801

📥 Commits

Reviewing files that changed from the base of the PR and between 5ab6797 and 2566f77.

📒 Files selected for processing (6)
  • .github/workflows/linux.yaml
  • .github/workflows/macos.yaml
  • .github/workflows/pr.yaml
  • .github/workflows/unix.yaml
  • .github/workflows/windows.yaml
  • oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.java
🚧 Files skipped from review as they are similar to previous changes (5)
  • .github/workflows/pr.yaml
  • .github/workflows/macos.yaml
  • .github/workflows/linux.yaml
  • .github/workflows/windows.yaml
  • oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.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). (1)
  • GitHub Check: Codacy Static Code Analysis
🧰 Additional context used
🧠 Learnings (1)
📚 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
🪛 zizmor (1.25.2)
.github/workflows/unix.yaml

[warning] 59-59: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🔇 Additional comments (3)
.github/workflows/unix.yaml (3)

54-70: LGTM!


141-181: LGTM!


183-205: 🏗️ Heavy lift

Verify JDK 21 is installed and configured on the gcc70 GCC farm server.

The job name was updated to reflect JDK 21, but unlike the NetBSD VM job (lines 177-179), this SSH-based job doesn't set JAVA_HOME or PATH in the script. The workflow assumes JDK 21 is pre-installed and configured on the gcc70.fsffrance.org server. If the server administrator hasn't updated the environment, the Maven build will fail or run on an older JDK.

Consider either:

  1. Coordinating with the GCC farm administrator to confirm JDK 21 is installed and is the default Java version on gcc70, or
  2. Adding explicit JAVA_HOME/PATH setup in the SSH script similar to the AIX job pattern (lines 120-121)

@dbwiddis
dbwiddis force-pushed the update-jdk-versions branch from 6175e9e to b4d781b Compare June 1, 2026 19:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/unix.yaml (2)

54-73: Optional: scope down workflow permissions.

Static analysis flags this workflow as running with default token permissions and persisting credentials on checkout. Since these VM jobs only need read access to the repo, adding a top-level permissions: { contents: read } block (and persist-credentials: false on the checkout steps) would tighten the security posture. This applies workflow-wide rather than to this job specifically, and is pre-existing, so it can be addressed separately.

🤖 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 around lines 54 - 73, Add a top-level
permissions block to restrict token scope and set checkout to not persist
credentials: add permissions: { contents: read } at the workflow root, and
update each actions/checkout step (e.g., the checkout in the testopenindiana
job) to include persist-credentials: false; this keeps jobs like testopenindiana
and other VM jobs read-only while preventing the default token from being stored
in the workspace.

90-95: ⚡ Quick win

Remove the temporary JDK-exploration debug block.

Lines 90–95 look like debugging artifacts left in from investigating JDK availability on gcc211 (the job still targets JDK 11, yet it probes for jdk-17 and runs a filesystem-wide find /). These add noise and runtime to the SSH job without affecting the test run and should be dropped before merge.

♻️ Proposed cleanup
           set -e
           source .profile
-          echo "=== JDK exploration ==="
-          find / -name "javac" -o -name "java" 2>/dev/null | grep -v proc | head -10
-          ls ~/java/ 2>/dev/null || echo "no ~/java"
-          /usr/jdk/instances/jdk-17/bin/java -version 2>&1 || echo "no jdk-17 in /usr/jdk"
-          pkg list '*jdk*' 2>/dev/null || echo "pkg list failed"
-          echo "=== END exploration ==="
           cd ~/git/oshi

If this exploration is intentional and you want to keep it temporarily, I can open a tracking issue to remove it later.

🤖 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 around lines 90 - 95, Remove the temporary
JDK-exploration debug block bounded by the echo markers "=== JDK exploration
===" and "=== END exploration ===" in the unix.yaml SSH job (the lines running
find /, ls ~/java, /usr/jdk/instances/jdk-17/bin/java -version and pkg list
'*jdk*'); delete these lines so the workflow no longer performs the
filesystem-wide find and JDK-17 probes (or alternatively comment them out with a
TODO/issue reference if you need them temporarily).
🤖 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:
- Around line 65-70: The workflow sets JAVA_HOME incorrectly for OpenIndiana
Hipster's openjdk21; update the environment exports in the unix.yaml step to use
the OpenIndiana installation path by exporting
JAVA_HOME=/usr/jdk/instances/openjdk21 (ensure PATH uses $JAVA_HOME/bin:$PATH)
so that the subsequent java -version and ./mvnw commands pick up the correct JDK
installation rather than an unintended java.

---

Nitpick comments:
In @.github/workflows/unix.yaml:
- Around line 54-73: Add a top-level permissions block to restrict token scope
and set checkout to not persist credentials: add permissions: { contents: read }
at the workflow root, and update each actions/checkout step (e.g., the checkout
in the testopenindiana job) to include persist-credentials: false; this keeps
jobs like testopenindiana and other VM jobs read-only while preventing the
default token from being stored in the workspace.
- Around line 90-95: Remove the temporary JDK-exploration debug block bounded by
the echo markers "=== JDK exploration ===" and "=== END exploration ===" in the
unix.yaml SSH job (the lines running find /, ls ~/java,
/usr/jdk/instances/jdk-17/bin/java -version and pkg list '*jdk*'); delete these
lines so the workflow no longer performs the filesystem-wide find and JDK-17
probes (or alternatively comment them out with a TODO/issue reference if you
need them temporarily).
🪄 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: 97cf1def-b146-49ae-a16f-1f525b2397c9

📥 Commits

Reviewing files that changed from the base of the PR and between 6175e9e and b4d781b.

📒 Files selected for processing (6)
  • .github/workflows/linux.yaml
  • .github/workflows/macos.yaml
  • .github/workflows/pr.yaml
  • .github/workflows/unix.yaml
  • .github/workflows/windows.yaml
  • oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.java
🚧 Files skipped from review as they are similar to previous changes (5)
  • .github/workflows/pr.yaml
  • .github/workflows/windows.yaml
  • .github/workflows/macos.yaml
  • oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.java
  • .github/workflows/linux.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: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: JMH Benchmarks, ubuntu-latest
  • GitHub Check: Test JDK 26, macos-latest
  • GitHub Check: Test JDK 26, windows-latest
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: JMH Benchmarks, windows-latest
  • GitHub Check: Analyze (java)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: JMH Benchmarks, macos-latest
🧰 Additional context used
🧠 Learnings (1)
📚 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
🪛 zizmor (1.25.2)
.github/workflows/unix.yaml

[warning] 59-59: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[warning] 55-73: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

🔇 Additional comments (5)
.github/workflows/unix.yaml (5)

28-32: FreeBSD JDK 25 path confirmed.

/usr/local/openjdk25 is the correct JAVA_HOME for the FreeBSD openjdk25 port. The most current version is java/openjdk25, with java/openjdk24, java/openjdk23, java/openjdk22, java/openjdk21, java/openjdk17, java/openjdk11, and java/openjdk8, also available. The export path also matches what FreeBSD users report for this port: export JAVA_HOME="/usr/local/openjdk25".


49-52: LGTM!


159-162: LGTM!


180-182: LGTM!


84-84: ⚡ Quick win

Ensure GCC_CI_KEY secret + remote authorized_keys for the three SSH hosts

.github/workflows/unix.yaml now consistently uses key: ${{ secrets.GCC_CI_KEY }} for the Solaris SPARC (gcc211), AIX (gcc119), and NetBSD GCC-farm (gcc70) jobs (no remaining AIX_OSHI_KEY references in the workflows). Still ensure the GCC_CI_KEY repo/org secret exists and its public key is present in ~oshi/.ssh/authorized_keys on all three hosts to avoid SSH handshake failures.

Comment on lines +65 to 70
pkg install openjdk21
run: |
wget https://download.bell-sw.com/java/11.0.15.1+2/bellsoft-jdk11.0.15.1+2-solaris-x64-lite.tar.gz -nv
gunzip bellsoft-jdk11.0.15.1+2-solaris-x64-lite.tar.gz
tar xf bellsoft-jdk11.0.15.1+2-solaris-x64-lite.tar
rm bellsoft-jdk11.0.15.1+2-solaris-x64-lite.tar
mv jdk-11.0.15.1-lite /var/tmp
export JAVA_HOME=/var/tmp/jdk-11.0.15.1-lite
export PATH=$JAVA_HOME:$PATH
export JAVA_HOME=/usr/jdk/openjdk21
export PATH=$JAVA_HOME/bin:$PATH
java -version
./mvnw clean test -B -Djacoco.skip=true -Dmaven.gitcommitid.skip=true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

OpenIndiana hipster pkg openjdk21 install directory path JAVA_HOME

💡 Result:

On OpenIndiana Hipster, you can install OpenJDK 21 using the Image Package System (IPS) via the following command: pfexec pkg install runtime/java/openjdk21 Based on the standard OpenIndiana directory structure and build system configurations, the typical installation path for OpenJDK 21 is: /usr/jdk/instances/openjdk21 Consequently, to set the JAVA_HOME environment variable to point to this installation, you should use the following path: export JAVA_HOME=/usr/jdk/instances/openjdk21 You can verify the installation by checking for the presence of the java executable in that directory, such as running /usr/jdk/instances/openjdk21/bin/java -version [1][2][3].

Citations:


Fix JAVA_HOME for OpenIndiana Hipster openjdk21

runtime/java/openjdk21 is typically installed under /usr/jdk/instances/openjdk21 on OpenIndiana, so JAVA_HOME=/usr/jdk/openjdk21 is likely wrong (making PATH/java -version pick up an unintended java). Update .github/workflows/unix.yaml to set JAVA_HOME=/usr/jdk/instances/openjdk21.

🤖 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 around lines 65 - 70, The workflow sets
JAVA_HOME incorrectly for OpenIndiana Hipster's openjdk21; update the
environment exports in the unix.yaml step to use the OpenIndiana installation
path by exporting JAVA_HOME=/usr/jdk/instances/openjdk21 (ensure PATH uses
$JAVA_HOME/bin:$PATH) so that the subsequent java -version and ./mvnw commands
pick up the correct JDK installation rather than an unintended java.

@dbwiddis
dbwiddis force-pushed the update-jdk-versions branch 3 times, most recently from 804a506 to afc1bf4 Compare June 1, 2026 20:21

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @.github/workflows/unix.yaml:
- Around line 55-59: The testopenindiana job currently inherits full workflow
GITHUB_TOKEN and leaves credentials in the workspace; restrict its permissions
by adding a job-level permissions block with contents: read, and update the
actions/checkout step used in that job
(actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd) to set
persist-credentials: false so the token is not written into the workspace before
handing off to the VM.
- Around line 90-105: The job labeled "Test JDK 11, Solaris SPARC" currently
provisions /opt/cfarm/jdk-17 and downloads JDK 17 but never enforces JAVA_HOME
before running ./mvnw; either change the provisioning to JDK 11 (use
/opt/cfarm/jdk-11 and JDK 11 download URLs and extraction names) or rename the
job to indicate JDK 17 and explicitly set JAVA_HOME and PATH after extraction
(e.g., export JAVA_HOME=/opt/cfarm/jdk-17; export PATH=$JAVA_HOME/bin:$PATH) and
verify with $JAVA_HOME/bin/java -version before invoking ./mvnw (ensure this
happens after source .profile).
🪄 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: afbf2a60-3666-4ebf-a231-21edd0b36d95

📥 Commits

Reviewing files that changed from the base of the PR and between b4d781b and 804a506.

📒 Files selected for processing (11)
  • .github/workflows/linux.yaml
  • .github/workflows/macos.yaml
  • .github/workflows/pr.yaml
  • .github/workflows/unix.yaml
  • .github/workflows/windows.yaml
  • oshi-core-ffm/src/test/java/oshi/ffm/ForeignFunctionsTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/GlobalMemoryFFMTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/OperatingSystemFFMTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/VirtualMemoryFFMTest.java
  • oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.java
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/pr.yaml
  • .github/workflows/macos.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/windows.yaml
  • .github/workflows/linux.yaml
  • oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.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). (7)
  • GitHub Check: Analyze (java)
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 26, macos-latest
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: JMH Benchmarks, windows-latest
  • GitHub Check: JMH Benchmarks, macos-latest
  • GitHub Check: Codacy Static Code Analysis
🧰 Additional context used
🧠 Learnings (1)
📚 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
🪛 zizmor (1.25.2)
.github/workflows/unix.yaml

[warning] 59-59: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[warning] 55-73: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

🔇 Additional comments (6)
oshi-core-ffm/src/test/java/oshi/ffm/ForeignFunctionsTest.java (1)

17-17: LGTM!

Also applies to: 19-19, 27-27

oshi-core-ffm/src/test/java/oshi/ffm/GlobalMemoryFFMTest.java (1)

23-23: LGTM!

Also applies to: 25-25, 31-31

oshi-core-ffm/src/test/java/oshi/ffm/OperatingSystemFFMTest.java (1)

29-29: LGTM!

oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java (1)

40-40: LGTM!

Also applies to: 42-42, 54-54

oshi-core-ffm/src/test/java/oshi/ffm/VirtualMemoryFFMTest.java (1)

16-16: LGTM!

Also applies to: 18-18, 23-23

.github/workflows/unix.yaml (1)

17-31: LGTM!

Also applies to: 37-52, 161-199

Comment on lines +55 to 59
testopenindiana:
name: Test JDK 21, OpenIndiana
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Minimize token exposure before handing the repo to the VM.

This new job only needs a read-only checkout, but it inherits the workflow’s default GITHUB_TOKEN permissions and persists that credential into the workspace before passing it to a third-party VM action. Set the job token to contents: read and disable checkout credential persistence here.

🔐 Minimal hardening change
   testopenindiana:
     name: Test JDK 21, OpenIndiana
     runs-on: ubuntu-24.04
+    permissions:
+      contents: read
     steps:
-      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
+      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
+        with:
+          persist-credentials: false
       - name: Test on OpenIndiana
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 59-59: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[warning] 55-73: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

🤖 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 around lines 55 - 59, The testopenindiana job
currently inherits full workflow GITHUB_TOKEN and leaves credentials in the
workspace; restrict its permissions by adding a job-level permissions block with
contents: read, and update the actions/checkout step used in that job
(actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd) to set
persist-credentials: false so the token is not written into the workspace before
handing off to the VM.

Comment thread .github/workflows/unix.yaml Resolved
@dbwiddis
dbwiddis force-pushed the update-jdk-versions branch from afc1bf4 to f0808d2 Compare June 1, 2026 20:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @.github/workflows/unix.yaml:
- Around line 47-52: The workflow installs jdk%21 but never pins Maven to that
JDK; update the job so the run step uses the installed JDK 21 by exporting
JAVA_HOME and prepending its bin to PATH (or invoking mvn with env vars) before
calling the existing mvn clean test -B -Djacoco.skip=true; specifically, after
the prepare step that runs pkg_add jdk%21, set JAVA_HOME to the JDK 21 install
directory and do PATH="$JAVA_HOME/bin:$PATH" (or use env JAVA_HOME=... PATH=...
mvn ...) so the mvn command uses JDK 21.
- Line 198: The job labeled testnetbsd-gcc70 merely updates the display name but
doesn’t pin JDK 21; modify the testnetbsd-gcc70 job’s SSH script block (the
section that currently runs ./mvnw clean test ...) to install or select JDK 21
and set JAVA_HOME and PATH before invoking ./mvnw (e.g., install or point
JAVA_HOME to the JDK 21 installation, export JAVA_HOME, update PATH, and run
java -version to verify), so the workflow actually runs under JDK 21 rather than
relying on the display name.
🪄 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: 7fe001e4-6a9d-4357-b861-6f8b1a378d75

📥 Commits

Reviewing files that changed from the base of the PR and between 804a506 and f0808d2.

📒 Files selected for processing (11)
  • .github/workflows/linux.yaml
  • .github/workflows/macos.yaml
  • .github/workflows/pr.yaml
  • .github/workflows/unix.yaml
  • .github/workflows/windows.yaml
  • oshi-core-ffm/src/test/java/oshi/ffm/ForeignFunctionsTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/GlobalMemoryFFMTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/OperatingSystemFFMTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/VirtualMemoryFFMTest.java
  • oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.java
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/linux.yaml
  • .github/workflows/windows.yaml
🚧 Files skipped from review as they are similar to previous changes (8)
  • .github/workflows/pr.yaml
  • .github/workflows/macos.yaml
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/OperatingSystemFFMTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/ForeignFunctionsTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/VirtualMemoryFFMTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/GlobalMemoryFFMTest.java
  • oshi-metrics/src/test/java/oshi/metrics/OshiMetricsTest.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). (7)
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 26, macos-latest
  • GitHub Check: JMH Benchmarks, macos-latest
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: JMH Benchmarks, windows-latest
  • GitHub Check: Analyze (java)
  • GitHub Check: Codacy Static Code Analysis
🧰 Additional context used
🧠 Learnings (1)
📚 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
🪛 zizmor (1.25.2)
.github/workflows/unix.yaml

[warning] 59-59: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[warning] 55-73: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

🔇 Additional comments (1)
.github/workflows/unix.yaml (1)

90-103: The SPARC lane still provisions JDK 17 under a JDK 11 contract.

This block downloads and exports /opt/cfarm/jdk-17.0.19, so it no longer matches the Test JDK 11, Solaris SPARC target on Line 75. Either switch the provisioning back to JDK 11 or rename the job/objective to JDK 17.

Comment thread .github/workflows/unix.yaml Resolved
# SSH into NetBSD server on GCC Compile Farm and run tests
testnetbsd-gcc70:
name: Test JDK 11, NetBSD (GCC farm)
name: Test JDK 21, NetBSD (GCC farm)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the exact sections around the referenced lines
sed -n '160,240p' .github/workflows/unix.yaml | nl -ba | sed -n '1,120p'

# Also inspect the referenced later range more tightly
sed -n '190,230p' .github/workflows/unix.yaml | nl -ba

# Find any matrix entries / job parameters mentioning NetBSD, gcc70, or JDK
rg -n --hidden --no-ignore-vcs -S "NetBSD|netbsd|gcc70|JDK|jdk|temurin|setup-java|java-version|baseline|GCC farm" .github/workflows/unix.yaml

Repository: oshi/oshi

Length of output: 96


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file=".github/workflows/unix.yaml"
[ -f "$file" ] || { echo "Missing $file"; exit 1; }

echo "=== unix.yaml 160-240 ==="
sed -n '160,240p' "$file" | awk '{printf "%d\t%s\n", NR+159, $0}'

echo "=== unix.yaml 190-230 ==="
sed -n '190,230p' "$file" | awk '{printf "%d\t%s\n", NR+189, $0}'

echo "=== Search for lane identifiers and JDK pinning ==="
rg -n -S "NetBSD|netbsd|gcc70|GCC farm|JDK|jdk|temurin|setup-java|java-version|baseline" "$file"

Repository: oshi/oshi

Length of output: 5062


Pin the GCC-farm NetBSD job’s JDK (the display name isn’t enough).

In .github/workflows/unix.yaml, the testnetbsd-gcc70 lane only updates name: Test JDK 21, NetBSD (GCC farm), but the SSH script never sets JAVA_HOME / installs a specific JDK— it just runs ./mvnw clean test ..., so it won’t actually enforce JDK 21 and can drift with gcc70’s defaults.

🤖 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 198, The job labeled testnetbsd-gcc70
merely updates the display name but doesn’t pin JDK 21; modify the
testnetbsd-gcc70 job’s SSH script block (the section that currently runs ./mvnw
clean test ...) to install or select JDK 21 and set JAVA_HOME and PATH before
invoking ./mvnw (e.g., install or point JAVA_HOME to the JDK 21 installation,
export JAVA_HOME, update PATH, and run java -version to verify), so the workflow
actually runs under JDK 21 rather than relying on the display name.

@dbwiddis
dbwiddis force-pushed the update-jdk-versions branch from f0808d2 to 726bd98 Compare June 1, 2026 20:43
Main platforms (Linux, macOS, Windows):
- Matrix: [21, 25, 26] (previous LTS, current LTS, current release)
- ARM include: JDK 21 (was 17)
- Container cgroup test: JDK 21 (was 17)

Unix VMs (bump to highest available):
- FreeBSD: JDK 25 (was 11)
- OpenBSD: JDK 21 (was 11)
- DragonFly BSD: JDK 21 (was 11)
- NetBSD: JDK 21 (was 11)
- OpenIndiana: JDK 21, replaces Solaris 11.4 VM

SSH machines:
- Solaris SPARC (gcc211): JDK 11 (OS too old for JDK 17 binaries)
- AIX (gcc119): JDK 17

Other changes:
- Remove repository_owner gates (GCC_CI_KEY available on all repos)
- Rename secret from AIX_OSHI_KEY to GCC_CI_KEY
- Gate FFM tests to supported platforms (Linux, macOS, Windows) via
  @EnabledOnOs — fixes failures when running on BSD with JDK 25
- Fix oshi-metrics tests: use assumeTrue for absent disk metrics,
  platform-gated assertions for process memory on BSD VMs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant