This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 406338fe209 HDDS-17891. Let setup-java-with-cache pick up JAVA_VERSION 
(#12127)
406338fe209 is described below

commit 406338fe2091b889b66ba1459fe4fc88a7ec71ea
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Mon Nov 23 17:51:16 2026 +0100

    HDDS-17891. Let setup-java-with-cache pick up JAVA_VERSION (#12127)
---
 .github/actions/setup-java-with-cache/action.yml | 18 ++++++++++++------
 .github/workflows/check.yml                      |  2 ++
 .github/workflows/ci.yml                         | 12 +++++-------
 .github/workflows/intermittent-test-check.yml    |  3 ++-
 .github/workflows/populate-cache.yml             |  3 +--
 .github/workflows/repeat-acceptance.yml          |  9 +++++----
 6 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/.github/actions/setup-java-with-cache/action.yml 
b/.github/actions/setup-java-with-cache/action.yml
index 4598b1c728e..1f1d2939e67 100644
--- a/.github/actions/setup-java-with-cache/action.yml
+++ b/.github/actions/setup-java-with-cache/action.yml
@@ -19,8 +19,8 @@ description: Setup Java and restore Maven cache of Ozone's 
dependencies
 inputs:
   java-version:
     description: >
-      Java version to set up.
-    required: true
+      Java version to set up.  Defaults to $JAVA_VERSION, which is required 
for the cache key.
+    default: ''
 
   only-exact-hit:
     description: >
@@ -47,14 +47,22 @@ outputs:
 runs:
   using: composite
   steps:
-    - name: Setup Java ${{ inputs.java-version }}
+    - name: Verify JAVA_VERSION
+      shell: bash
+      run: |
+        : "${JAVA_VERSION:?Please set JAVA_VERSION}"
+
+    - name: Setup Java ${{ env.java_version }}
       id: setup-java
       uses: actions/setup-java@v6
       with:
         distribution: 'temurin'
-        java-version: ${{ inputs.java-version }}
+        java-version: ${{ env.java_version }}
         show-download-progress: true
+      env:
+        java_version: ${{ inputs.java-version || env.JAVA_VERSION }}
 
+    # Cache key always uses JAVA_VERSION, because only one cache is built in 
populate-cache
     - name: Calculate cache key
       id: cache-key
       shell: bash
@@ -65,8 +73,6 @@ runs:
             '.mvn/wrapper/maven-wrapper.properties',
             'dev-support/ci/populate-cache.sh'
         ) }}-$JAVA_VERSION" >> "$GITHUB_OUTPUT"
-      env:
-        JAVA_VERSION: ${{ inputs.java-version }}
 
     - name: Remove any leftover Maven repo
       id: cleanup
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 6f3b0cf2b21..f0ebc6b26fc 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -136,6 +136,8 @@ on:
 
 env:
   HADOOP_IMAGE: ghcr.io/apache/hadoop
+  # JAVA_VERSION, MAVEN_ARGS and MAVEN_OPTS are duplicated in several 
workflows, please keep in sync
+  JAVA_VERSION: 25 # JDK version used by CI build and tests; should match the 
JDK version in apache/ozone-runner image
   MAVEN_ARGS: --batch-mode --settings ${{ github.workspace 
}}/dev-support/ci/maven-settings.xml -Ddevelocity.user.config=${{ 
github.workspace }}/.mvn/develocity-asf.xml
   MAVEN_OPTS: -Daether.connector.http.connectionMaxTtl=25 
-Daether.connector.http.retryHandler.count=5 
-Daether.connector.http.retryHandler.intervalMax=30000
   MVNW_VERBOSE: true
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 304718b9097..94ab5b58d20 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,10 +38,10 @@ on:
         required: false
 
 env:
-  # BUILD_ARGS and TEST_JAVA_VERSION are duplicated in populate-cache.yml, 
please keep in sync
+  # BUILD_ARGS is duplicated in populate-cache.yml, please keep in sync
   BUILD_ARGS: "-Pdist -Psrc -Dmaven.javadoc.skip=true -Drocks_tools_native"
