det101 commented on code in PR #18657:
URL: 
https://github.com/apache/dolphinscheduler/pull/18657#discussion_r4068278945


##########
.github/actions/sanity-check/action.yml:
##########
@@ -34,5 +34,18 @@ runs:
     - name: Check License Header
       uses: apache/skywalking-eyes/header@main
 
-    - shell: bash
-      run: ./mvnw spotless:check
+    # Retry Wrapper download on Maven Central HTTP 429. `if cmd` is used so
+    # `set -e` does not abort the loop on a failed attempt.
+    - name: Spotless Check
+      shell: bash
+      run: |
+        for i in 1 2 3 4 5; do
+          if ./mvnw spotless:check; then
+            break
+          fi
+          if [ "$i" -eq 5 ]; then
+            echo "::error::mvnw spotless:check failed after ${i} attempts"
+            exit 1
+          fi
+          sleep $(( i * 15 + RANDOM % 20 ))
+        done

Review Comment:
   Dropped the retry. Wrapper cache is enough here.



##########
.github/workflows/unit-test.yml:
##########
@@ -51,6 +51,15 @@ jobs:
       - uses: actions/checkout@v6
         with:
           submodules: true
+      # Cache the Maven Wrapper distribution (~/.m2/wrapper) so the unit-test
+      # matrix can restore it instead of downloading apache-maven-*-bin.zip
+      # from Maven Central in parallel (HTTP 429). Key is independent of
+      # pom.xml so dependency changes do not invalidate the dist cache.

Review Comment:
   Removed the comments.



##########
.github/workflows/unit-test.yml:
##########
@@ -115,6 +124,11 @@ jobs:
           java-version: ${{ matrix.java }}
           distribution: 'adopt'
 
+      - name: Cache Maven Wrapper
+        uses: actions/cache@v5
+        with:
+          path: ~/.m2/wrapper
+          key: ${{ runner.os }}-mvnw-${{ 
hashFiles('.mvn/wrapper/maven-wrapper.properties') }}

Review Comment:
   Added the same `~/.m2/wrapper` cache (same key) to every PR workflow that 
actually runs `./mvnw`: backend, e2e (build + matrix), api-test (build + 
matrix), frontend (ubuntu sanity-check only), docs (style + helm-doc), e2e-k8s, 
and codeql. Left out owasp / publish-docker since they are not on the regular 
PR path.



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