Skip to content

Move to JDK 25 for build only#1709

Open
balamurugana wants to merge 1 commit into
minio:masterfrom
balamurugana:Move-to-JDK-25-for-build-only
Open

Move to JDK 25 for build only#1709
balamurugana wants to merge 1 commit into
minio:masterfrom
balamurugana:Move-to-JDK-25-for-build-only

Conversation

@balamurugana

@balamurugana balamurugana commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores
    • Updated CI and build tooling to explicitly support Java 25 in the build matrix while continuing to emit Java 8-compatible bytecode.
    • Refreshed Gradle wrapper to 9.6.0, including improved wrapper download retry behavior and updated wrapper launch mechanics.
    • Upgraded build plugins and key dependencies; adjusted publication signing configuration and added compilation exclusions for generated build artifacts.
    • Updated SpotBugs filtering and normalized repository line-ending rules with explicit binary handling.
  • Style
    • Applied formatting-only changes across select implementation code and functional tests.
  • Documentation
    • Improved Javadoc inline formatting for the HTTP body type.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3407dba5-e872-4421-a453-6f02ede69d55

📥 Commits

Reviewing files that changed from the base of the PR and between bfc1340 and ca6b18f.

⛔ Files ignored due to path filters (1)
  • gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
📒 Files selected for processing (13)
  • .gitattributes
  • .github/workflows/gradle.yml
  • adminapi/src/main/java/io/minio/admin/MinioAdminClient.java
  • api/src/main/java/io/minio/Checksum.java
  • api/src/main/java/io/minio/Http.java
  • api/src/main/java/io/minio/PartReader.java
  • api/src/main/java/io/minio/errors/MinioException.java
  • build.gradle
  • functional/TestMinioClient.java
  • gradle/wrapper/gradle-wrapper.properties
  • gradlew
  • gradlew.bat
  • spotbugs-filter.xml
✅ Files skipped from review due to trivial changes (7)
  • api/src/main/java/io/minio/Http.java
  • .gitattributes
  • api/src/main/java/io/minio/Checksum.java
  • api/src/main/java/io/minio/errors/MinioException.java
  • api/src/main/java/io/minio/PartReader.java
  • adminapi/src/main/java/io/minio/admin/MinioAdminClient.java
  • functional/TestMinioClient.java
🚧 Files skipped from review as they are similar to previous changes (5)
  • spotbugs-filter.xml
  • gradle/wrapper/gradle-wrapper.properties
  • gradlew.bat
  • gradlew
  • build.gradle

📝 Walkthrough

Walkthrough

Upgrades the project build toolchain to Java 25 and Gradle 9.6: configures git line-ending normalization, regenerates wrapper scripts (gradlew, gradlew.bat) to use -jar invocation, bumps all plugin/library dependency versions, pins bytecode to Java 8 release compatibility, adds Java 25 toolchain configuration, aligns the CI workflow, adds a SpotBugs filter entry, and applies reformatted Java sources from the upgraded googleJavaFormat.

Changes

Build infrastructure upgrade (Java 25 / Gradle 9.6)

