-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: move handling of total count and pagination to store [TECH-1661] #15482
Conversation
Update dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/tracker/export/OrderAndPaginationExporterTest.java chore: split fetching all TEs from fetching paginated TEs [TECH-1661] chore: split fetching all TEs from fetching paginated TEs [TECH-1661]
Codecov Report
@@ Coverage Diff @@
## master #15482 +/- ##
============================================
- Coverage 66.16% 66.15% -0.02%
+ Complexity 31193 31178 -15
============================================
Files 3487 3485 -2
Lines 129766 129745 -21
Branches 15137 15134 -3
============================================
- Hits 85858 85830 -28
- Misses 36822 36830 +8
+ Partials 7086 7085 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 12 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
...rc/main/java/org/hisp/dhis/webapi/controller/tracker/export/trackedentity/RequestParams.java
Dismissed
Show dismissed
Hide dismissed
...rc/main/java/org/hisp/dhis/webapi/controller/tracker/export/trackedentity/RequestParams.java
Dismissed
Show dismissed
Hide dismissed
...rc/main/java/org/hisp/dhis/webapi/controller/tracker/export/trackedentity/RequestParams.java
Dismissed
Show dismissed
Hide dismissed
...er/src/main/java/org/hisp/dhis/tracker/export/trackedentity/HibernateTrackedEntityStore.java
Dismissed
Show dismissed
Hide dismissed
...er/src/main/java/org/hisp/dhis/tracker/export/trackedentity/HibernateTrackedEntityStore.java
Fixed
Show resolved
Hide resolved
private Integer page; | ||
private Integer pageSize; | ||
private Boolean totalPages; | ||
private Boolean skipPaging; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PageRequestParams.getSkipPaging
static final String DEFAULT_FIELDS_PARAM = | ||
"relationship,relationshipType,createdAtClient,from[trackedEntity[trackedEntity],enrollment[enrollment],event[event]],to[trackedEntity[trackedEntity],enrollment[enrollment],event[event]]"; | ||
|
||
private Integer page; | ||
private Integer pageSize; | ||
private Boolean totalPages; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PageRequestParams.getTotalPages
static final String DEFAULT_FIELDS_PARAM = | ||
"relationship,relationshipType,createdAtClient,from[trackedEntity[trackedEntity],enrollment[enrollment],event[event]],to[trackedEntity[trackedEntity],enrollment[enrollment],event[event]]"; | ||
|
||
private Integer page; | ||
private Integer pageSize; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PageRequestParams.getPageSize
static final String DEFAULT_FIELDS_PARAM = | ||
"relationship,relationshipType,createdAtClient,from[trackedEntity[trackedEntity],enrollment[enrollment],event[event]],to[trackedEntity[trackedEntity],enrollment[enrollment],event[event]]"; | ||
|
||
private Integer page; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PageRequestParams.getPage
...er/src/main/java/org/hisp/dhis/tracker/export/trackedentity/HibernateTrackedEntityStore.java
Fixed
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! |
Having the logic of fetching pageSize + 1 tracked entities in the store and the removal of the extra enrollment in the service is error prone. This is now done transparently in the store.
Total count is expensive and should thus be discouraged. Do not expose this as part of the service as its not needed right now.
In this PR
Remove any pagination related fields and methods from TrackedEntityQueryParams as these are fully represented by the PageParams.
Remove lastPage concept as it is not exposed
Validate pagination params in the controller