From 341df2a6ca1807852e7a93f21a55171fd6847960 Mon Sep 17 00:00:00 2001 From: caalador Date: Tue, 1 Dec 2026 15:04:45 +0000 Subject: [PATCH] ci: route unit-test Gradle build through Central mirror (#27576) (CP: 24.9) The unit-tests matrix job builds flow-gradle-plugin through exec-maven-plugin, which runs Gradle with an empty Gradle home and without the mirror init script. Plugin resolution then goes through the Plugin Portal, gets redirected to repo.maven.apache.org and fails with 429. Copy the init script to ~/.gradle/init.d so that build uses the mirror too. --- .github/gradle/central-mirror.init.gradle | 4 +++- .github/workflows/validation.yml | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/gradle/central-mirror.init.gradle b/.github/gradle/central-mirror.init.gradle index ae31aebc6fe..ae4d2fd1be7 100644 --- a/.github/gradle/central-mirror.init.gradle +++ b/.github/gradle/central-mirror.init.gradle @@ -18,7 +18,9 @@ // a 404, so plugins that only the portal hosts still resolve. // // The Gradle steps in validation.yml and warm-caches.yml pass it with -// --init-script. The functionalTest task in flow-gradle-plugin/build.gradle +// --init-script. The unit-tests job in validation.yml copies it to +// ~/.gradle/init.d instead, as there exec-maven-plugin starts the +// flow-gradle-plugin build and cannot pass it. The functionalTest task in flow-gradle-plugin/build.gradle // hands this script on to the nested TestKit builds, which run under a Gradle // user home of their own and so would not see a script in ~/.gradle/init.d. // It finds the script among the outer build's init scripts by its file name, diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 785a68e73b8..bcd4ac65330 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -202,6 +202,15 @@ jobs: ./scripts/computeMatrix.js set-version --version=999.99-SNAPSHOT cmd="mvn install -B -ntp -DskipTests -pl \!flow-plugins/flow-gradle-plugin" eval $cmd -T 2C -q || eval $cmd + - name: Route Gradle through the Central mirror + # The matrix job that includes flow-gradle-plugin builds it through + # exec-maven-plugin, which runs Gradle without --init-script and with + # an empty Gradle home, so the plugin resolution goes to Central via + # the Plugin Portal and fails with 429. A script in ~/.gradle/init.d + # reaches that Gradle run as well. + run: | + mkdir -p ~/.gradle/init.d + cp .github/gradle/central-mirror.init.gradle ~/.gradle/init.d/ - name: Unit Test # A full run's expected length, generously above the longest seen, for # runMavenWithRetry.sh to size a retry by: a transfer error usually