Enhance Pagination Logic for Get All Submodels and Submodel Descriptors - #207
Open
mm-kgi wants to merge 34 commits into
Open
Enhance Pagination Logic for Get All Submodels and Submodel Descriptors#207mm-kgi wants to merge 34 commits into
mm-kgi wants to merge 34 commits into
Conversation
…pecific request keys
…hell descriptors with template mapping support
…th user-context aware caching and automated error mapping
…l descriptors with parallel processing
… in parallel execution
…ext aware key generation
…ion support - Updated SubmodelRepositoryService to implement pagination for submodel retrieval, including cursor handling. - Introduced SubmodelPageCursor to manage state across paginated requests. - Modified IPluginDataHandler and IPluginDataProvider interfaces to include pagination parameters. - Adjusted PluginDataHandler and PluginDataProvider implementations to support new pagination logic. - Enhanced unit tests for SubmodelRepositoryService to cover new pagination scenarios. - Added new tests for SubmodelPageCursor to ensure correct encoding and decoding behavior. - Updated existing tests in PluginDataHandler and PluginDataProvider to accommodate changes in method signatures.
… the two-field composite cursor design
… pagination support" This reverts commit 77a54fb.
…ion support Updated SubmodelRepositoryService to implement pagination for submodel retrieval, including cursor handling. Introduced SubmodelPageCursor to manage state across paginated requests. Modified IPluginDataHandler and IPluginDataProvider interfaces to include pagination parameters. Adjusted PluginDataHandler and PluginDataProvider implementations to support new pagination logic. Enhanced unit tests for SubmodelRepositoryService to cover new pagination scenarios. Added new tests for SubmodelPageCursor to ensure correct encoding and decoding behavior. Updated existing tests in PluginDataHandler and PluginDataProvider to accommodate changes in method signatures.
… SubmodelRepositoryService
Refactored `SubmodelDescriptorService` to introduce a two-field composite cursor pagination algorithm for efficient data retrieval. Updated `GetAllSubmodelDescriptorsAsync` to use the new pagination logic and include cursor metadata. Added helper methods `CollectSubmodelDescriptorPageAsync`, `ProcessShellBatch`, and `GetSubmodelIdsForShell` to support the new pagination mechanism. Introduced `PaginationState` and `SubmodelDescriptorPageResult` to manage pagination state. Updated test cases in `SubmodelDescriptorServiceTests` to validate the new pagination logic, including a new test method `GetAllSubmodelDescriptorsAsync_ResumesCorrectly_WithTwoFieldCompositeCursor`. Refactored `CreateShell` to support customizable test data. Removed the obsolete `ExtractDistinctSubmodelIds` method and added necessary `using` directives for additional namespaces.
…ce with pagination and associated test data fixtures
…ng semantic and shell descriptor data
… for improved data handling
…etFilteredMetadataAsync
… and improve null handling in related tests
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Test & Coverage ReportTest Results Summary
Code CoverageUnit Tests Coverage
Minimum allowed line rate is Module Tests Coverage
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Overview
This PR enhances the pagination flow for the following endpoints:
GET /submodelsGET /submodel-descriptorsThe current implementation retrieves all Shell metadata from the Plugin, generates all Submodels/Submodel Descriptors, and only then applies pagination. This can result in unnecessary metadata retrieval and Submodel generation for large datasets.
This change introduces an improved pagination flow that performs pagination earlier in the processing pipeline while preserving the existing logical ordering and ensuring that no Submodels are skipped or duplicated.
Endpoints Covered
The same pagination approach is applied consistently to:
GET /submodelsGET /submodel-descriptorsThis ensures both endpoints follow the same cursor and ordering semantics.
Edge Cases
The implementation considers:
Validation
The implementation should be validated against scenarios including:
Summary
This PR improves pagination by moving pagination closer to the metadata retrieval stage while retaining Submodel-level pagination semantics.
The solution ensures that:
submodelIdandaasIdcursor handling is supported./submodelsand/submodel-descriptorsfollow consistent pagination behavior.