Copilot commented on code in PR #3812:
URL: https://github.com/apache/celeborn/pull/3812#discussion_r3819431696


##########
.github/workflows/sbt.yml:
##########
@@ -53,6 +53,16 @@ jobs:
         distribution: zulu
         java-version: ${{ matrix.java }}
         check-latest: false
+    - name: Cache SBT launcher and dependencies
+      uses: actions/cache@v4
+      with:
+        path: |
+          build/*.jar
+          ~/.sbt
+          ~/.cache/coursier
+        key: sbt-${{ hashFiles('**/pom.xml', 'project/build.properties', 
'build/sbt', 'build/sbt-launch-lib.bash') }}
+        restore-keys: |
+          sbt-

Review Comment:
   The cache key is currently shared across different JDK / Scala / Spark/Flink 
matrix variants and only hashes a subset of the SBT build definition. Because 
GitHub Actions caches are immutable once saved, the first job that saves this 
key can “freeze” an incomplete cache, and later variants will keep 
re-downloading missing artifacts without ever being able to save them. Consider 
(1) including the SBT build definition files (project/**/*.scala, 
project/**/*.sbt, version.sbt, plugins.sbt) in hashFiles and (2) scoping the 
key by the relevant matrix dimensions (java/scala/spark/flink) while keeping 
restore-keys broad for reuse.
   
   This issue also appears in the following locations of the same file:
   - line 177
   - line 229
   - line 271
   - line 314
   - line 352
   - ...and 1 more



-- 
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]

Reply via email to