You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "borinquenkid (via GitHub)" <gi...@apache.org> on 2026/08/16 01:31:55 UTC
[PR] Add test coverage and fix real bugs in grails-datamapping-core's services package [grails-core]
borinquenkid opened a new pull request, #16156:
URL: https://github.com/apache/grails-core/pull/16156
## Summary
- Adds unit test coverage for `DefaultTenantService` and `DefaultTransactionService` (`org.grails.datastore.gorm.services`), both previously at 0% coverage. Pure Spock-mock specs, no live datastore needed.
- Adds coverage for a batch of under-tested `@Service` AST-transform implementer classes (`UpdateOneImplementer`, `DeleteWhereImplementer`, `FindOneInterfaceProjectionWhereImplementer`, `FindAllPropertyProjectionImplementer`, `FindOnePropertyProjectionImplementer`, the `findById(id)` shortcut in `FindOneByImplementer`, and the `AbstractWriteOperationImplementer.enhance()` path for abstract-class services with pre-existing concrete write methods), all via the existing `GroovyClassLoader().parseClass(...)` + `@Implemented(by=...)` structural-testing convention already used by `ServiceTransformSpec`/`WhereConnectionRoutingSpec`.
- **Real bug fix**: `AbstractSaveImplementer`'s invalid-argument error path referenced `newMethodNode.declaringClass.module` (null on the synthesized implementation method), crashing the compiler with a `NullPointerException`/`GroovyBugError` instead of reporting a clean compile error. Fixed to use `abstractMethodNode.declaringClass.module.context`, matching the pattern used elsewhere in this package (e.g. `FindAllByImplementer`).
- A handful of IntelliJ-inspection cleanups surfaced while reviewing these classes:
- Suppressed (not "fixed") warnings on `getDetachedCriteriaType`/`lookupById`/`findMethodToInvoke`/`getFindMethodToInvoke` where the flagged parameter/method is a legitimate `protected` polymorphic extension point on a class with real subclasses — changing the signature or making it `static` would silently break overriding.
- Removed genuinely dead code: `bindParametersAndSave`'s unused `newMethodNode` parameter (a side effect of the `AbstractSaveImplementer` fix above), and three unused helper methods on `AbstractServiceImplementer` (`transactionalDatastore`, `transactionService`, `findInstanceApiForConnectionId`) with zero call sites anywhere in the repo.
- Deduplicated a 13-line interface-projection property-compatibility check that was copy-pasted between `InterfaceProjectionBuilder` and `IterableInterfaceProjectionBuilder` into a shared `hasCompatibleProperties(...)` method.
- Replaced an array range-slice (`parameters[1..-1] as Parameter[]`) with `Arrays.copyOfRange(...)` in `UpdateOneImplementer`, since IntelliJ's stricter `@CompileStatic` checker can't resolve the `getAt` overload for it even though `groovyc` compiles it fine.
## Test plan
- [x] `./gradlew :grails-datamapping-core:test` — full module suite passes
- [x] `./gradlew :grails-datamapping-core:codeStyle` — 0 Checkstyle/CodeNarc violations
- [x] `./gradlew :grails-datamapping-rx:compileGroovy` — sibling module unaffected by `AbstractServiceImplementer` cleanup
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add test coverage and fix real bugs in grails-datamapping-core's services package [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16156:
URL: https://github.com/apache/grails-core/pull/16156#issuecomment-5305761306
## ✅ All tests passed ✅
🏷️ Commit: 984fe361d70cf627a4e5914c5d35961043fb9184
▶️ Tests: 63264 executed
⚪️ Checks: 77/77 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add test coverage and fix real bugs in grails-datamapping-core's services package [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #16156:
URL: https://github.com/apache/grails-core/pull/16156#issuecomment-5378188497
@borinquenkid if this is a real bug, why aren't we targeting 8.0.x?
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add test coverage and fix real bugs in grails-datamapping-core's services package [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16156:
URL: https://github.com/apache/grails-core/pull/16156#issuecomment-5387644476
## ✅ All tests passed ✅
🏷️ Commit: 8e1af3413f61662d994ab232456d0161abece2a7
▶️ Tests: 49737 executed
⚪️ Checks: 57/57 completed
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add test coverage and fix real bugs in grails-datamapping-core's services package [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #16156:
URL: https://github.com/apache/grails-core/pull/16156#issuecomment-5520155413
I had suggested 8.0.x for this, but I'm ok merging all the way back to 7.0.x
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add test coverage and fix real bugs in grails-datamapping-core's services package [grails-core]
Posted by "borinquenkid (via GitHub)" <gi...@apache.org>.
borinquenkid commented on PR #16156:
URL: https://github.com/apache/grails-core/pull/16156#issuecomment-5387193535
Good catch — the `newMethodNode.declaringClass.module` NPE bug in `AbstractSaveImplementer` is present identically on 7.0.x, 8.0.x, and 8.1.x, so it's not new to this branch. Retargeted this PR to 7.0.x so the fix (and the new test coverage) flows forward through the normal branch merges instead of being scoped only to 8.1.x.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add test coverage and fix real bugs in grails-datamapping-core's services package [grails-core]
Posted by "borinquenkid (via GitHub)" <gi...@apache.org>.
borinquenkid merged PR #16156:
URL: https://github.com/apache/grails-core/pull/16156
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add test coverage and fix real bugs in grails-datamapping-core's services package [grails-core]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #16156:
URL: https://github.com/apache/grails-core/pull/16156#issuecomment-5305316798
## [Codecov](https://app.codecov.io/gh/apache/grails-core/pull/16156?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `75.00000%` with `3 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 53.2582%. Comparing base ([`df424da`](https://app.codecov.io/gh/apache/grails-core/commit/df424da847851e0c366a5ffe0c259f1ba22dfc5b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`4f354f4`](https://app.codecov.io/gh/apache/grails-core/commit/4f354f4946b626f79b17bb8f50eac3fdea77c1eb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16156?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...ces/implementers/AbstractServiceImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FAbstractServiceImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0Fic3RyYWN0U2VydmljZUltcGxlbWVudGVyLmdyb292eQ==) | 66.6667% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ervices/implementers/DeleteWhereImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FDeleteWhereImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0RlbGV0ZVdoZXJlSW1wbGVtZW50ZXIuZ3Jvb3Z5) | 0.0000% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../services/implementers/FindAllByImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FFindAllByImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0ZpbmRBbGxCeUltcGxlbWVudGVyLmdyb292eQ==) | 0.0000% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## 8.1.x #16156 +/- ##
==================================================
+ Coverage 53.1444% 53.2582% +0.1138%
- Complexity 19371 19421 +50
==================================================
Files 2080 2080
Lines 99000 98995 -5
Branches 17363 17362 -1
==================================================
+ Hits 52613 52723 +110
+ Misses 38828 38722 -106
+ Partials 7559 7550 -9
```
| [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16156?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [.../AbstractDetachedCriteriaServiceImplementor.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FAbstractDetachedCriteriaServiceImplementor.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0Fic3RyYWN0RGV0YWNoZWRDcml0ZXJpYVNlcnZpY2VJbXBsZW1lbnRvci5ncm9vdnk=) | `83.3333% <ø> (ø)` | |
| [...rvices/implementers/AbstractSaveImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FAbstractSaveImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0Fic3RyYWN0U2F2ZUltcGxlbWVudGVyLmdyb292eQ==) | `90.9091% <100.0000%> (+40.9091%)` | :arrow_up: |
| [...vices/implementers/AbstractWhereImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FAbstractWhereImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0Fic3RyYWN0V2hlcmVJbXBsZW1lbnRlci5ncm9vdnk=) | `85.7143% <ø> (+5.7143%)` | :arrow_up: |
| [...orm/services/implementers/DeleteImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FDeleteImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0RlbGV0ZUltcGxlbWVudGVyLmdyb292eQ==) | `79.3103% <100.0000%> (ø)` | |
| [...rm/services/implementers/FindOneImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FFindOneImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0ZpbmRPbmVJbXBsZW1lbnRlci5ncm9vdnk=) | `85.7143% <ø> (ø)` | |
| [.../implementers/FindOneStringQueryImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FFindOneStringQueryImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0ZpbmRPbmVTdHJpbmdRdWVyeUltcGxlbWVudGVyLmdyb292eQ==) | `91.3044% <ø> (ø)` | |
| [...ces/implementers/InterfaceProjectionBuilder.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FInterfaceProjectionBuilder.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0ludGVyZmFjZVByb2plY3Rpb25CdWlsZGVyLmdyb292eQ==) | `50.0000% <ø> (ø)` | |
| [.../gorm/services/implementers/SaveImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FSaveImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL1NhdmVJbXBsZW1lbnRlci5ncm9vdnk=) | `95.4546% <100.0000%> (ø)` | |
| [.../services/implementers/UpdateOneImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FUpdateOneImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL1VwZGF0ZU9uZUltcGxlbWVudGVyLmdyb292eQ==) | `100.0000% <100.0000%> (+76.1905%)` | :arrow_up: |
| [...ces/implementers/AbstractServiceImplementer.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Fservices%2Fimplementers%2FAbstractServiceImplementer.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vc2VydmljZXMvaW1wbGVtZW50ZXJzL0Fic3RyYWN0U2VydmljZUltcGxlbWVudGVyLmdyb292eQ==) | `83.3333% <66.6667%> (+11.9048%)` | :arrow_up: |
| ... and [2 more](https://app.codecov.io/gh/apache/grails-core/pull/16156?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
... and [9 files with indirect coverage changes](https://app.codecov.io/gh/apache/grails-core/pull/16156/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org