You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by bo...@apache.org on 2026/04/03 17:13:09 UTC
(grails-core) branch 8.0.x-hibernate7-dev updated (78b8b36725 -> 9c79935079)
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a change to branch 8.0.x-hibernate7-dev
in repository https://gitbox.apache.org/repos/asf/grails-core.git
from 78b8b36725 Merge branch '8.0.x-hibernate7' into 8.0.x-hibernate7-dev
new 1497ea4beb H7: fix style violations and update agent guidelines
new 9d723a8d20 H7: update agent guidelines for test aggregation
new d52a9e52fc H7: make test aggregation more robust by scanning all root directories
new 6658a08eeb fix: DefaultUrlCreator generates correct URL for controller-only links
new 9c79935079 fix: remove @PendingFeatureIf from many-to-many sorting test in H5
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
AGENTS.md | 6 +++--
.../apache/grails/buildsrc/GrailsTestPlugin.groovy | 27 ++++++++++++++++++----
.../WhereQueryOldIssueVerificationSpec.groovy | 4 ----
.../hibernate/GrailsHibernatePersistentEntity.java | 2 +-
.../cfg/domainbinding/util/BasicValueCreator.java | 6 ++---
.../org/grails/web/mapping/DefaultUrlCreator.java | 3 +++
.../web/mapping/DefaultUrlCreatorTests.groovy | 12 ++++++++++
7 files changed, 46 insertions(+), 14 deletions(-)
(grails-core) 03/05: H7: make test aggregation more robust by scanning all root directories
Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch 8.0.x-hibernate7-dev
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit d52a9e52fc804402cd61060aa2153428fa8fa4eb
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Fri Apr 3 10:58:12 2026 -0500
H7: make test aggregation more robust by scanning all root directories
---
.../apache/grails/buildsrc/GrailsTestPlugin.groovy | 27 ++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GrailsTestPlugin.groovy b/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GrailsTestPlugin.groovy
index de9a11df3c..a1414a6eab 100644
--- a/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GrailsTestPlugin.groovy
+++ b/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GrailsTestPlugin.groovy
@@ -50,9 +50,10 @@ class GrailsTestPlugin implements Plugin<Project> {
slurper.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
slurper.setFeature("http://xml.org/sax/features/namespaces", false)
- project.subprojects.each { subproject ->
- def testResultsDir = subproject.layout.buildDirectory.dir("test-results").get().asFile
- if (testResultsDir.exists()) {
+ def processedDirs = [] as Set
+
+ def processTestResults = { File testResultsDir, String moduleName ->
+ if (testResultsDir.exists() && processedDirs.add(testResultsDir.absolutePath)) {
testResultsDir.eachFileRecurse { file ->
if (file.name.endsWith('.xml') && file.name.startsWith('TEST-')) {
try {
@@ -61,7 +62,7 @@ class GrailsTestPlugin implements Plugin<Project> {
if (testcase.failure.size() > 0 || testcase.error.size() > 0) {
def failure = testcase.failure.size() > 0 ? testcase.failure[0] : testcase.error[0]
failures << [
- module: subproject.name,
+ module: moduleName,
className: testcase.@classname.text(),
testName: testcase.@name.text(),
message: failure.@message.text() ?: failure.text().take(200),
@@ -77,6 +78,24 @@ class GrailsTestPlugin implements Plugin<Project> {
}
}
+ // 1. All subprojects
+ project.subprojects.each { subproject ->
+ def testResultsDir = subproject.layout.buildDirectory.dir("test-results").get().asFile
+ processTestResults(testResultsDir, subproject.name)
+ }
+
+ // 2. Any other directory in root that might have test results (like grails-docs or build-logic)
+ project.layout.projectDirectory.asFile.eachDir { dir ->
+ if (!dir.name.startsWith('.') && dir.name != 'build' && dir.name != 'node_modules') {
+ def testResultsDir = new File(dir, "build/test-results")
+ processTestResults(testResultsDir, dir.name)
+
+ // Also check for results in the directory itself (if it's a build output)
+ def directTestResultsDir = new File(dir, "test-results")
+ processTestResults(directTestResultsDir, dir.name)
+ }
+ }
+
writeReport(project, failures)
}
}
(grails-core) 01/05: H7: fix style violations and update agent guidelines
Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch 8.0.x-hibernate7-dev
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 1497ea4beb5d2aa1c28508e1b424c327583be476
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Fri Apr 3 09:40:07 2026 -0500
H7: fix style violations and update agent guidelines
---
AGENTS.md | 5 +++--
.../domainbinding/hibernate/GrailsHibernatePersistentEntity.java | 2 +-
.../orm/hibernate/cfg/domainbinding/util/BasicValueCreator.java | 6 +++---
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/AGENTS.md b/AGENTS.md
index 3b7f347c9a..66185d5656 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -230,8 +230,9 @@ class MyService { }
1. **Fork & branch** from the target release branch (e.g., `7.0.x`)
2. **Run tests** before submitting: `./gradlew build --rerun-tasks`
3. **Run code style checks**: `./gradlew codeStyle`
-4. **Squash commits** into a single meaningful commit message
-5. **Reference issues** in PR description (e.g., "Fixes #1234")
+4. **Clean style violations**: Before committing, run `./gradlew clean aggregateStyleViolations` from the root and ensure that `CHECKSTYLE_VIOLATIONS.md`, `CODENARC_VIOLATIONS.md`, and `PMD_VIOLATIONS.md` have no issues.
+5. **Squash commits** into a single meaningful commit message
+6. **Reference issues** in PR description (e.g., "Fixes #1234")
### Review Process
diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/hibernate/GrailsHibernatePersistentEntity.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/hibernate/GrailsHibernatePersistentEntity.java
index 798ac9d195..7f19600565 100644
--- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/hibernate/GrailsHibernatePersistentEntity.java
+++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/hibernate/GrailsHibernatePersistentEntity.java
@@ -35,8 +35,8 @@ import org.hibernate.mapping.PersistentClass;
import org.grails.datastore.mapping.model.PersistentEntity;
import org.grails.datastore.mapping.model.PersistentProperty;
import org.grails.datastore.mapping.model.config.GormProperties;
-import org.grails.orm.hibernate.cfg.HibernateCompositeIdentity;
import org.grails.orm.hibernate.cfg.DiscriminatorConfig;
+import org.grails.orm.hibernate.cfg.HibernateCompositeIdentity;
import org.grails.orm.hibernate.cfg.HibernateSimpleIdentity;
import org.grails.orm.hibernate.cfg.Mapping;
import org.grails.orm.hibernate.cfg.PersistentEntityNamingStrategy;
diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/util/BasicValueCreator.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/util/BasicValueCreator.java
index c401589f12..767066393f 100644
--- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/util/BasicValueCreator.java
+++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/util/BasicValueCreator.java
@@ -18,6 +18,8 @@
*/
package org.grails.orm.hibernate.cfg.domainbinding.util;
+import java.util.Optional;
+
import org.hibernate.MappingException;
import org.hibernate.boot.spi.MetadataBuildingContext;
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
@@ -25,8 +27,6 @@ import org.hibernate.generator.Generator;
import org.hibernate.generator.GeneratorCreationContext;
import org.hibernate.mapping.BasicValue;
-import java.util.Optional;
-
import org.grails.datastore.mapping.model.DefaultPropertyMapping;
import org.grails.datastore.mapping.model.config.GormProperties;
import org.grails.orm.hibernate.cfg.HibernateSimpleIdentity;
@@ -34,8 +34,8 @@ import org.grails.orm.hibernate.cfg.PersistentEntityNamingStrategy;
import org.grails.orm.hibernate.cfg.PropertyConfig;
import org.grails.orm.hibernate.cfg.domainbinding.generator.GrailsSequenceWrapper;
import org.grails.orm.hibernate.cfg.domainbinding.hibernate.GrailsHibernatePersistentEntity;
-import org.grails.orm.hibernate.cfg.domainbinding.hibernate.HibernateSimpleIdentityProperty;
import org.grails.orm.hibernate.cfg.domainbinding.hibernate.HibernatePersistentProperty;
+import org.grails.orm.hibernate.cfg.domainbinding.hibernate.HibernateSimpleIdentityProperty;
/** The basic value creator class. */
@SuppressWarnings("PMD.DataflowAnomalyAnalysis")
(grails-core) 04/05: fix: DefaultUrlCreator generates correct URL for controller-only links
Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch 8.0.x-hibernate7-dev
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 6658a08eebc484bf8a0eb4619fe6d6eb6b09d0c4
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Fri Apr 3 11:37:33 2026 -0500
fix: DefaultUrlCreator generates correct URL for controller-only links
When actionName is null and no id is present, append the controller token
so that <g:form controller="foo"> (no action) generates /foo instead of
an empty string. Preserve existing behaviour when an id is present and
no action is given (id-only URL patterns such as /$id? still resolve
correctly without prepending the context controller name).
Co-authored-by: Copilot <22...@users.noreply.github.com>
---
.../groovy/org/grails/web/mapping/DefaultUrlCreator.java | 3 +++
.../org/grails/web/mapping/DefaultUrlCreatorTests.groovy | 12 ++++++++++++
2 files changed, 15 insertions(+)
diff --git a/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/DefaultUrlCreator.java b/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/DefaultUrlCreator.java
index 1c3f898483..78dad3e0f0 100644
--- a/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/DefaultUrlCreator.java
+++ b/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/DefaultUrlCreator.java
@@ -103,6 +103,9 @@ public class DefaultUrlCreator implements UrlCreator {
}
appendUrlToken(actualUriBuf, actionName, encoding);
}
+ else if (controllerName != null && id == null) {
+ appendUrlToken(actualUriBuf, controllerName, encoding);
+ }
if (id != null) {
appendUrlToken(actualUriBuf, id, encoding);
}
diff --git a/grails-web-url-mappings/src/test/groovy/org/grails/web/mapping/DefaultUrlCreatorTests.groovy b/grails-web-url-mappings/src/test/groovy/org/grails/web/mapping/DefaultUrlCreatorTests.groovy
index aa35de869e..dbf1c34655 100644
--- a/grails-web-url-mappings/src/test/groovy/org/grails/web/mapping/DefaultUrlCreatorTests.groovy
+++ b/grails-web-url-mappings/src/test/groovy/org/grails/web/mapping/DefaultUrlCreatorTests.groovy
@@ -54,6 +54,18 @@ class DefaultUrlCreatorTests {
assertEquals "/foo/index", creator.createURL(null, "utf-8")
}
+ @Test
+ void testCreateUrlControllerOnly() {
+ def webRequest = GrailsWebMockUtil.bindMockWebRequest()
+ webRequest.currentRequest.characterEncoding = "utf-8"
+
+ def creator = new DefaultUrlCreator("foo", null)
+
+ assertEquals "/foo", creator.createURL(null, "utf-8")
+ assertEquals "/foo", creator.createRelativeURL("foo", null, [:], "utf-8")
+ assertEquals "/1", creator.createURL(id: 1, "utf-8")
+ }
+
@AfterEach
void tearDown() {
RequestContextHolder.resetRequestAttributes()
(grails-core) 02/05: H7: update agent guidelines for test aggregation
Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch 8.0.x-hibernate7-dev
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 9d723a8d2005769dfd37a6232279920fb9325bc1
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Fri Apr 3 09:49:11 2026 -0500
H7: update agent guidelines for test aggregation
---
AGENTS.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/AGENTS.md b/AGENTS.md
index 66185d5656..2f8df1c26d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -52,6 +52,7 @@ export GRADLE_OPTS="-Xms2G -Xmx5G"
9. **Test via public APIs** - Tests must exercise behavior through the same APIs an end user calls; never invoke internal implementations, package-private methods, or bypass the public surface directly
10. **Always review and extend tests** - Review existing unit and functional tests before making changes; every code change must include new or enhanced tests that cover the affected behavior
11. **Every code touch must update all tests for the changed class** - When a class is modified, find and update every test that covers it — unit, integration, and TCK. Do not leave any existing test out of sync with the new code.
+12. **Clean violations before commit** - Before every automated commit, run `./gradlew clean test aggregateTestFailures --continue` from the root and ensure that `TEST_FAILURES.md` reports no issues and is removed.
## Available Skills
(grails-core) 05/05: fix: remove @PendingFeatureIf from many-to-many sorting test in H5
Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch 8.0.x-hibernate7-dev
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 9c7993507981ca5d39765d9db2e5c5c2a413eb56
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Fri Apr 3 12:10:59 2026 -0500
fix: remove @PendingFeatureIf from many-to-many sorting test in H5
The 'many-to-many queries with sorting do not throw exception' feature
(issue #14636) now passes on Hibernate 5 as well. Remove the
@PendingFeatureIf guard and the unused IgnoreIf/PendingFeatureIf imports.
Co-authored-by: Copilot <22...@users.noreply.github.com>
---
.../grails/gorm/specs/WhereQueryOldIssueVerificationSpec.groovy | 4 ----
1 file changed, 4 deletions(-)
diff --git a/grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/WhereQueryOldIssueVerificationSpec.groovy b/grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/WhereQueryOldIssueVerificationSpec.groovy
index 0b3c835dde..a53128760d 100644
--- a/grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/WhereQueryOldIssueVerificationSpec.groovy
+++ b/grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/WhereQueryOldIssueVerificationSpec.groovy
@@ -18,9 +18,6 @@
*/
package grails.gorm.tests
-import spock.lang.IgnoreIf
-import spock.lang.PendingFeatureIf
-
import grails.gorm.annotation.Entity
import grails.gorm.hibernate.HibernateEntity
import grails.gorm.transactions.Rollback
@@ -160,7 +157,6 @@ class WhereQueryOldIssueVerificationSpec extends Specification {
@Rollback
@Issue('https://github.com/apache/grails-core/issues/14636')
- @PendingFeatureIf({ System.getProperty('hibernate5.gorm.suite') })
def "many-to-many queries with sorting do not throw exception"() {
given: "users and roles in a many-to-many relationship"
def role1 = new WqRole(name: "ADMIN").save(flush: true)