-  TEST_JAVA_VERSION: 25 # JDK version used by CI build and tests; should match 
the JDK version in apache/ozone-runner image
-  # MAVEN_ARGS and MAVEN_OPTS are duplicated in several workflows, please keep 
in sync
+  # JAVA_VERSION, MAVEN_ARGS and MAVEN_OPTS are duplicated in several 
workflows, please keep in sync
+  JAVA_VERSION: 25 # JDK version used by CI build and tests; should match the 
JDK version in apache/ozone-runner image
   MAVEN_ARGS: --batch-mode --settings ${{ github.workspace 
}}/dev-support/ci/maven-settings.xml -Ddevelocity.user.config=${{ 
github.workspace }}/.mvn/develocity-asf.xml
   MAVEN_OPTS: -Daether.connector.http.connectionMaxTtl=25 
-Daether.connector.http.retryHandler.count=5 
-Daether.connector.http.retryHandler.intervalMax=30000
   MVNW_VERBOSE: true
@@ -71,7 +71,7 @@ jobs:
       test-classes: ${{ steps.selective-checks.outputs.test-classes }}
       # `env` context cannot be used when calling reusable workflow, so we 
need to convert these to `outputs`
       build-args: ${{ env.BUILD_ARGS }}
-      java-version: ${{ env.TEST_JAVA_VERSION }}
+      java-version: ${{ env.JAVA_VERSION }}
       with-coverage: ${{ env.OZONE_WITH_COVERAGE }}
     steps:
       - name: "Checkout ${{ github.ref }} / ${{ github.sha }} (${{ 
github.event_name }})"
@@ -499,10 +499,8 @@ jobs:
         run: |
           mkdir -p hadoop-ozone/dist/target
           tar xzvf target/artifacts/ozone-bin/ozone*.tar.gz -C 
hadoop-ozone/dist/target
-      - name: Setup java ${{ env.TEST_JAVA_VERSION }}
+      - name: Setup Java
         uses: $/.github/actions/setup-java-with-cache
-        with:
-          java-version: ${{ env.TEST_JAVA_VERSION }}
       - name: Calculate combined coverage
         run: ./hadoop-ozone/dev-support/checks/coverage.sh
       - name: Upload coverage to Sonar
diff --git a/.github/workflows/intermittent-test-check.yml 
b/.github/workflows/intermittent-test-check.yml
index 4172da2517f..971d8fd857f 100644
--- a/.github/workflows/intermittent-test-check.yml
+++ b/.github/workflows/intermittent-test-check.yml
@@ -57,6 +57,8 @@ on:
         default: '25'
         required: true
 env:
+  # JAVA_VERSION, MAVEN_ARGS and MAVEN_OPTS are duplicated in several 
workflows, please keep in sync
+  JAVA_VERSION: 25
   MAVEN_ARGS: --batch-mode --settings ${{ github.workspace 
}}/dev-support/ci/maven-settings.xml -Ddevelocity.user.config=${{ 
github.workspace }}/.mvn/develocity-asf.xml
   MAVEN_OPTS: -Daether.connector.http.connectionMaxTtl=25 
-Daether.connector.http.retryHandler.count=5 
-Daether.connector.http.retryHandler.intervalMax=30000
   TEST_CLASS: ${{ github.event.inputs.test-class}}
@@ -65,7 +67,6 @@ env:
   FAIL_FAST: ${{ github.event.inputs.fail-fast }}
   RATIS_REPO: ${{ github.event.inputs.ratis-repo }}
   RATIS_VERSION: ${{ github.event.inputs.ratis-ref }}
-  JAVA_VERSION: ${{ github.event.inputs.java-version }}
   SPLITS: ${{ github.event.inputs.splits }}
   SUBMODULE: ${{ github.event.inputs.submodule }}
   # Surefire 3.0.0-M4 is used because newer versions do not reliably kill the 
