UoE/Return all rows in lower-level usage reports (#807) - #37
Merged
milanmajchrak merged 3 commits intoJul 20, 2026
Conversation
Lower-level statistics tables (File visits, Top countries/cities, visits per month) were starved by backend caps, so the UI's client-side pagination had nothing to page through. - new usage-statistics.topDownloadsLimit (bitstream rows were hardcoded to 10); topCountriesLimit/topCitiesLimit defaults 100 -> -1; non-positive maps to Integer.MAX_VALUE because SolrLogger treats only -1 as "skip facet limit" and Solr then caps at facet.limit=100 - widen startDateInterval -6 -> -60 so the month report exposes 5 years of browsable history - month report DSO axis max 10 -> -1: takes the direct date-range facet path, which zero-fills months even when the statistics core has no matching docs; also fixes the order-dependent usageReportsSearch_Collection_NotVisited IT - IT month helper now derives the window from config; new ITs for unlimited/capped downloads, configurable window, and unlimited country/city limits Refs dataquest-dev/dspace-customers#807 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the statistics usage-report backend to stop prematurely capping result rows, so the existing client-side pagination can page through complete datasets (items, bitstreams, countries/cities, and month windows).
Changes:
- Adds configurable “unlimited” row limits (non-positive ⇒ effectively unlimited) for downloads/country/city reports and refactors limit-handling into a shared helper.
- Expands the default “Total visits per month” window to 5 years and adjusts dataset generation to ensure month buckets are returned/zero-filled even when the statistics core is empty.
- Extends integration tests to cover unlimited vs capped behavior and makes month expectations derive from configuration.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
dspace/config/modules/usage-statistics.cfg |
Adds/updates config defaults to remove hard caps (downloads/countries/cities) and widens the month window. |
dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/UsageReportUtils.java |
Implements configurable limits (non-positive ⇒ “no limit”) and adjusts month report generation behavior. |
dspace-server-webapp/src/test/java/org/dspace/app/rest/StatisticsRestRepositoryIT.java |
Adds IT coverage for new limit semantics and derives month expectations from config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Emit month points most-recent-first so the current month lands on the first pagination page and users page backwards through history. Refs dataquest-dev/dspace-customers#807 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address Copilot review on PR #37. - wrap the four new tests that set topDownloadsLimit / topCountriesLimit / topCitiesLimit in try/finally so the values are restored; config is not reset between ITs and leaking them can make later tests order-dependent - rename getListOfVisitsPerMonthsPoints param viewsLastMonth -> viewsCurrentMonth (it applies to the current month, i == 0) Refs dataquest-dev/dspace-customers#807 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
milanmajchrak
merged commit Jul 20, 2026
80b0319
into
datashare-UoEMainLibrary-dspace-8_x
13 checks passed
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.
Summary
Resolves the backend half of dataquest-dev/dspace-customers#807: community/collection/item statistics tables rendered pagination (from DSpace#726) but had nothing to page — the backend capped the rows before the UI ever saw them. This PR returns all rows so the existing client-side pagination works on every table.
Changes
usage-statistics.topDownloadsLimit = -1(non-positive = all rows).100 → -1; sharedgetConfiguredLimit()maps non-positive toInteger.MAX_VALUE(SolrLogger treats only-1as "skip facet limit", which falls back to Solr's facet.limit=100).startDateInterval -6 → -60(5 years of browsable months) and DSO-axismax 10 → -1so the report takes the direct date-range facet path and zero-fills empty months even on an empty statistics core (also fixes an order-dependent IT).Connected PRs
Notes
StatisticsRestRepositoryITclass green locally: 50/50 tests.After fix:
🤖 Generated with Claude Code