From 16f3000725ffd445734c33d71c7088346f51dfb8 Mon Sep 17 00:00:00 2001 From: dhruv9b <9bdhruv@gmail.com> Date: Mon, 31 Aug 2026 23:59:27 +0530 Subject: [PATCH 1/5] Upgrade Spotless to fix npm compatibility --- build.gradle | 2 +- examples/build.gradle | 2 +- smoke-test/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index f405ea2b92c..0c28ad10543 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ plugins { id 'io.franzbecker.gradle-lombok' version '5.0.0' id 'com.gradleup.shadow' version '8.3.9' id 'me.champeau.gradle.japicmp' version '0.4.3' apply false - id 'com.diffplug.spotless' version '6.22.0' apply false + id 'com.diffplug.spotless' version '8.10.1' apply false id 'org.jreleaser' version '1.20.0' apply false } diff --git a/examples/build.gradle b/examples/build.gradle index e80815cdae6..69684942d54 100644 --- a/examples/build.gradle +++ b/examples/build.gradle @@ -1,6 +1,6 @@ // empty build.gradle for dependabot plugins { - id 'com.diffplug.spotless' version '6.22.0' apply false + id 'com.diffplug.spotless' version '8.10.1' apply false } apply from: "$rootDir/../gradle/ci-support.gradle" diff --git a/smoke-test/build.gradle b/smoke-test/build.gradle index 781d6e87792..ed1e73ecfb8 100644 --- a/smoke-test/build.gradle +++ b/smoke-test/build.gradle @@ -1,6 +1,6 @@ // empty build.gradle for dependabot plugins { - id 'com.diffplug.spotless' version '6.22.0' apply false + id 'com.diffplug.spotless' version '8.10.1' apply false } apply from: "$rootDir/../gradle/ci-support.gradle" From fba66a2e222cf0d904c63aa8384e7a7ced0faaf0 Mon Sep 17 00:00:00 2001 From: Dhruv_G_123 <9bdhruv@gmail.com> Date: Sat, 5 Sep 2026 22:44:36 +0530 Subject: [PATCH 2/5] Add spotless dependency to Dependabot configuration Explicitly allow com.diffplug.spotless in the root Gradle Dependabot configuration so Dependabot can create Spotless update PRs. --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5f27666e33a..404d952822e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -19,6 +19,7 @@ updates: directory: "/" allow: - dependency-name: "com.gradle*" + - dependency-name: "com.diffplug.spotless" registries: - gradle-plugin-portal patterns: From 4f1eef56c0c12b1d03fa498754d0644c49c5cec1 Mon Sep 17 00:00:00 2001 From: Kevin Wittek Date: Fri, 18 Sep 2026 12:26:18 +0200 Subject: [PATCH 3/5] fix(ci): isolate Gradle matrix generation Enumerate check tasks without executing their dependencies, avoiding Greclipse initialization during matrix discovery. Write matrix JSON to a dedicated file and validate it before publishing workflow outputs. --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++---------- gradle/ci-support.gradle | 24 +++++++-------------- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0ced008ba4..ea1cffa2fb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,10 +96,18 @@ jobs: # we should not push empty results to the cache READ_ONLY_REMOTE_GRADLE_CACHE: true run: | - set -o pipefail - TASKS=$(./gradlew --no-daemon --parallel -q testMatrix | jq 'del(.[] | select(. == ":testcontainers:check" or startswith(":docs:")))' --compact-output) - echo $TASKS - echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT + set -euo pipefail + MATRIX_FILE="$RUNNER_TEMP/test-matrix.json" + ./gradlew --no-daemon --parallel -q testMatrix -PtestMatrixOutput="$MATRIX_FILE" + TASKS=$(jq --compact-output --exit-status ' + if type == "array" and length > 0 and all(.[]; type == "string" and startswith(":")) + then map(select(. != ":testcontainers:check" and (startswith(":docs:") | not))) + else error("testMatrix output must be a non-empty array of Gradle task paths") + end + | if length > 0 then . else error("testMatrix produced no core Gradle tasks") end + ' "$MATRIX_FILE") + echo "$TASKS" + printf 'matrix={"gradle_args":%s}\n' "$TASKS" >> "$GITHUB_OUTPUT" check: needs: [find_gradle_jobs] strategy: @@ -131,9 +139,17 @@ jobs: # we should not push empty results to the cache READ_ONLY_REMOTE_GRADLE_CACHE: true run: | - TASKS=$(./gradlew --no-daemon --parallel -q testMatrix) - echo $TASKS - echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT + set -euo pipefail + MATRIX_FILE="$RUNNER_TEMP/examples-test-matrix.json" + ./gradlew --no-daemon --parallel -q testMatrix -PtestMatrixOutput="$MATRIX_FILE" + TASKS=$(jq --compact-output --exit-status ' + if type == "array" and length > 0 and all(.[]; type == "string" and startswith(":")) + then . + else error("testMatrix output must be a non-empty array of Gradle task paths") + end + ' "$MATRIX_FILE") + echo "$TASKS" + printf 'matrix={"gradle_args":%s}\n' "$TASKS" >> "$GITHUB_OUTPUT" check_examples: needs: [find_examples_jobs] strategy: @@ -165,10 +181,18 @@ jobs: # we should not push empty results to the cache READ_ONLY_REMOTE_GRADLE_CACHE: true run: | - set -o pipefail - TASKS=$(./gradlew --no-daemon --parallel -q testMatrix | jq 'map(select(startswith(":docs:")))' --compact-output) - echo $TASKS - echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT + set -euo pipefail + MATRIX_FILE="$RUNNER_TEMP/docs-test-matrix.json" + ./gradlew --no-daemon --parallel -q testMatrix -PtestMatrixOutput="$MATRIX_FILE" + TASKS=$(jq --compact-output --exit-status ' + if type == "array" and length > 0 and all(.[]; type == "string" and startswith(":")) + then map(select(startswith(":docs:"))) + else error("testMatrix output must be a non-empty array of Gradle task paths") + end + | if length > 0 then . else error("testMatrix produced no docs Gradle tasks") end + ' "$MATRIX_FILE") + echo "$TASKS" + printf 'matrix={"gradle_args":%s}\n' "$TASKS" >> "$GITHUB_OUTPUT" check_docs_examples: needs: [find_docs_examples_jobs] strategy: diff --git a/gradle/ci-support.gradle b/gradle/ci-support.gradle index 5b85837361e..f4490f243dc 100644 --- a/gradle/ci-support.gradle +++ b/gradle/ci-support.gradle @@ -7,28 +7,20 @@ task testMatrix { it.tasks.findByName("check") }.findAll { it != null } - dependsOn(checkTasks) doLast { def checkTaskPaths = checkTasks .collect { it.path } - println(JsonOutput.toJson(checkTaskPaths)) - } - } -} + def json = JsonOutput.toJson(checkTaskPaths) + def outputPath = providers.gradleProperty("testMatrixOutput").getOrNull() -// If we're executing the `testMatrix` task, disable tests and other slow tasks -// so that we can get a result quickly. -gradle.taskGraph.whenReady { - if (it.hasTask(tasks.testMatrix)) { - for (subproject in subprojects) { - subproject.tasks.withType(Test).all { - testExecuter([execute: { spec, processor -> }, stopNow:{}] as org.gradle.api.internal.tasks.testing.TestExecuter) + if (outputPath != null) { + def outputFile = file(outputPath) + outputFile.parentFile.mkdirs() + outputFile.text = json + System.lineSeparator() + } else { + println(json) } - subproject.tasks.findByName("shadowJar")?.enabled = false - subproject.tasks.findByName("javadoc")?.enabled = false - subproject.tasks.findByName("delombok")?.enabled = false - subproject.tasks.findByName("japicmp")?.enabled = false } } } From 874eb027afc423cf89e64e2c000463d8f7d3059a Mon Sep 17 00:00:00 2001 From: Kevin Wittek Date: Sun, 18 Oct 2026 08:42:50 +0200 Subject: [PATCH 4/5] Group Spotless updates with the other root Gradle plugins Adding Spotless to the allow list alone leaves it outside the multi-ecosystem group's patterns, so it would get separate PRs. Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 404d952822e..c50a6ac24ca 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -24,6 +24,7 @@ updates: - gradle-plugin-portal patterns: - "com.gradle*" + - "com.diffplug.spotless" multi-ecosystem-group: dependencies cooldown: default-days: 7 From 500ef4f9a5e3401de4dbff3ba9b52b980402d1d6 Mon Sep 17 00:00:00 2001 From: Kevin Wittek Date: Sun, 18 Oct 2026 21:53:55 +0200 Subject: [PATCH 5/5] Only configure greclipse in projects with Groovy sources Spotless provisions greclipse's Eclipse P2 dependencies in every project, even when its target matches no files. Only the spock module and its docs example contain Groovy, so every other CI job downloaded them from Eclipse's servers for nothing, which made the check flaky. Co-Authored-By: Claude Opus 5.5 --- gradle/spotless.gradle | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gradle/spotless.gradle b/gradle/spotless.gradle index 59b834dbad7..883298c4519 100644 --- a/gradle/spotless.gradle +++ b/gradle/spotless.gradle @@ -16,8 +16,12 @@ spotless { importOrder('', 'java', 'javax', '\\#') } - groovyGradle { - target '**/*.groovy' - greclipse('4.19') + // greclipse downloads its Eclipse dependencies even when nothing matches the target, + // so only configure it in projects that actually contain Groovy sources. + if (!fileTree('src') { include '**/*.groovy' }.isEmpty()) { + groovyGradle { + target '**/*.groovy' + greclipse('4.19') + } } }