Copilot commented on code in PR #15951:
URL: https://github.com/apache/grails-core/pull/15951#discussion_r3556023757


##########
grails-data-neo4j/grails-datastore-gorm-neo4j/build.gradle:
##########
@@ -92,59 +116,23 @@ test {
             '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
             '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED',
     ]
-    afterSuite {
-        System.out.print('.')
-        System.out.flush()
-    }
 }
 
-test.doFirst {
-    def toBaseClassRelativePathWithoutExtension = { String base, String 
classFile ->
-        if (classFile.startsWith(base)) {
-            def sansClass = classFile[0 .. classFile.size() - ".class".size() 
- 1]
-            def dollarIndex = sansClass.indexOf('$')
-            def baseClass = dollarIndex > 0 ? sansClass[0..dollarIndex - 1] : 
sansClass
-            def relative = baseClass - base - '/'
-            relative
-        }
-        else {
-            null
-        }
-    }    
-    def tckClassesFile = project
-                            .configurations
-                            .testCompileClasspath
-                            .resolvedConfiguration
-                            .getResolvedArtifacts()
-                            .find { resolved ->
-                                resolved.moduleVersion.id.name == 
'grails-datamapping-tck'
-                            }.file
-
-    def tckClassesDir = project.file("${project.buildDir}/tck")                
            
-    copy {
-        from zipTree(tckClassesFile)
-        into tckClassesDir 
-    }
-    copy {
-        from tckClassesDir
-        into sourceSets.test.output.classesDirs.find { 
it.path.contains('classes/groovy') }
-        include "**/*.class"
-        exclude { details ->
-            // Do not copy across any TCK class (or nested classes of that 
class)
-            // If there is a corresponding source file in the particular 
modules
-            // test source tree. Allows a module to override a test/helper.
-
-            if (!details.file.isFile()) {
-                return false
-            }
-            def candidatePath = details.file.absolutePath
-            def relativePath = 
toBaseClassRelativePathWithoutExtension(tckClassesDir.absolutePath, 
candidatePath)
-
-            if (relativePath == null) {
-                throw new IllegalStateException("$candidatePath does not 
appear to be in the TCK")
-            }
-
-            project.file("src/test/groovy/${relativePath}.groovy").exists()
-        }
-    }
+apply {
+    from 
rootProject.layout.projectDirectory.file('gradle/grails-data-tck-config.gradle')
+    from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle')
+}
+
+// This module predates the repo's Checkstyle/CodeNarc gate entirely: it was a 
standalone Gradle
+// build (never included in root settings.gradle) until this PR wired it in, 
so its Grails 3-era
+// source has never been checked against these rules. ~1,400 pre-existing 
violations across the
+// module are tracked as a follow-up cleanup PR rather than fixed here - 
codenarcFix's automated
+// fixes for SpaceAroundMapEntryColon/UnnecessaryGString are unsafe on this 
module specifically,
+// since they rewrite string *contents* and this module embeds Cypher queries 
in string literals
+// throughout (e.g. "MATCH (n:Label)"). Reports still generate; only 
build-breaking is suppressed.
+tasks.withType(Checkstyle).configureEach {
+    ignoreFailures = true
+}
+tasks.withType(CodeNarc).configureEach {
+    ignoreFailures = true

Review Comment:
   This disables the repo’s code-style gate for this module by forcing 
Checkstyle/CodeNarc to ignore failures. That makes it easy for new violations 
to slip in unnoticed until a follow-up cleans things up. Prefer keeping the 
gate enforced (e.g., fix violations now, apply a suppression/baseline, or make 
the bypass an explicit temporary build flag used only in CI).



##########
grails-data-neo4j/grails-plugin/build.gradle:
##########
@@ -17,61 +17,108 @@
  *  under the License.
  */
 
-// TODO: Use bom
-//configurations.configureEach {
-//    exclude group: 'org.apache.grails.data', module: 'grails-data-simple'
-//    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
-//        if (details.requested.group == 'org.apache.grails.data'
-//                && details.requested.name.startsWith('grails-datastore')
-//                && !details.requested.name.contains('neo4j')) {
-//
-//            details.useVersion(datastoreVersion)
-//        } else if (details.requested.group == 'org.apache.groovy' && 
details.requested.name.startsWith('groovy')) {
-//            details.useVersion(groovyVersion)
-//        } else if (details.requested.group == 'org.springframework') {
-//            details.useVersion(springVersion)
-//        }
-//    }
-//}
+plugins {
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.gradle.grails-plugin'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    gormApiDocs = true
+    pomTitle = 'GORM for Neo4j'
+    pomDescription = 'Provides a GORM Object Mapping implementation for the 
Neo4j Graph Database'
+}
 
 dependencies {
-    compileOnly "org.apache.grails:grails-core"
-    compileOnly "org.apache.grails.bootstrap:grails-bootstrap"
-    compileOnly "org.spockframework:spock-core:$spockVersion", {
-        exclude group: "junit", module: "junit-dep"
-        exclude group: 'org.codehaus.groovy', module: 'groovy-all'
-        exclude group: 'org.hamcrest', module: 'hamcrest-core'
-    }
 
-    runtimeOnly "org.apache.grails.data:grails-datastore-web:$datastoreVersion"
+    implementation platform(project(':grails-bom'))
+
+    compileOnly 'org.apache.grails:grails-core'
+    compileOnly 'org.apache.grails.bootstrap:grails-bootstrap'
+    compileOnly 'org.spockframework:spock-core'
 
-    api "org.apache.grails.data:grails-datamapping-support:$datastoreVersion", 
{
-        exclude group:'org.springframework', module:'spring-context'
-        exclude group:'org.springframework', module:'spring-core'
-        exclude group:'org.springframework', module:'spring-beans'
-        exclude group:'org.springframework', module:'spring-tx'
-        exclude group:'org.apache.grails.bootstrap', module:'grails-bootstrap'
-        exclude group:'org.codehaus.groovy', module:'groovy-all'
-        exclude group:'org.apache.grails', module:'grails-core'
-        exclude group:'javax.transaction', module:'jta'
+    runtimeOnly project(':grails-datastore-web')
+
+    api project(':grails-datamapping-support'), {
+        exclude group: 'org.springframework', module: 'spring-context'
+        exclude group: 'org.springframework', module: 'spring-core'
+        exclude group: 'org.springframework', module: 'spring-beans'
+        exclude group: 'org.springframework', module: 'spring-tx'
+        exclude group: 'org.apache.grails.bootstrap', module: 
'grails-bootstrap'
+        exclude group: 'org.apache.grails', module: 'grails-core'
     }
-    api project(":grails-datastore-gorm-neo4j"), {
-        exclude group:'org.springframework', module:'spring-context'
-        exclude group:'org.springframework', module:'spring-core'
-        exclude group:'org.springframework', module:'spring-beans'
-        exclude group:'org.springframework', module:'spring-tx'
-        exclude group:'org.apache.grails.bootstrap', module:'grails-bootstrap'
-        exclude group:'org.codehaus.groovy', module:'groovy-all'
-        exclude group:'org.apache.grails', module:'grails-core'
-        exclude group:'javax.transaction', module:'jta'
+    api project(':grails-datastore-gorm-neo4j'), {
+        exclude group: 'org.springframework', module: 'spring-context'
+        exclude group: 'org.springframework', module: 'spring-core'
+        exclude group: 'org.springframework', module: 'spring-beans'
+        exclude group: 'org.springframework', module: 'spring-tx'
+        exclude group: 'org.apache.grails.bootstrap', module: 
'grails-bootstrap'
+        exclude group: 'org.apache.grails', module: 'grails-core'
     }
 
-    testImplementation "org.apache.grails:grails-core"
-    testImplementation "org.apache.grails.bootstrap:grails-bootstrap"
+    testImplementation 'org.apache.grails:grails-core'
+    testImplementation 'org.apache.grails.bootstrap:grails-bootstrap'
+    testImplementation 'org.spockframework:spock-core'
     testImplementation "org.neo4j.test:neo4j-harness:$neo4jVersion"
-
+    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
 }
 
 springBoot {
-    mainClass  = "grails.plugins.neo4j.Application"
-}
\ No newline at end of file
+    mainClass = 'grails.plugins.neo4j.Application'
+}
+
+test {
+    useJUnitPlatform()
+
+    // The embedded Neo4j 3.5.x test harness reflectively pokes JDK internals 
(Throwable's
+    // message field, sun.nio.ch.FileChannelImpl's lock accessors) at startup; 
JDK 9+ strong
+    // encapsulation blocks that without these opens.
+    jvmArgs = [
+            '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
+            '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED',
+    ]
+}
+
+// The Spring Boot BOM (pulled in transitively via grails-bom) force-upgrades 
Jetty to a 12.x
+// platform version. The embedded Neo4j 3.5.x test harness (neo4j-harness, 
test-only) is compiled
+// against Jetty 9.4 and is binary-incompatible with Jetty 12's restructured 
handler/server APIs.
+// Scoped to the test classpaths only, matching 
grails-datastore-gorm-neo4j/build.gradle.
+def neo4jHarnessJettyVersion = '9.4.43.v20210629'
+[configurations.testCompileClasspath, 
configurations.testRuntimeClasspath].each {
+    it.resolutionStrategy {
+        force "org.eclipse.jetty:jetty-server:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-servlet:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-webapp:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-security:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-http:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-io:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-util:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-util-ajax:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-xml:$neo4jHarnessJettyVersion"
+    }
+}
+
+// grails-datastore-gorm-neo4j's own code (e.g. Neo4jQuery#executeQuery) calls
+// Driver#defaultTypeSystem(), which neo4j-java-driver 6.x (pulled in 
transitively via the Spring
+// Boot BOM) removed - so this module's test classpath needs the same force to 
actually exercise
+// that code path.
+configurations.all {
+    resolutionStrategy {
+        force "org.neo4j.driver:neo4j-java-driver:$neo4jDriverVersion"
+    }
+}
+
+// See grails-datastore-gorm-neo4j/build.gradle for why this module's 
pre-existing violations
+// are deferred to a follow-up cleanup PR rather than fixed here.
+tasks.withType(Checkstyle).configureEach {
+    ignoreFailures = true
+}
+tasks.withType(CodeNarc).configureEach {
+    ignoreFailures = true

Review Comment:
   This disables the repo’s code-style gate for this module by forcing 
Checkstyle/CodeNarc to ignore failures. That makes it easy for new violations 
to slip in unnoticed until a follow-up cleans things up. Prefer keeping the 
gate enforced (e.g., fix violations now, apply a suppression/baseline, or make 
the bypass an explicit temporary build flag used only in CI).



##########
grails-data-neo4j/boot-plugin/build.gradle:
##########
@@ -17,27 +17,81 @@
  *  under the License.
  */
 
+plugins {
+    id 'groovy'
+    id 'java-library'
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
 dependencies {
-    compileOnly "org.springframework.boot:spring-boot-cli:$springBootVersion", 
{
-        exclude group:'org.apache.groovy', module:'groovy'
-        exclude group:'jline', module:'jline'
-    }
 
-    api "org.springframework.boot:spring-boot-autoconfigure:$springBootVersion"
+    implementation platform(project(':grails-bom'))
 
-    api "org.apache.groovy:groovy:$groovyVersion"
-    api project(":grails-datastore-gorm-neo4j")
-    api "org.springframework:spring-tx:$springVersion"
+    api 'org.springframework.boot:spring-boot-autoconfigure'
+    // DispatcherServletAutoConfiguration (referenced via 
@AutoConfigureBefore) moved to spring-boot-webmvc.
+    api 'org.springframework.boot:spring-boot-webmvc'
+    api 'org.apache.groovy:groovy'
+    api project(':grails-datastore-gorm-neo4j')
+    api 'org.springframework:spring-tx'
 
     testRuntimeOnly "org.neo4j.test:neo4j-harness:$neo4jVersion"
-    testImplementation ("org.spockframework:spock-core:$spockVersion") {
-        exclude group: 'junit', module: 'junit-dep'
-        exclude group: 'org.apache.groovy', module: 'groovy-all'
-        exclude group: 'org.hamcrest', module: 'hamcrest-core'
-        transitive = false
+    testImplementation 'org.spockframework:spock-core'
+    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
+}
+
+test {
+    useJUnitPlatform()
+
+    // The embedded Neo4j 3.5.x test harness reflectively pokes JDK internals 
(Throwable's
+    // message field, sun.nio.ch.FileChannelImpl's lock accessors) at startup; 
JDK 9+ strong
+    // encapsulation blocks that without these opens.
+    jvmArgs = [
+            '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
+            '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED',
+    ]
+}
+
+// The Spring Boot BOM (pulled in transitively via grails-bom) force-upgrades 
Jetty to a 12.x
+// platform version. The embedded Neo4j 3.5.x test harness (neo4j-harness, 
test-only) is compiled
+// against Jetty 9.4 and is binary-incompatible with Jetty 12's restructured 
handler/server APIs.
+// Scoped to the test classpaths only, matching 
grails-datastore-gorm-neo4j/build.gradle.
+def neo4jHarnessJettyVersion = '9.4.43.v20210629'
+[configurations.testCompileClasspath, 
configurations.testRuntimeClasspath].each {
+    it.resolutionStrategy {
+        force "org.eclipse.jetty:jetty-server:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-servlet:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-webapp:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-security:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-http:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-io:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-util:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-util-ajax:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-xml:$neo4jHarnessJettyVersion"
     }
-    testImplementation 
"org.springframework.boot:spring-boot-cli:$springBootVersion", {
-        exclude group:'org.apache.groovy', module:'groovy'
-        exclude group:'jline', module:'jline'
+}
+
+// grails-datastore-gorm-neo4j's own code (e.g. Neo4jQuery#executeQuery) calls
+// Driver#defaultTypeSystem(), which neo4j-java-driver 6.x (pulled in 
transitively via the Spring
+// Boot BOM) removed - so this module's test classpath needs the same force to 
actually exercise
+// that code path.
+configurations.all {
+    resolutionStrategy {
+        force "org.neo4j.driver:neo4j-java-driver:$neo4jDriverVersion"
     }
 }
+
+// See grails-datastore-gorm-neo4j/build.gradle for why this module's 
pre-existing violations
+// are deferred to a follow-up cleanup PR rather than fixed here.
+tasks.withType(Checkstyle).configureEach {
+    ignoreFailures = true
+}
+tasks.withType(CodeNarc).configureEach {
+    ignoreFailures = true

Review Comment:
   This disables the repo’s code-style gate for this module by forcing 
Checkstyle/CodeNarc to ignore failures. That makes it easy for new violations 
to slip in unnoticed until a follow-up cleans things up. Prefer keeping the 
gate enforced (e.g., fix violations now, apply a suppression/baseline, or make 
the bypass an explicit temporary build flag used only in CI).



-- 
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]

Reply via email to