From 2089abecf3585bffacd04d726c450c15f09b9ed0 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 19 Nov 2026 00:00:41 -0800 Subject: [PATCH] ci: cache Snowflake suite Maven deps and fall back to a Central mirror (#12763) * ci: cache the Snowflake suite's Maven dependencies under their own key setup-java's maven cache key hashes the repository pom.xml files, which other Java workflows share. The Snowflake job restored that cache, which lacks the suite's plugins and dependencies, and never saved its own because the key already existed. Every run downloaded the whole suite dependency tree from Maven Central and failed when Central answered 429. Key the cache on run.sh, which pins the suite revision. Co-Authored-By: Claude Opus 5.5 * ci: fall back to Google's Maven Central mirror in the Snowflake job A cold cache still resolves about 36 MB of plugins and dependencies, and Maven gives up after three 429 retries within 30 s. Add the mirror as a settings-profile repository; Maven tries it first and moves on to Central for any artifact the mirror fails to serve. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .github/workflows/s3-snowflake-tests.yml | 12 +++++++++- test/s3/snowflake/README.md | 4 ++++ test/s3/snowflake/maven-settings.xml | 28 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 test/s3/snowflake/maven-settings.xml diff --git a/.github/workflows/s3-snowflake-tests.yml b/.github/workflows/s3-snowflake-tests.yml index cdf006419e..3e89fcc4e2 100644 --- a/.github/workflows/s3-snowflake-tests.yml +++ b/.github/workflows/s3-snowflake-tests.yml @@ -68,7 +68,15 @@ jobs: with: java-version: '17' distribution: 'temurin' - cache: ${{ runner.environment == 'github-hosted' && 'maven' || '' }} + + - name: Cache suite Maven dependencies + if: runner.environment == 'github-hosted' + uses: actions/cache@v6 + with: + path: ~/.m2/repository + key: snowflake-s3compat-m2-${{ hashFiles('test/s3/snowflake/run.sh') }} + restore-keys: | + snowflake-s3compat-m2- - name: Install SeaweedFS run: | @@ -78,6 +86,8 @@ jobs: - name: Run Snowflake S3Compat API tests timeout-minutes: 20 + env: + MAVEN_ARGS: -ntp -s ${{ github.workspace }}/test/s3/snowflake/maven-settings.xml run: | # Starts weed server, creates the buckets/objects the suite needs, # clones the upstream suite, and runs mvn -Dtest=S3CompatApiTest. diff --git a/test/s3/snowflake/README.md b/test/s3/snowflake/README.md index eeda9acc5a..e32a0d2cf2 100644 --- a/test/s3/snowflake/README.md +++ b/test/s3/snowflake/README.md @@ -31,3 +31,7 @@ already-running server, and see the top of `run.sh` for the other overrides. to path-style access with a `sed` patch. - `NOT_ACCESSIBLE_BUCKET` is a real bucket carrying a deny-all bucket policy, which is how the suite's `AccessDenied` negative tests are satisfied. +- CI runs Maven with `maven-settings.xml`, which adds Google's Maven Central + mirror in front of Central, so a 429 from one falls through to the other. + Locally, pass it with + `MAVEN_ARGS="-s $PWD/test/s3/snowflake/maven-settings.xml"`. diff --git a/test/s3/snowflake/maven-settings.xml b/test/s3/snowflake/maven-settings.xml new file mode 100644 index 0000000000..5e9553d413 --- /dev/null +++ b/test/s3/snowflake/maven-settings.xml @@ -0,0 +1,28 @@ + + + + central-fallback + + + google-maven-central + https://maven-central.storage-download.googleapis.com/maven2/ + + false + + + + + + google-maven-central + https://maven-central.storage-download.googleapis.com/maven2/ + + false + + + + + + + central-fallback + +