The GitHub Actions job "Code Style" on grails-core.git/grails8-groovy5-sb4 has failed. Run started by GitHub user jamesfredley (triggered by jamesfredley).
Head commit for run: 0a88acecc2fec99b577dc4d09bd99ad6ffdabf3b / James Fredley <[email protected]> fix(ci): align micronaut-bom groovy version and resolve Groovy 5 STC regressions Four issues were causing the PR CI to fail; this commit addresses all of them with minimal, scoped changes. 1. Validate Dependency Versions `dependencies.gradle` was pinning `groovy.version` to `5.0.6` in the `grails-micronaut-bom` overrides while the main BOM had moved to `5.0.7-SNAPSHOT` (commit f1b78b7b4b). The strictly-pinned 5.0.6 then failed `:grails-micronaut:validateDependencyVersions`: org.apache.groovy:groovy-bom - resolved 5.0.7-SNAPSHOT, expected 5.0.6 Bumped the micronaut-bom override to `5.0.7-SNAPSHOT` so it matches `bomDependencyVersions['groovy.version']` again (the inline comment already documents this invariant). 2. Code Style (Core Projects), CodeQL Analyze, macOS Build These three CI jobs all short-circuit on `compileGroovy` failures in `:grails-data-graphql-core` (and the macOS job additionally fails in `:grails-data-mongodb-core` because it does not stop on first failure). 2a. `Arguable.groovy:43` and `ComplexTyped.groovy:134` Both files are traits that `extends ExecutesClosures` and call the static `withDelegate(Closure, Object)` declared on the parent trait. Groovy 5 `@CompileStatic` STC no longer resolves a parent trait's static method from a child trait that extends it: [Static type checking] - Cannot find matching method org.grails.gorm.graphql.entity.dsl.helpers.Arguable#withDelegate( groovy.lang.Closure, java.lang.Object) An explicit `ExecutesClosures.withDelegate(...)` qualification also fails STC ("Cannot find ... static method ExecutesClosures#withDelegate"), because traits compile static methods onto a `$Trait$Helper` rather than the trait interface. Converting `withDelegate` to an instance method breaks the two `static build(...)` call sites in `GraphQLMapping` and `GraphQLPropertyMapping`. Inlined the 5-line body at the two affected trait sites. The static `withDelegate` on `ExecutesClosures` is left untouched so all implementing-class call sites (`GraphQLMapping`, `GraphQLPropertyMapping`, `LazyGraphQLMapping`, `ComplexArgument`, `ComplexOperation`, `ComplexGraphQLProperty`) keep working without changes. 2b. `PersistentEntityCodec.groovy:404-405` The embedded-update branch added in `e50bf4ff42` introduced a new call site for `PropertyEncoder#encode(...)` that declared the local variable as `PropertyEncoder<? extends PersistentProperty>`. Under Groovy 5 STC, calling `.encode(..., prop, ...)` through a receiver with `capture-of ? extends PersistentProperty` does not accept a plain `PersistentProperty` argument: [Static type checking] - Cannot call org.grails.datastore.bson.codecs.PropertyEncoder#encode(... capture-of ? extends PersistentProperty, ...) with arguments [... PersistentProperty, ...] Switched this site to the existing pattern already used in two other branches of the same method (lines 267-268 and 358-359): declare `propKind` as `Class<? extends PersistentProperty>` and erase the wildcard via an unchecked `(PropertyEncoder<PersistentProperty>)` cast. Behaviour is identical to the surrounding code, which is already exercised by the existing test suite. Verification Ran locally (Groovy 5.0.7-SNAPSHOT, JDK 21, Windows): .\gradlew :grails-data-graphql-core:compileGroovy # BUILD SUCCESSFUL .\gradlew :grails-data-mongodb-core:compileGroovy # BUILD SUCCESSFUL .\gradlew :grails-micronaut:validateDependencyVersions # BUILD SUCCESSFUL .\gradlew validateDependencyVersions # BUILD SUCCESSFUL (all BOMs) .\gradlew :grails-data-graphql:build :grails-data-mongodb:build -x test # BUILD SUCCESSFUL Assisted-by: claude-code:claude-opus-4-7 Report URL: https://github.com/apache/grails-core/actions/runs/26301586265 With regards, GitHub Actions via GitBox