Layer / File(s) Summary
Git line-ending normalization configuration
.gitattributes
Configures auto-detection of text files and normalizes to LF line endings; explicitly marks common binary/artifact formats (*.jar, *.zip, *.gz, *.class, *.png, *.jpg, *.gif, *.ico) as binary to prevent normalization.
Gradle wrapper scripts regenerated for 9.6
gradle/wrapper/gradle-wrapper.properties, gradlew, gradlew.bat
Updates distributionUrl to Gradle 9.6.0 with retries and retryBackOffMs settings; regenerates gradlew switching JVM launch from -classpath + GradleWrapperMain to -jar gradle-wrapper.jar and removing CLASSPATH assignments; regenerates gradlew.bat with setlocal EnableExtensions, immediate-exit error paths, -jar invocation, and new :exitWithErrorLevel label.
Build plugins, dependencies, toolchain, and source sets
build.gradle, spotbugs-filter.xml
Bumps Shadow, SpotBugs, JReleaser, and Spotless plugin versions; upgrades OkHttp, Jackson 2.22.x, commons-codec, SpotBugs annotations, MockWebServer, and JUnit Jupiter API; enforces options.release = 8 on compileJava and compileTestJava; adds Java toolchain at languageVersion = 25; bumps googleJavaFormat to 1.35.0; updates signing.required syntax in :api and :adminapi; upgrades progressbar and junit-jupiter-api in submodules; excludes build/** from :examples and :functional source sets; adds SpotBugs filter suppressing IAOM_DO_NOT_INCREASE_METHOD_ACCESSIBILITY for intentional public API overrides.
CI workflow aligned to Java 25 build setup
.github/workflows/gradle.yml
Adds a dedicated "Setup java 25 for building" step via actions/setup-java@v5 with temurin; updates the test-phase step condition to skip when matrix.java-version == '25'.

Java source formatting via googleJavaFormat 1.35.0

Layer / File(s) Summary
Reformatted Java sources
api/src/main/java/io/minio/errors/MinioException.java, api/src/main/java/io/minio/Checksum.java, api/src/main/java/io/minio/PartReader.java, api/src/main/java/io/minio/Http.java, adminapi/src/main/java/io/minio/admin/MinioAdminClient.java, functional/TestMinioClient.java
Applies whitespace-only reformatting: throwEncapsulatedException throws clause split to one-per-line; blank line added in Checksum.java; empty loop body moved to its own line in PartReader; Http.java Javadoc byte type marked as inline code; getBucketQuota fluent chain split across lines; PutObjectArgs builder chains reformatted in two test call sites.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • shtripat
  • allanrogerr

Poem

🐇 Hop hop, the toolchain grew!
Java twenty-five, shiny and new,
Gradle nine-point-six joins the crew,
The wrapper now launches with -jar too.
Line endings normalized, code formatted neat—
This bunny's build is now complete! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main objective: updating the build configuration to use JDK 25 (seen in .github/workflows/gradle.yml and build.gradle Java toolchain changes).
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.

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

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
.github/workflows/gradle.yml (1)

33-33: ⚡ Quick win

Consider pinning the GitHub Action to a commit hash.

The actions/setup-java@v5 reference uses a tag rather than a commit hash. Pinning to a specific commit SHA provides better security and reproducibility by preventing tag manipulation.

🔒 Example of pinning to a commit hash
-      - name: Setup java 25 for building
-        uses: actions/setup-java@v5
+      - name: Setup java 25 for building
+        uses: actions/setup-java@v5 # v5.2.0
+        # uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b

Note: Replace the commit hash with the actual SHA for the v5 release you intend to use.

🤖 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/gradle.yml at line 33, Replace the tag reference in the
`actions/setup-java@v5` action with a specific commit SHA hash instead of using
the version tag. Find the uses statement that references `actions/setup-java@v5`
and change it to pin to a full commit hash (the SHA of the v5 release). This
improves security and reproducibility by preventing potential tag manipulation.
You can find the correct commit SHA from the official actions/setup-java
releases on GitHub.

Source: Linters/SAST tools

build.gradle (1)

52-52: Version 2.22 is valid but consider using 2.22.0 for consistency.

Maven Central confirms that jackson-annotations:2.22 is a valid release version and will resolve correctly. However, using the explicit patch version 2.22.0 would match the version specifiers used for jackson-core and jackson-databind, improving consistency across Jackson dependencies.

🤖 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 `@build.gradle` at line 52, The jackson-annotations dependency in build.gradle
uses version 2.22 without an explicit patch version, which is inconsistent with
the other Jackson dependencies that use the format X.Y.Z. Update the version of
the jackson-annotations dependency from 2.22 to 2.22.0 to maintain consistency
across all Jackson dependency declarations in the build file.
gradle/wrapper/gradle-wrapper.properties (1)

5-6: Reconfigure retry settings to enable download resilience.

The current configuration sets retryBackOffMs=500 while retries=0, which disables retries entirely. This means the backoff setting is unused. If download reliability is desired, enable retries by setting retries to a positive value (e.g., retries=3). When retries=0 (the default), the wrapper makes only a single download attempt.

🤖 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 `@gradle/wrapper/gradle-wrapper.properties` around lines 5 - 6, The
gradle-wrapper.properties file has retry functionality disabled with
`retries=0`, which renders the `retryBackOffMs=500` setting ineffective since no
retries are attempted. To enable download resilience, change the `retries`
parameter from its current value of 0 to a positive integer such as 3. This will
activate the retry mechanism and ensure that the `retryBackOffMs` backoff timing
is actually used when download failures occur.
🤖 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/gradle.yml:
- Line 33: Replace the tag reference in the `actions/setup-java@v5` action with
a specific commit SHA hash instead of using the version tag. Find the uses
statement that references `actions/setup-java@v5` and change it to pin to a full
commit hash (the SHA of the v5 release). This improves security and
reproducibility by preventing potential tag manipulation. You can find the
correct commit SHA from the official actions/setup-java releases on GitHub.

In `@build.gradle`:
- Line 52: The jackson-annotations dependency in build.gradle uses version 2.22
without an explicit patch version, which is inconsistent with the other Jackson
dependencies that use the format X.Y.Z. Update the version of the
jackson-annotations dependency from 2.22 to 2.22.0 to maintain consistency
across all Jackson dependency declarations in the build file.

In `@gradle/wrapper/gradle-wrapper.properties`:
- Around line 5-6: The gradle-wrapper.properties file has retry functionality
disabled with `retries=0`, which renders the `retryBackOffMs=500` setting
ineffective since no retries are attempted. To enable download resilience,
change the `retries` parameter from its current value of 0 to a positive integer
such as 3. This will activate the retry mechanism and ensure that the
`retryBackOffMs` backoff timing is actually used when download failures occur.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6779d061-7d12-40d4-84d0-3f79a302b1de

📥 Commits

Reviewing files that changed from the base of the PR and between 942e2e5 and 9b40df5.

⛔ Files ignored due to path filters (1)
  • gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
📒 Files selected for processing (11)
  • .github/workflows/gradle.yml
  • adminapi/src/main/java/io/minio/admin/MinioAdminClient.java
  • api/src/main/java/io/minio/Checksum.java
  • api/src/main/java/io/minio/PartReader.java
  • api/src/main/java/io/minio/errors/MinioException.java
  • build.gradle
  • functional/TestMinioClient.java
  • gradle/wrapper/gradle-wrapper.properties
  • gradlew
  • gradlew.bat
  • spotbugs-filter.xml

@balamurugana balamurugana force-pushed the Move-to-JDK-25-for-build-only branch from 9b40df5 to bfc1340 Compare June 20, 2026 02:57

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/gradle.yml:
- Line 33: The actions/setup-java action on line 33 uses the mutable tag `@v5`
which weakens supply-chain integrity. Replace `@v5` with a full immutable commit
SHA (e.g., `@abc1234def5678`...) to pin the action to a specific version and
ensure CI/CD security. You can find the appropriate commit SHA by checking the
GitHub releases page for the actions/setup-java repository.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 31abcdd3-5661-4c8e-b6e4-7066f91dea0d

📥 Commits

Reviewing files that changed from the base of the PR and between 9b40df5 and bfc1340.

⛔ Files ignored due to path filters (1)
  • gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
📒 Files selected for processing (12)
  • .gitattributes
  • .github/workflows/gradle.yml
  • adminapi/src/main/java/io/minio/admin/MinioAdminClient.java
  • api/src/main/java/io/minio/Checksum.java
  • api/src/main/java/io/minio/PartReader.java
  • api/src/main/java/io/minio/errors/MinioException.java
  • build.gradle
  • functional/TestMinioClient.java
  • gradle/wrapper/gradle-wrapper.properties
  • gradlew
  • gradlew.bat
  • spotbugs-filter.xml
✅ Files skipped from review due to trivial changes (6)
  • .gitattributes
  • api/src/main/java/io/minio/Checksum.java
  • adminapi/src/main/java/io/minio/admin/MinioAdminClient.java
  • api/src/main/java/io/minio/errors/MinioException.java
  • functional/TestMinioClient.java
  • api/src/main/java/io/minio/PartReader.java
🚧 Files skipped from review as they are similar to previous changes (5)
  • spotbugs-filter.xml
  • gradle/wrapper/gradle-wrapper.properties
  • gradlew.bat
  • gradlew
  • build.gradle


- name: Setup java 17 for building
- name: Setup java 25 for building
uses: actions/setup-java@v5

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all workflow actions are pinned to SHAs (read-only check)
rg -n --glob ".github/workflows/*.yml" '^\s*uses:\s*[^@]+@[^0-9a-fA-F]'

Repository: minio/minio-java

Length of output: 209


🏁 Script executed:

#!/bin/bash
# First, find workflow files in the repository
find . -type f -name "*.yml" -o -name "*.yaml" | grep -E "\.github/workflows" | head -20

Repository: minio/minio-java

Length of output: 131


🏁 Script executed:

#!/bin/bash
# List contents of .github/workflows directory
if [ -d ".github/workflows" ]; then
  ls -la .github/workflows/
else
  echo "Directory does not exist"
  find . -type d -name "workflows" 2>/dev/null
fi

Repository: minio/minio-java

Length of output: 301


🏁 Script executed:

#!/bin/bash
# If gradle.yml exists, read it to check line 33
if [ -f ".github/workflows/gradle.yml" ]; then
  sed -n '25,40p' .github/workflows/gradle.yml | cat -n
else
  echo "gradle.yml not found at expected path"
fi

Repository: minio/minio-java

Length of output: 747


🌐 Web query:

actions/setup-java v5 commit SHA GitHub Actions pinning best practices 2026

💡 Result:

As of June 2026, pinning GitHub Actions to a full-length commit SHA is considered the industry-standard security best practice [1][2][3]. Use of Commit SHAs Pinning to a full-length 40-character commit SHA provides immutability [1][4][5]. Unlike tags (e.g., v5) or branches (e.g., main), which are mutable and can be moved or force-pushed by an attacker to point to malicious code, a commit SHA points to a specific, unchangeable state of the repository [1][6][7]. Best Practices for 2026 1. Always Use Full SHAs: Pin all third-party actions to their full commit SHA to prevent supply chain attacks [2][3][7]. 2. Maintain Human-Readability: Append the version tag as a comment to the SHA pin for clarity, for example: uses: actions/setup-java@d81c4e45f3ac973cc936d79104023e20054ba578 # v5.0.1 [2][3][7]. 3. Automate Maintenance: Do not manage pins manually. Use tools like Renovate (with the helpers:pinGitHubActionDigests preset) or dependabot to automatically open pull requests when new versions are released, ensuring your dependencies stay current without sacrificing security [2][3][6]. 4. Enforce via Policy: Organizations and repositories can now enable policies to require SHA pinning [1][8]. If enabled, any workflow using a mutable tag or branch will fail [2][5]. It is recommended to enable this enforcement where possible to ensure universal compliance [2][7]. 5. Audit Sub-actions: Be aware that even if you pin a primary action, it may internally reference other unpinned actions [3][7][5]. While full workflow-level dependency locking is a feature on the 2026 security roadmap to address this, users should be cautious and monitor action security [9][3]. Regarding setup-java v5: The latest release as of June 2026 is v5.3.0, released on 2026-06-16 [10]. To pin to a specific version of setup-java, navigate to the action's repository on GitHub, view the tags or commit history to find the 40-character SHA associated with the desired release, and use it in your workflow file [11][12][4]. Top results for reference: [1] GitHub Docs: Secure use of GitHub Actions [2] Lullabot: Always pin GitHub Actions to a commit hash [3] CNCF: Securing CI/CD for an open source project [8] GitHub Blog: GitHub Actions policy supports SHA pinning [7] Opera Omnia: Stop trusting mutable references

Citations:


🏁 Script executed:

#!/bin/bash
# Check if there are other actions in the workflow and their pinning status
cat .github/workflows/gradle.yml | grep -n "uses:" | head -20

Repository: minio/minio-java

Length of output: 175


Pin actions/setup-java to a full commit SHA.

Line 33 uses a mutable tag (@v5), which weakens supply-chain integrity in CI. Pin to an immutable commit digest.

Suggested change
       - name: Setup java 25 for building
-        uses: actions/setup-java@v5
+        uses: actions/setup-java@d81c4e45f3ac973cc936d79104023e20054ba578 # v5.3.0
         with:
           distribution: temurin
           java-version: '25'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: actions/setup-java@v5
- name: Setup java 25 for building
uses: actions/setup-java@d81c4e45f3ac973cc936d79104023e20054ba578 # v5.3.0
with:
distribution: temurin
java-version: '25'
🧰 Tools
🪛 zizmor (1.25.2)

[error] 33-33: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 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/gradle.yml at line 33, The actions/setup-java action on
line 33 uses the mutable tag `@v5` which weakens supply-chain integrity. Replace
`@v5` with a full immutable commit SHA (e.g., `@abc1234def5678`...) to pin the
action to a specific version and ensure CI/CD security. You can find the
appropriate commit SHA by checking the GitHub releases page for the
actions/setup-java repository.

Source: Linters/SAST tools

Signed-off-by: Bala.FA <bala@minio.io>
@balamurugana balamurugana force-pushed the Move-to-JDK-25-for-build-only branch from bfc1340 to ca6b18f Compare June 20, 2026 03:08

@shtripat shtripat left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm

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.

2 participants