FrankChen021 commented on code in PR #20297:
URL: https://github.com/apache/druid/pull/20297#discussion_r3959710309


##########
.github/scripts/run_docker-tests:
##########
@@ -35,4 +35,5 @@ fi
 
 # No snapshot updates
 OPTS+=" -nsu"
-mvn -B -pl embedded-tests -am $OPTS verify -Pdocker-tests,skip-static-checks 
-DskipUTs -D$DRUID_IMAGE_SYS_PROPERTY=$DRUID_IMAGE_NAME 
"-DjfrProfilerArgLine=$JFR_PROFILER_ARG_LINE" "$@"
+# build-dist has already installed the reactor artifacts in the local 
repository.
+mvn -B -pl embedded-tests $OPTS verify -Pdocker-tests,skip-static-checks 
-DskipUTs -D$DRUID_IMAGE_SYS_PROPERTY=$DRUID_IMAGE_NAME 
"-DjfrProfilerArgLine=$JFR_PROFILER_ARG_LINE" "$@"

Review Comment:
   Addressed in commit `fe755f6e99` by restoring `-am` in `run_docker-tests`. 
This keeps upstream reactor artifacts available for every caller, including 
when the Maven build cache restores outputs without running install. The 
`embedded-tests` test-scoped `web-console` dependency is therefore resolved on 
fresh or invalidated-cache runners.



##########
.github/workflows/docker-tests.yml:
##########
@@ -31,8 +31,24 @@ jobs:
           distribution: 'zulu'
           java-version: 25
           cache: 'maven'
+      # setup-java caches Maven dependencies in ~/.m2/repository. This separate
+      # cache stores build outputs produced by the Maven build-cache extension.
+      - name: Restore Maven build cache
+        id: maven-build-cache
+        uses: actions/cache/restore@v4
+        with:
+          path: ~/.m2/build-cache
+          key: maven-build-cache-v1-${{ runner.os }}-java25-${{ github.sha }}
+          restore-keys: |
+            maven-build-cache-v1-${{ runner.os }}-java25-
       - name: Build the Druid distribution
         run: .github/scripts/build-dist
+      - name: Save Maven build cache
+        if: ${{ github.event_name == 'push' && github.ref == 
'refs/heads/master' && steps.maven-build-cache.outputs.cache-hit != 'true' }}
+        uses: actions/cache/save@v4
+        with:
+          path: ~/.m2/build-cache
+          key: maven-build-cache-v1-${{ runner.os }}-java25-${{ github.sha }}

Review Comment:
   Addressed in commit `fe755f6e99`. The cache key is now based on the 
runner/JDK and the root POM plus `web-console/**` inputs, rather than the 
commit SHA. The save remains master-only and skips exact hits; a prefix restore 
can save one new exact key when the inputs change, while repeated exact hits do 
not create additional archives.



##########
.github/scripts/run_docker-tests:
##########
@@ -35,4 +35,5 @@ fi
 
 # No snapshot updates
 OPTS+=" -nsu"
-mvn -B -pl embedded-tests -am $OPTS verify -Pdocker-tests,skip-static-checks 
-DskipUTs -D$DRUID_IMAGE_SYS_PROPERTY=$DRUID_IMAGE_NAME 
"-DjfrProfilerArgLine=$JFR_PROFILER_ARG_LINE" "$@"
+# build-dist has already installed the reactor artifacts in the local 
repository.
+mvn -B -pl embedded-tests $OPTS verify -Pdocker-tests,skip-static-checks 
-DskipUTs -D$DRUID_IMAGE_SYS_PROPERTY=$DRUID_IMAGE_NAME 
"-DjfrProfilerArgLine=$JFR_PROFILER_ARG_LINE" "$@"

Review Comment:
   Addressed in commit `fe755f6e99` by restoring `-am`. 
`embedded-tests/pom.xml` has an unconditional test-scoped 
`org.apache.druid:web-console` dependency, so the reactor remains available 
when a cache hit skips the install phase or when the local Maven repository is 
fresh. A valid Maven build-cache checksum hit can still reuse the web-console 
outputs.



##########
.github/workflows/docker-tests.yml:
##########
@@ -31,8 +31,24 @@ jobs:
           distribution: 'zulu'
           java-version: 25
           cache: 'maven'
+      # setup-java caches Maven dependencies in ~/.m2/repository. This separate
+      # cache stores build outputs produced by the Maven build-cache extension.
+      - name: Restore Maven build cache
+        id: maven-build-cache
+        uses: actions/cache/restore@v4
+        with:
+          path: ~/.m2/build-cache
+          key: maven-build-cache-v1-${{ runner.os }}-java25-${{ github.sha }}
+          restore-keys: |
+            maven-build-cache-v1-${{ runner.os }}-java25-

Review Comment:
   Addressed in commit `fe755f6e99`. The cache key now uses 
`hashFiles('pom.xml', 'web-console/**')` together with the runner/JDK and a 
cache version, so unrelated commits reuse the same entry and relevant input 
changes get a new exact key. The old per-commit key scheme is invalidated by 
the `v2` prefix.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to