fix(ci): exclude Grails-Micronaut island from Groovy joint validation build#15615
fix(ci): exclude Grails-Micronaut island from Groovy joint validation build#15615jamesfredley wants to merge 3 commits into8.0.xfrom
Conversation
… build The Joint Validation Build's "Swap Groovy Version" step rewrites every 'groovy.version' line in dependencies.gradle to point at the locally built apache/groovy 4.x snapshot - including the override inside the grails-micronaut-bom block. That BOM still pins Spock to 2.4-groovy-5.0 (intentionally, to match the Micronaut platform's Groovy 5 baseline), which fails Spock's compile-time Groovy major-version check and breaks every Spock spec in the test-examples that consume :grails-micronaut-bom. Rather than spread Spock's iKnowWhatImDoing.disableGroovyVersionCheck escape hatch across the framework build, keep Micronaut on its own dependency island: gate :grails-micronaut, :grails-micronaut-bom, and the five Micronaut-tied test-examples in settings.gradle behind a new -PskipMicronautTests project property, and pass that property in groovy-joint-workflow.yml so the Groovy 4 snapshot matrix never tries to evaluate the Groovy-5-pinned subgraph. The flag is a no-op locally and in the regular gradle.yml CI run; only the joint validation build opts in. Fixes #15613 Assisted-by: claude-code:claude-opus-4-7
There was a problem hiding this comment.
Pull request overview
Adds an opt-in Gradle property to remove the Grails-Micronaut “island” projects from the multi-project build graph, and uses it in the Groovy joint CI workflow to avoid Groovy 4 snapshot builds evaluating Groovy-5/Spock-2.4-groovy-5.0 modules.
Changes:
- Introduces
-PskipMicronautTestsgating insettings.gradleto conditionally include/exclude Micronaut-related projects. - Updates
groovy-joint-workflow.ymlto pass-PskipMicronautTestsduring the joint Groovy snapshot build. - Documents the new property in
gradle.propertiesfor discoverability.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| settings.gradle | Adds conditional include(...) + projectDir wiring for Micronaut subgraph behind -PskipMicronautTests. |
| gradle.properties | Documents the skipMicronautTests property (commented-out example). |
| .github/workflows/groovy-joint-workflow.yml | Passes -PskipMicronautTests to prevent the joint Groovy build from evaluating Micronaut projects. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…and is skipped
The previous commit excluded :grails-micronaut-bom from the build graph when
-PskipMicronautTests is set, but grails-doc/build.gradle still referenced
project(':grails-micronaut-bom') directly inside the generateBomDocumentation
configure block. The joint validation build's `./gradlew build` realises
:grails-doc:publishGuide -> :grails-doc:generateBomDocumentation during task
graph computation, which then failed with:
Project with path ':grails-micronaut-bom' could not be found in project ':grails-doc'.
Resolve the Micronaut BOM via findProject() (matches the null-tolerant lookup
pattern in GrailsDependencyValidatorPlugin.detectBomPath/collectBomVersions)
and gate every Micronaut-specific dependency, input, output, and doLast block
on a non-null result. When the island is in the graph the task behaves
identically to before; when it is skipped, generateBomDocumentation produces
only the default and Hibernate 5 BOM pages.
Also clarify the documentation around the toggle:
* settings.gradle - call out that the property is presence-based (matches
skipFunctionalTests / skipCodeStyle / skipDependencyValidation) and remind
consumers that any project(':grails-micronaut-bom') reference must be
findProject-guarded.
* gradle.properties - drop the misleading `#skipMicronautTests=true` example
(presence is what matters; the value is irrelevant) and note the kinship
with the existing skip* flags.
Verified locally:
./gradlew :grails-doc:build -PskipMicronautTests --dry-run -> BUILD SUCCESSFUL
./gradlew :grails-doc:generateBomDocumentation --dry-run -> SKIPPED (depends on :grails-micronaut-bom:extractConstraints)
./gradlew codeStyle -> BUILD SUCCESSFUL
Addresses Copilot review comments on grails-core#15615.
Assisted-by: claude-code:claude-opus-4-7
| // Consumers that reference :grails-micronaut-bom (e.g. grails-doc:generateBomDocumentation) | ||
| // must guard those references with findProject(':grails-micronaut-bom') != null. | ||
| // See https://github.com/apache/grails-core/issues/15613. | ||
| def skipMicronautTests = providers.gradleProperty('skipMicronautTests').isPresent() |
There was a problem hiding this comment.
We already have test slicing, and this isn't skipping tests. It's skipping projects. We should rename this.
There was a problem hiding this comment.
Renamed in cf47e9f:
skipMicronautTests->skipMicronautProjectsacrosssettings.gradle,gradle.properties,.github/workflows/groovy-joint-workflow.yml, and the grails-doc comment.- Name now reflects what the flag actually does (skip whole projects, not tests) and removes the overlap with test-related flag naming.
While in there, I also guarded the two unconditional Micronaut BOM cross-references in grails-doc/build.gradle (lines 193, 206) - per Oracle architectural review, when the Micronaut BOM page is intentionally omitted under the skip flag, the default and Hibernate 5 BOM pages should not link to it. Verified locally with both flag states (./gradlew :grails-doc:generateBomDocumentation):
| Flag state | Pages generated | Cross-links |
|---|---|---|
| no flag | Default, Hibernate 5, Micronaut | all 3 link to each other |
-PskipMicronautProjects |
Default, Hibernate 5 | only link to each other (no dead Micronaut link) |
jdaugherty
left a comment
There was a problem hiding this comment.
My only concern is the poor name of the value - it's confusing with testSlicing that mattias added. We should call this skipMicronautProjects since it's actually excluding the projects from building or being included.
The toggle skips entire projects from the build graph, not just tests, which was confusing with the existing test-related flags. Renamed across settings.gradle, gradle.properties, the joint Groovy CI workflow, and the grails-doc reference comment. Also guard the two unconditional cross-references to the Micronaut BOM page in grails-doc/build.gradle so the generated default and Hibernate 5 BOM pages no longer link to a Micronaut BOM page that intentionally was not produced. The flag's runtime is the joint Groovy 4 CI job, which does not publish docs, but the generated pages are now internally consistent under skip mode (verified locally for both flag states). Refs grails-core#15613. Assisted-by: claude-code:claude-opus-4-7
|
Pushed cf47e9f addressing review feedback: 1. Renamed the toggle (per @jdaugherty)
2. Tightened grails-doc cross-references Architectural review surfaced that the default and Hibernate 5 BOM pages still emitted unconditional Verification (JDK 21 locally)
Net diff vs the previous push: +13/-10 across the same 4 files. |
✅ All tests passed ✅🏷️ Commit: cf47e9f Learn more about TestLens at testlens.app. |
Summary
-PskipMicronautTestsproject property insettings.gradlethat gates the Grails-Micronaut "island" (grails-micronaut,grails-micronaut-bom, and the 5 Micronaut-tied test-examples) out of the build graph entirely.-PskipMicronautTestsinto.github/workflows/groovy-joint-workflow.ymlso the joint Groovy 4 snapshot build never evaluates the Groovy-5-pinned subgraph.gradle.propertiesfor discoverability.Why
The
Swap Groovy Versionstep in the joint workflow rewrites every'groovy.version'line independencies.gradle- including the override inside theelse if (project.name == 'grails-micronaut-bom')block - to the locally builtapache/groovy4.x snapshot. That BOM still pins Spock to2.4-groovy-5.0(intentionally, to match the Micronaut platform's Groovy 5 baseline), so when a test-example that opts intoenforcedPlatform(:grails-micronaut-bom)tries to compile a Spock spec, Spock's compile-time Groovy major-version check refuses Groovy 4 and the build fails:The architectural intent of
grails-micronaut-bom(introduced in 2226af9) is exactly to give Micronaut its own dependency graph. This change finishes that isolation for the joint build instead of spreading Spock'siKnowWhatImDoing.disableGroovyVersionCheckescape hatch intoCompilePlugin/gradle/test-config.gradle/ every test-example.Modules gated by the flag
grails-micronautgrails-micronaut-bomgrails-test-examples-issue-11767enforcedPlatform(:grails-micronaut-bom)grails-test-examples-plugins-issue-11767enforcedPlatform(:grails-micronaut-bom)grails-test-examples-micronautenforcedPlatform(:grails-micronaut-bom)grails-test-examples-micronaut-groovy-onlyenforcedPlatform(:grails-micronaut-bom)grails-test-examples-plugins-micronaut-singletonenforcedPlatform(:grails-micronaut-bom)Verification
Both flag states verified locally with JDK 21:
./gradlew codeStyle-> BUILD SUCCESSFUL.Notes
gradle.ymlCI run are unaffected; onlygroovy-joint-workflow.ymlopts in.dependencies.gradle,CompilePlugin.groovy,gradle/test-config.gradle, or any individual Micronaut module'sbuild.gradle. The gating logic lives in exactly one place (settings.gradle).Fixes #15613