Skip to content

Dataset Upload Limits Use Case#421

Open
ChengShi-1 wants to merge 2 commits intodevelopfrom
409-create-use-case-for-getting-storage-quota-on-dataset
Open

Dataset Upload Limits Use Case#421
ChengShi-1 wants to merge 2 commits intodevelopfrom
409-create-use-case-for-getting-storage-quota-on-dataset

Conversation

@ChengShi-1
Copy link
Contributor

What this PR does / why we need it:

Create a use case for getting the storage quota for a dataset

This will be used for display in the Upload File page in the frontend: IQSS/dataverse-frontend#897

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?:

Additional documentation:

@ChengShi-1 ChengShi-1 linked an issue Feb 5, 2026 that may be closed by this pull request
@github-actions github-actions bot added GREI Re-arch GREI re-architecture-related Project: HDV SPA Rollout labels Feb 5, 2026
@ChengShi-1 ChengShi-1 added Size: 3 A percentage of a sprint. 2.1 hours. FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) labels Feb 5, 2026
@ChengShi-1 ChengShi-1 marked this pull request as ready for review February 5, 2026 14:35
Copilot AI review requested due to automatic review settings February 5, 2026 14:35
@ChengShi-1 ChengShi-1 moved this to Ready for Review ⏩ in IQSS Dataverse Project Feb 5, 2026
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 implements a new use case for retrieving dataset upload limits (storage quota and file count restrictions) from the Dataverse backend API. This feature will enable the frontend to display available upload capacity to users on the Upload File page.

Changes:

  • Added DatasetUploadLimits model with optional numberOfFilesRemaining and storageQuotaRemaining properties
  • Implemented GetDatasetUploadLimits use case and getDatasetUploadLimits repository method to support the GET /datasets/{id}/uploadlimits endpoint
  • Added comprehensive unit and integration tests, including test helper functions for setting storage quotas via API

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/models/DatasetUploadLimits.ts Defines the model for upload limits with optional storage quota and file count properties
src/datasets/domain/useCases/GetDatasetUploadLimits.ts Implements the use case for retrieving dataset upload limits
src/datasets/domain/repositories/IDatasetsRepository.ts Adds interface method for getting upload limits
src/datasets/infra/repositories/DatasetsRepository.ts Implements the repository method to call the backend API endpoint
src/datasets/index.ts Exports the new use case and model for public API
test/unit/datasets/GetDatasetUploadLimits.test.ts Unit tests for the use case with success and error scenarios
test/integration/datasets/DatasetsRepository.test.ts Integration tests verifying API behavior with and without storage quotas
test/testHelpers/datasets/datasetHelper.ts Helper functions for configuring storage quotas in test environment
docs/useCases.md Documentation and usage examples for the new use case
CHANGELOG.md Documents the new feature addition

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

expect(uploadLimits).toEqual({})
})

test('should return upload limits for dataset (if DatasetStorageSize is set)', async () => {
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

There is an extra space in the test name. It should be "should return upload limits for dataset (if DatasetStorageSize is set)" with only one space after "dataset".

Suggested change
test('should return upload limits for dataset (if DatasetStorageSize is set)', async () => {
test('should return upload limits for dataset (if DatasetStorageSize is set)', async () => {

Copilot uses AI. Check for mistakes.
Comment on lines 13 to 16
- Datasets: Added `updateDatasetLicense` use case and repository method to support Dataverse endpoint `PUT /datasets/{id}/license`, for updating dataset license or custom terms
- Datasets: Added `getDatasetUploadLimits` use case and repository method to support Dataverse endpoint `GET /datasets/{id}/uploadlimits`, for retrieving remaining storage upload quotas, if present.
- New Use Case: [Get Collections For Linking Use Case](./docs/useCases.md#get-collections-for-linking).
- New Use Case: [Create a Template](./docs/useCases.md#create-a-template) under Templates.
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

There is a duplicate entry for updateDatasetLicense in the CHANGELOG. Lines 11 and 13 contain nearly identical entries. Please remove one of them.

Suggested change
- Datasets: Added `updateDatasetLicense` use case and repository method to support Dataverse endpoint `PUT /datasets/{id}/license`, for updating dataset license or custom terms
- Datasets: Added `getDatasetUploadLimits` use case and repository method to support Dataverse endpoint `GET /datasets/{id}/uploadlimits`, for retrieving remaining storage upload quotas, if present.
- New Use Case: [Get Collections For Linking Use Case](./docs/useCases.md#get-collections-for-linking).
- New Use Case: [Create a Template](./docs/useCases.md#create-a-template) under Templates.
- Datasets: Added `getDatasetUploadLimits` use case and repository method to support Dataverse endpoint `GET /datasets/{id}/uploadlimits`, for retrieving remaining storage upload quotas, if present.
- New Use Case: [Get Collections For Linking Use Case](./docs/useCases.md#get-collections-for-linking).
- New Use Case: [Create a Template](./docs/useCases.md#create-a-template) under Templates.
- New Use Case: [Create a Template](./docs/useCases.md#create-a-template) under Templates.

Copilot uses AI. Check for mistakes.
@ekraffmiller ekraffmiller self-assigned this Feb 5, 2026
@ekraffmiller ekraffmiller moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Feb 5, 2026
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

This looks good to me! just have to make the small formatting/doc changes highlighted by copilot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) GREI Re-arch GREI re-architecture-related Project: HDV SPA Rollout Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: In Review 🔎

Development

Successfully merging this pull request may close these issues.

Create use case for getting storage quota on dataset

2 participants