Skip to content

Conversation

@ChengShi-1
Copy link
Contributor

What this PR does / why we need it:

Add pagination query parameters to Dataset&File Version Summaries use case

Which issue(s) this PR closes:

Related Dataverse PRs:

Special notes for your reviewer:

Suggestions on how to test this:

Is there a release notes or changelog update needed for this change?:

yes

Additional documentation:

@ChengShi-1 ChengShi-1 self-assigned this Oct 23, 2025
@ChengShi-1 ChengShi-1 moved this to In Progress 💻 in IQSS Dataverse Project Oct 23, 2025
@github-actions github-actions bot added FY26 Sprint 9 FY26 Sprint 9 (2025-10-22 - 2025-11-05) GREI Re-arch GREI re-architecture-related SPA.Q3.2025 labels Oct 23, 2025
@ChengShi-1 ChengShi-1 marked this pull request as ready for review October 27, 2025 14:38
Copilot AI review requested due to automatic review settings October 27, 2025 14:38
@ChengShi-1 ChengShi-1 removed their assignment Oct 27, 2025
@ChengShi-1 ChengShi-1 moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Oct 27, 2025
@ChengShi-1 ChengShi-1 added Size: 3 A percentage of a sprint. 2.1 hours. Original size: 3 labels Oct 27, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds pagination support to the Dataset and File Version Summaries use cases by introducing optional limit and offset query parameters. This allows clients to retrieve version summaries in paginated chunks rather than loading all versions at once.

Key Changes:

  • Added optional limit and offset parameters to GetDatasetVersionsSummaries and GetFileVersionSummaries use cases and their corresponding repository methods
  • Updated documentation to reflect the new pagination parameters
  • Added comprehensive integration tests to verify pagination functionality

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/datasets/domain/useCases/GetDatasetVersionsSummaries.ts Added optional limit and offset parameters to the execute method
src/datasets/domain/repositories/IDatasetsRepository.ts Updated interface signature to include pagination parameters
src/datasets/infra/repositories/DatasetsRepository.ts Implemented query parameter building and passing to API endpoint
src/files/domain/useCases/GetFileVersionSummaries.ts Added optional limit and offset parameters to the execute method
src/files/domain/repositories/IFilesRepository.ts Updated interface signature to include pagination parameters
src/files/infra/repositories/FilesRepository.ts Implemented query parameter building and passing to API endpoint
test/unit/datasets/GetDatasetVersionsSummaries.test.ts Updated test to verify undefined pagination parameters are passed correctly
test/integration/datasets/DatasetsRepository.test.ts Added comprehensive pagination test with 22 versions across multiple pages
test/integration/files/FilesRepository.test.ts Added comprehensive pagination test and updated existing test expectations
docs/useCases.md Updated documentation to describe the new pagination parameters

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@g-saracca g-saracca self-assigned this Oct 29, 2025
@g-saracca g-saracca moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Oct 29, 2025
Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment about how to handle query params and one question, are we returning the total count from these use cases, similar how we do for the GetCollectionItems?
You will need the total count to know when to keep asking or when you reach the final page.

const queryParams: { limit?: string; offset?: string } = {
limit: limit?.toString(),
offset: offset?.toString()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can follow same approach as here for limit and offset, using URLSearchParams

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the api returns totalCount but I didn't add it to use case. I modified the code to apply totalCount, please review again. Thank you! @g-saracca

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Oct 29, 2025
@g-saracca g-saracca removed their assignment Oct 29, 2025
@g-saracca
Copy link
Contributor

@ChengShi-1 approved, note that this is a breaking change, you will need a frontend change to avoid things breaking 👍🏼

@ofahimIQSS
Copy link
Contributor

awesome - merging!

@ofahimIQSS ofahimIQSS merged commit 421af81 into develop Oct 31, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Ready for QA ⏩ to Merged 🚀 in IQSS Dataverse Project Oct 31, 2025
@ofahimIQSS ofahimIQSS deleted the 394-add-pagination-query-parameters-to-datasetfile-version-summaries-use-case branch October 31, 2025 19:10
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 9 FY26 Sprint 9 (2025-10-22 - 2025-11-05) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA.Q3.2025

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Add pagination query parameters to Dataset&File Version Summaries use case

4 participants