Removed eager fetch in list - #846
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change initializes lazily loaded document case tags within transactional retrieval and search methods, adds REST integration coverage for document and search responses, and changes the entity mapping to batched lazy loading. OpenSearch reindexing now converts entities within read-only transactions and advances using the last fetched row. Release notes document page-by-page loading for case lists and searches. 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Will create a test environment. This comment will be updated once it is available. This usually takes a few minutes.
|
|
Integration test gives an error |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
backend/case/src/test/java/com/ritense/document/web/rest/JsonSchemaDocumentCaseTagsSerializationIntegrationTest.java (1)
155-183: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the two document-list paths as well.
This regression test exercises single-document GET and search, but not
getAllByDocumentDefinitionNameorgetAll—the two list methods changed inJsonSchemaDocumentService. Add list-response coverage here, or confirm equivalent existing tests cover lazycaseTagsserialization for both methods.backend/case-opensearch/src/main/kotlin/com/ritense/document/opensearch/service/DocumentOpenSearchReindexService.kt (2)
109-113: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUpdate the stale "short transaction" doc comment.
The class-level comment on
reindex(Lines 109-113) still describes each page as read in a "short read-only transaction," but conversion now happens inside that same transaction, including batch-lazy-loading ofcaseTagsfor every document in the batch. This can meaningfully extend how long the transaction (and its DB snapshot/connection) is held, especially for large page sizes. Worth updating the doc to reflect the new duration characteristics, and considering whether page size needs re-tuning now that conversion work is inside the transaction boundary.Also applies to: 125-155
129-149: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winAdd coverage for partial-batch conversion failures.
DocumentOpenSearchReindexServiceTest.ktonly covers lock acquisition/cancellation; add a case where a batch converter throws partway through so the cursor advances past failed documents and the skipped count is recorded.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a58300b7-5b26-4cea-a8f4-335c8e7c7233
📒 Files selected for processing (6)
backend/case-opensearch/src/main/kotlin/com/ritense/document/opensearch/service/DocumentOpenSearchReindexService.ktbackend/case/src/main/java/com/ritense/document/domain/impl/JsonSchemaDocument.javabackend/case/src/main/java/com/ritense/document/service/impl/JsonSchemaDocumentSearchService.javabackend/case/src/main/java/com/ritense/document/service/impl/JsonSchemaDocumentService.javabackend/case/src/test/java/com/ritense/document/web/rest/JsonSchemaDocumentCaseTagsSerializationIntegrationTest.javadocumentation/release-notes/13.x.x/13.38.0/README.md
Fixes: generiekzaakafhandelcomponent/gzac-issues#823