fork on timeout
diff --git a/.github/workflows/populate-cache.yml 
b/.github/workflows/populate-cache.yml
index 46103836ab8..be038ee1028 100644
--- a/.github/workflows/populate-cache.yml
+++ b/.github/workflows/populate-cache.yml
@@ -41,7 +41,7 @@ concurrency:
 env:
   # variables are duplicated from ci.yml, please keep in sync
   BUILD_ARGS: "-Pdist -Psrc -Dmaven.javadoc.skip=true -Drocks_tools_native"
-  TEST_JAVA_VERSION: 25 # JDK version used by CI build and tests; should match 
the JDK version in apache/ozone-runner image
+  JAVA_VERSION: 25 # JDK version used by CI build and tests; should match the 
JDK version in apache/ozone-runner image
   MAVEN_ARGS: --batch-mode --settings ${{ github.workspace 
}}/dev-support/ci/maven-settings.xml -Ddevelocity.user.config=${{ 
github.workspace }}/.mvn/develocity-asf.xml
   MAVEN_OPTS: -Daether.connector.http.connectionMaxTtl=25 
-Daether.connector.http.retryHandler.count=5 
-Daether.connector.http.retryHandler.intervalMax=30000
   MVNW_VERBOSE: true
@@ -60,7 +60,6 @@ jobs:
         id: restore-cache
         uses: $/.github/actions/setup-java-with-cache
         with:
-          java-version: ${{ env.TEST_JAVA_VERSION }}
           only-exact-hit: true
 
       - name: Fetch dependencies
diff --git a/.github/workflows/repeat-acceptance.yml 
b/.github/workflows/repeat-acceptance.yml
index 680336adffd..23454a084f4 100644
--- a/.github/workflows/repeat-acceptance.yml
+++ b/.github/workflows/repeat-acceptance.yml
@@ -43,12 +43,13 @@ on:
         default: false
         required: true
 env:
+  # JAVA_VERSION, MAVEN_ARGS and MAVEN_OPTS are duplicated in several 
workflows, please keep in sync
+  JAVA_VERSION: 25
   MAVEN_ARGS: --batch-mode --settings ${{ github.workspace 
}}/dev-support/ci/maven-settings.xml -Ddevelocity.user.config=${{ 
github.workspace }}/.mvn/develocity-asf.xml
   MAVEN_OPTS: -Daether.connector.http.connectionMaxTtl=25 
-Daether.connector.http.retryHandler.count=5 
-Daether.connector.http.retryHandler.intervalMax=30000
   OZONE_ACCEPTANCE_SUITE: ${{ github.event.inputs.test-suite}}
   OZONE_TEST_SELECTOR: ${{ github.event.inputs.test-filter }}
   FAIL_FAST: ${{ github.event.inputs.fail-fast }}
-  JAVA_VERSION: 25
   SPLITS: ${{ github.event.inputs.splits }}
 run-name: ${{ github.event_name == 'workflow_dispatch' && 
format('{0}[{1}]-{2}', inputs.test-suite || inputs.test-filter, inputs.ref, 
inputs.splits) || '' }}
 permissions: { }
@@ -99,10 +100,8 @@ jobs:
             ${{ runner.os }}-pnpm-
       - name: Setup java
         uses: $/.github/actions/setup-java-with-cache
-        with:
-          java-version: ${{ env.JAVA_VERSION }}
       - name: Run a full build
-        run: hadoop-ozone/dev-support/checks/build.sh -Pdist -Psrc 
-Dmaven.javadoc.skip=true
+        run: hadoop-ozone/dev-support/checks/build.sh -Pdist 
-Dmaven.javadoc.skip=true
         env:
           DEVELOCITY_ACCESS_KEY: ${{ secrets.OZONE_DEVELOCITY_ACCESS_KEY }}
       - name: Store binaries for tests
@@ -138,6 +137,8 @@ jobs:
           tar xzvf ozone*.tar.gz -C hadoop-ozone/dist/target
           rm ozone*.tar.gz
           sudo chmod -R a+rwX hadoop-ozone/dist/target
+      - name: Setup java
+        uses: $/.github/actions/setup-java-with-cache
       - name: Execute tests
         run: |
           ./hadoop-ozone/dev-support/checks/acceptance.sh


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to