Copilot commented on code in PR #15689:
URL: https://github.com/apache/grails-core/pull/15689#discussion_r3319924382
##########
grails-doc/src/en/guide/conf/micronaut.adoc:
##########
@@ -43,6 +43,23 @@ dependencies {
The `grails-micronaut-bom` layers Micronaut-specific dependency overrides on
top of `grails-bom` and pins the `io.micronaut.platform:micronaut-platform`
version it was built against. Applying it as `enforcedPlatform` makes all of
its constraints strictly versioned so that no transitive dependency (including
Micronaut's own platform) can override them — there is no need to set a
`micronautPlatformVersion` Gradle property. See
link:{versionsRef}Grails%20BOM%20Micronaut.html[Grails Micronaut BOM
Dependencies] for the full list of managed versions.
+==== Hibernate-Specific Micronaut BOMs
+
+If your project targets a specific Hibernate version, use the corresponding
Hibernate-specific Micronaut BOM instead of the generic `grails-micronaut-bom`:
+
+* `org.apache.grails:grails-hibernate5-micronaut-bom` -- Micronaut + Hibernate
5 (the default). See
link:{versionsRef}Grails%20BOM%20Hibernate5%20Micronaut.html[Grails Hibernate 5
Micronaut BOM Dependencies].
Review Comment:
The doc link `Grails%20BOM%20Hibernate5%20Micronaut.html` will be broken:
`grails-doc/build.gradle`'s `generateBomDocumentation` task only knows about
`grails-bom`, `grails-hibernate5-bom`, and `grails-micronaut-bom`. It does not
depend on `:grails-hibernate5-micronaut-bom:extractConstraints` nor emit a
`Grails BOM Hibernate5 Micronaut.adoc` page, so this link in the new guide
section will 404. The doc generator needs to be extended to wire in the new
BOM's `extractConstraints` output, similarly to the generic Micronaut BOM.
##########
grails-doc/src/en/guide/conf/micronaut.adoc:
##########
@@ -43,6 +43,23 @@ dependencies {
The `grails-micronaut-bom` layers Micronaut-specific dependency overrides on
top of `grails-bom` and pins the `io.micronaut.platform:micronaut-platform`
version it was built against. Applying it as `enforcedPlatform` makes all of
its constraints strictly versioned so that no transitive dependency (including
Micronaut's own platform) can override them — there is no need to set a
`micronautPlatformVersion` Gradle property. See
link:{versionsRef}Grails%20BOM%20Micronaut.html[Grails Micronaut BOM
Dependencies] for the full list of managed versions.
+==== Hibernate-Specific Micronaut BOMs
+
+If your project targets a specific Hibernate version, use the corresponding
Hibernate-specific Micronaut BOM instead of the generic `grails-micronaut-bom`:
+
+* `org.apache.grails:grails-hibernate5-micronaut-bom` -- Micronaut + Hibernate
5 (the default). See
link:{versionsRef}Grails%20BOM%20Hibernate5%20Micronaut.html[Grails Hibernate 5
Micronaut BOM Dependencies].
+
+[source,groovy]
+.build.gradle - Hibernate 5 with Micronaut
+----
+dependencies {
+ implementation
enforcedPlatform("org.apache.grails:grails-hibernate5-micronaut-bom:$grailsVersion")
+ implementation 'org.apache.grails:grails-micronaut'
+}
+----
+
+The generic `grails-micronaut-bom` remains available and currently tracks the
Hibernate 5 default. If the framework changes its default Hibernate version in
the future, `grails-micronaut-bom` will follow the new default while the
Hibernate-specific BOMs remain pinned.
+
When the `grails-micronaut` plugin is present, the Grails Gradle plugin will
automatically apply the required annotation processors to your project and
validate that `grails-micronaut-bom` is applied as `enforcedPlatform`. The
validation fails the build at configuration time with an actionable error if
the BOM is missing or applied as plain `platform(...)`.
Review Comment:
This sentence is now stale: validation accepts both `grails-micronaut-bom`
and `grails-hibernate5-micronaut-bom` (see updated `validateMicronautBom`), and
the surrounding doc now recommends the Hibernate-specific BOM. The wording here
still implies only `grails-micronaut-bom` satisfies the check. Update to
reflect that any Micronaut-compatible BOM (`grails-micronaut-bom` or
`grails-hibernate5-micronaut-bom`) applied as `enforcedPlatform` is accepted.
##########
grails-test-examples/micronaut-hibernate5/src/integration-test/groovy/micronaut/hibernate5/ApplicationStartupSpec.groovy:
##########
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package micronaut.hibernate5
+
+import grails.plugin.geb.ContainerGebSpec
+import grails.testing.mixin.integration.Integration
+
+@Integration
+class ApplicationStartupSpec extends ContainerGebSpec {
+
+ void "test the application starts and the home page renders"() {
+ when: 'The home page is visited'
+ go '/'
+
+ then: 'The page loads successfully'
+ title || true // Grails default index page has a title, but we just
need the server to respond
Review Comment:
`title || true` is always true regardless of whether the page rendered (and
`title` is evaluated only for its side effect of throwing if the page is bad,
which it doesn't reliably do). This makes the assertion meaningless as a Spock
`then:` condition — the test cannot actually fail on a missing title. Either
assert on the title content directly (e.g. `title == 'Micronaut Hibernate 5
Test Application'`) or drop this line and rely on the explicit URL check.
##########
grails-test-examples/micronaut-hibernate5/build.gradle:
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+plugins {
+ id 'org.apache.grails.buildsrc.properties'
+ id 'org.apache.grails.buildsrc.compile'
+ id 'org.apache.grails.buildsrc.dependency-validator'
Review Comment:
The new sample applies `org.apache.grails.buildsrc.dependency-validator`,
but `GrailsDependencyValidatorPlugin.BOM_PROJECT_NAMES`
(build-logic/plugins/.../GrailsDependencyValidatorPlugin.groovy:58) does not
include `grails-hibernate5-micronaut-bom`. As a result `detectBomPath` will
return `null` for this project and `validateDependencyVersions` is silently
skipped, so the new sample gets no BOM-version validation. Add
`grails-hibernate5-micronaut-bom` to `BOM_PROJECT_NAMES`.
##########
gradle/test-config.gradle:
##########
@@ -63,6 +63,13 @@ tasks.withType(Test).configureEach {
useJUnitPlatform()
jvmArgs += java17moduleReflectionCompatibilityArguments
+// develocity {
+// testRetry {
+// maxRetries = configuredTestParallel == 1 ? 1 : 2
+// maxFailures = 20
+// failOnPassedAfterRetry = true
+// }
+// }
Review Comment:
Commented-out Develocity `testRetry` block left in shared test config.
Either enable it (and gate as needed) or remove it — dead commented
configuration in a shared Gradle script tends to drift and confuses readers
about whether retries are actually configured.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]