Restore RX GORM compatibility with current core APIs - #16268
Restore RX GORM compatibility with current core APIs#16268jamesfredley wants to merge 3 commits into
Conversation
Remove the accidental criteria list overload that conflicts with the reactive return type, and update RX tenant and count finder integration for current datastore APIs. Assisted-by: opencode:gpt-5.6-sol codegraph
There was a problem hiding this comment.
Pull request overview
This PR restores RxGORM compatibility with the current grails-datamapping-core APIs by removing an accidental criteria overload that changed reactive method dispatch, reintroducing per-RxDatastoreClient tenant bindings (with correct nesting/cleanup and a fail-closed fallback to the core tenant holder), and updating the Rx CountByFinder implementation/tests to use the current dynamic-finder query construction behavior while ensuring count projections execute via the reactive query surface.
Changes:
- Remove the
AbstractCriteriaBuilder.list(Closure)overload so reactive criteria APIs don’t resolve to a blocking/List-returning signature. - Rework Rx
Tenantsto track tenant bindings perRxDatastoreClient, restore nested scopes correctly, and fall back toCurrentTenantHolder(fail-closed when ambiguous). - Port Rx
CountByFinderto the currentDynamicFinderquery-building flow and update tests to validate OR parsing and count projection behavior via public invocation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| grails-datamapping-rx/src/test/groovy/org/grails/gorm/rx/finders/CountByFinderSpec.groovy | Updates tests to exercise the public countBy* invocation path, OR parsing, and reactive count projections. |
| grails-datamapping-rx/src/test/groovy/org/grails/gorm/rx/events/MultiTenantEventListenerSpec.groovy | Switches tests to bind Rx tenant context via grails.gorm.rx.multitenancy.Tenants and datastore-client typing. |
| grails-datamapping-rx/src/test/groovy/grails/gorm/rx/multitenancy/TenantsSpec.groovy | Adds coverage for fallback-to-core tenant binding, nested scope restoration, exception cleanup, and per-client isolation. |
| grails-datamapping-rx/src/main/groovy/org/grails/gorm/rx/finders/CountByFinder.groovy | Aligns Rx count finder query construction with the current dynamic-finder API and returns a reactive single-result. |
| grails-datamapping-rx/src/main/groovy/grails/gorm/rx/multitenancy/Tenants.groovy | Implements per-client Rx tenant binding with nested-scope cleanup and core-holder fallback behavior. |
| grails-datamapping-core/src/test/groovy/grails/gorm/CriteriaBuilderSpec.groovy | Tightens the core criteria contract expectation to ensure createCriteria().list {} returns a List. |
| grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/query/criteria/AbstractCriteriaBuilder.java | Removes the conflicting list(Closure) overload from the shared criteria base class. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 8.1.x #16268 +/- ##
===================================================
+ Coverage 29.8834% 55.1619% +25.2786%
- Complexity 509 21179 +20670
===================================================
Files 79 2140 +2061
Lines 4715 102433 +97718
Branches 814 18126 +17312
===================================================
+ Hits 1409 56504 +55095
- Misses 3063 38074 +35011
- Partials 243 7855 +7612
🚀 New features to boost your workflow:
|
|
@borinquenkid I will fix those forge failures separately. We moved forge from Google Cloud to AWS yesterday. |
Cherry-picked from 8.0.x commit 6703374 (#16274) so 8.1.x Forge CI can create startShadowScripts on Gradle 9.6.0. Shadow 8.3.6's ShadowApplicationPlugin configures the startShadowScripts task through conventionMapping.map('mainClassName'). Gradle 9 removed the deprecated CreateStartScripts.mainClassName in favour of the mainClass Property, so the task can no longer be created and the Forge build fails at configuration time: Could not determine the dependencies of task ':grails-forge-web-netty:shadowDistTar'. > Could not create task ':grails-forge-web-netty:startShadowScripts'. > You can't map a property that does not exist: propertyName=mainClassName Shadow 8.3.7 backported Gradle 9 support and 8.3.11 is the latest 8.3.x; the 8.x line is maintenance-only upstream. Generated applications remain on Shadow 9.2.2. Assisted-by: Cursor Grok 4.6
|
PR #16268 was already up to date with Cherry-picked the already-merged 8.0.x fix from #16274 ( This does not include the rest of the 8.0.x line; that remains a separate 8.0.x -> 8.1.x merge. |
🔎 No tests executed 🔎🏷️ Commit: 73befd4 Learn more about TestLens at testlens.app/docs. |
|
@jamesfredley there are no changes in this PR to review. Did your merge remove them? |
Summary
List-returningAbstractCriteriaBuilder.list(Closure)overload that conflicts with the established reactive criteria API.RxDatastoreClienttenant bindings with nested-scope cleanup, client isolation, and fail-closed fallback to the core tenant holder.CountByFinderto the current dynamic-finder query API and verify count projections through public finder invocation.Validation
:grails-datamapping-core:testand:grails-datamapping-rx:testsuites.:grails-datamapping-rx:codeStyleand repository-wide CodeNarc, Checkstyle, PMD, and SpotBugs aggregation with no violations.CriteriaBuilder.list(Closure)emits the expected list.Root-wide test note
The full repository aggregate run reached 3,570 integration tests and reported three unrelated example failures: an asynchronous SiteMesh request-recycling failure, a missing Docker environment for one Hibernate/Geb example, and a Selenium page-load timeout in the Spring Security ACL example. It also encountered the existing
grails-spring-security-ui:copyTemplatesduplicate-entry failure. All affected core and RX suites are green.@borinquenkid, please review this compatibility repair. It should be merged forward into
9.0.xafter landing on8.1.x.