Hibernate 7 - Step 1#15654
Conversation
Copy all source, test examples, BOMs, and build config from the hibernate5 namespace to hibernate7 so that the real hibernate7 PR can be reviewed as a true delta rather than a sea of new files. Modules added: - grails-hibernate7-bom (copy of grails-hibernate5-bom) - grails-data-hibernate7-core, spring-orm, grails-plugin, dbmigration, spring-boot, docs - grails-test-examples/hibernate7 (12 projects mirroring hibernate5) - gradle/hibernate7-test-config.gradle (skipHibernate7Tests flag) Build infrastructure: - publish-root-config.gradle: register hibernate7 modules for publishing - SbomPlugin.groovy: add LGPL exemptions for hibernate5 artifacts used by hibernate7 staging modules - settings.gradle: include all hibernate7 projects
|
This PR is #1 for the hibernate PR. Basically, I cloned the hibernate5 projects and then created this PR as if they were the hibernate 7 artifacts. This then allows the actual hibernate PR to be meaningful since we can better see what changed. It's not perfect, but it did cut out about 400+ files to review this way. |
|
I went ahead and renamed |
matrei
left a comment
There was a problem hiding this comment.
Thank you @jdaugherty !
There are some TCK tests that are failing because they only have
@IgnoreIf({ System.getProperty('hibernate5.gorm.suite') })
and not
@IgnoreIf({ System.getProperty('hibernate7.gorm.suite') })
|
Per discussion, I've pulled forward the addAllDomainClasses, the common base spec for mongo, & the package renames from tests -> specs |
06fe15d to
f18465a
Compare
|
Should commit 06fe15d be on this branch? |
|
@matrei i had removed it from this branch since it's to fix the datastore changes in the other branch. |
|
@matrei Actually, it looks like it got readded somehow, let me try to take it off again |
6783934 to
4c5c563
Compare
|
@matrei I believe I have removed this now. |
|
|
@jamesfredley @borinquenkid @matrei assuming the tests all pass, this is ready to review now |
26950bc to
263f7ed
Compare
This comment has been minimized.
This comment has been minimized.
|
@sbglasius @codeconsole @borinquenkid @matrei I think this step 1 base PR for Hibernate 7.2 is ready to merge, which sets us up to dive deeper into the final reviews of #15568. We need 1 more approver. |
| if (closures == null) { | ||
| return new PromiseList<T>() | ||
| } |
| if (successCallbacks != null) { | ||
| synchronized (successCallbacks) { | ||
| for (FutureTaskChildPromise callback : successCallbacks) { | ||
| callback.accept(t) | ||
| } |
| if (failureCallbacks != null) { | ||
| synchronized (failureCallbacks) { | ||
| for (FutureTaskChildPromise callback : failureCallbacks) { | ||
| callback.accept(t) | ||
| } |
| ClassNode promiseNode = ClassHelper.make(Promise.class).getPlainNodeReference(); | ||
| ClassNode originalReturnType = m.getReturnType(); | ||
| if (!originalReturnType.getNameWithoutPackage().equals(VOID)) { | ||
| if (!VOID.equals(originalReturnType.getNameWithoutPackage())) { |
| Class<?> transformerClass = getClass().getClassLoader().loadClass("org.grails.async.transform.internal.DefaultDelegateAsyncTransactionalMethodTransformer"); | ||
| return (DelegateAsyncTransactionalMethodTransformer) transformerClass.getDeclaredConstructor().newInstance(); | ||
| } catch (Throwable e) { | ||
| } catch (Exception ignored) { |
There was a problem hiding this comment.
One explanation is that it's bad coding style to catch Throwables. And ignored is an IntelliJ thing 🤔
| import org.junit.runners.Suite | ||
| import org.junit.runner.RunWith | ||
| import grails.gorm.tests.* | ||
| import grails.gorm.specs.* |
| def CONSOLE_LOG_PATTERN = '%d{HH:mm:ss.SSS} [%t] %highlight(%p) %cyan(\\(%logger{39}\\)) %m%n' | ||
|
|
||
| appender('STDOUT', ConsoleAppender) { | ||
| follow = true |
There was a problem hiding this comment.
Is logback.groovy even supported?
|
I think we should revert any changes that are not directly related to Hibernate 7 compatibility. Any other changes that we still want to keep should be split out into separate, focused PRs targeting the appropriate version branch. If we, as a project, discuss and agree that we want to add PMD and Jacoco, those should also be introduced in separate PRs. That’s my two cents. |
sbglasius
left a comment
There was a problem hiding this comment.
This is an approval with a "Why?" and a caveat.
Why are there so many unrelated changes. It makes it impossible to get through all files.
The caveat is, that I have assumed, that all files in grails-data-hibernate7 are a plain copy of that in grails-data-hibernate5
Looking through each and every single file in this humongous PR would take more than the couple of hours that I have already spent on it.
There are none of my comments that requires code changes, they are more there out of frustration.
You can accept my approval if you feel it's valid.
| Class<?> transformerClass = getClass().getClassLoader().loadClass("org.grails.async.transform.internal.DefaultDelegateAsyncTransactionalMethodTransformer"); | ||
| return (DelegateAsyncTransactionalMethodTransformer) transformerClass.getDeclaredConstructor().newInstance(); | ||
| } catch (Throwable e) { | ||
| } catch (Exception ignored) { |
There was a problem hiding this comment.
One explanation is that it's bad coding style to catch Throwables. And ignored is an IntelliJ thing 🤔
| id 'org.apache.grails.buildsrc.sbom' | ||
| id 'org.apache.grails.gradle.grails-code-style' | ||
| id 'org.apache.grails.gradle.grails-code-analysis' | ||
| id 'org.apache.grails.gradle.grails-jacoco' |
There was a problem hiding this comment.
I'm commenting on this once: Why did this have to go into this PR. It's all noise making it almost impossible to review.
|
|
||
| import grails.persistence.support.PersistenceContextInterceptorExecutor | ||
| import grails.async.decorator.PromiseDecorator | ||
| import grails.persistence.support.PersistenceContextInterceptorExecutor |
There was a problem hiding this comment.
Why the reformat in this PR.
| import java.util.concurrent.atomic.AtomicBoolean | ||
| import java.util.function.Consumer | ||
|
|
||
| import groovy.transform.CompileStatic |
There was a problem hiding this comment.
Import order noise unrelated to this PR changes.
| import org.junit.runners.Suite | ||
| import org.junit.runner.RunWith | ||
| import grails.gorm.tests.* | ||
| import grails.gorm.specs.* |
| * under the License. | ||
| */ | ||
| // See http://logback.qos.ch/manual/groovy.html for details on configuration | ||
| def CONSOLE_LOG_PATTERN = '%d{HH:mm:ss.SSS} [%t] %highlight(%p) %cyan(\\(%logger{39}\\)) %m%n' |
There was a problem hiding this comment.
Is logback.groovy even supported?
|
|
||
| class MongoCascadeSpec extends GrailsDataTckSpec<GrailsDataMongoTckManager> { | ||
| class MongoCascadeSpec extends MongoDatastoreSpec { |
There was a problem hiding this comment.
Was a refactor of GrailsDataTckSpec<GrailsDataMongoTckManager> to MongoDatastoreSpec needed? If yes, ok, if no, then it's just another source of noise.
| import org.grails.datastore.mapping.query.Query | ||
| import org.slf4j.LoggerFactory |
|
|
||
| import org.apache.grails.data.testing.tck.base.GrailsDataTckSpec | ||
|
|
||
| abstract class MongoDatastoreSpec extends GrailsDataTckSpec<GrailsDataMongoTckManager> { |
There was a problem hiding this comment.
This refactor should have been done in a later PR. Adding to the size of the PR.
| void 'Test the list method returns a PagedResultList with pagination arguments'() { | ||
| given: 'A bunch of people' | ||
| createPeople() | ||
|
|
||
| when: 'A detached criteria instance is created and the list method used with the max parameter' | ||
| def criteria = new DetachedCriteria(Person) | ||
| criteria.with { | ||
| eq('lastName', 'Simpson') | ||
| eq 'lastName', 'Simpson' |
There was a problem hiding this comment.
This is an unneeded change for this PR. Removing parentheses should have been done in a clean-up PR.
creating this request by cloning the existing hibernate five modules so that we can easily review the hibernate seven changes between hibernate five and seven
Copy all source, test examples, BOMs, and build config from the
hibernate5 namespace to hibernate7 so that the real hibernate7 PR
can be reviewed as a true delta rather than a sea of new files.
Modules added:
Build infrastructure: