Skip to content

410, 411 Add Collection Storage Driver use cases #431

Open
ekraffmiller wants to merge 3 commits intodevelopfrom
410-411-storage-drivers
Open

410, 411 Add Collection Storage Driver use cases #431
ekraffmiller wants to merge 3 commits intodevelopfrom
410-411-storage-drivers

Conversation

@ekraffmiller
Copy link
Contributor

@ekraffmiller ekraffmiller commented Mar 12, 2026

Add Collection storage driver use cases:

GetCollectionStorageDriver
SetCollectionStorageDriver
DeleteCollectionStorageDriver
GetAllowedCollectionStorageDrivers

What this PR does / why we need it:

These use cases are needed to set the CollectionStorage driver in Create Collection and Edit Collection forms in the frontend.

Which issue(s) this PR closes:

Related Dataverse PRs:

Special notes for your reviewer:

Need to update after the Dataverse PR has been merged

Suggestions on how to test this:

Review tests, try it out with curl commands.

@ekraffmiller ekraffmiller marked this pull request as ready for review March 16, 2026 19:26
Copilot AI review requested due to automatic review settings March 16, 2026 19:26
@ekraffmiller ekraffmiller added the GREI Re-arch GREI re-architecture-related label Mar 16, 2026
@ekraffmiller ekraffmiller added SPA.Q1.2026.8 Collections: select storage driver Original size: 3 FY26 Sprint 19 FY26 Sprint 19 (2026-03-11 - 2026-03-25) labels Mar 16, 2026
@ekraffmiller ekraffmiller moved this to Ready for Review ⏩ in IQSS Dataverse Project Mar 16, 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

Adds collection storage-driver capabilities (get/set/delete + list allowed drivers) to the client library, and consolidates the StorageDriver model under core for reuse across datasets/collections.

Changes:

  • Implemented new collection repository methods and corresponding use cases for storage-driver management.
  • Added unit + integration tests for the new endpoints and updated test helpers/environment to support them.
  • Moved/standardized StorageDriver to src/core and updated docs to reflect the new use cases.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/unit/datasets/GetDatasetStorageDriver.test.ts Updates StorageDriver import path to core.
test/unit/collections/SetCollectionStorageDriver.test.ts Adds unit tests for setting a collection storage driver.
test/unit/collections/GetCollectionStorageDriver.test.ts Adds unit tests for retrieving collection storage driver (direct/effective).
test/unit/collections/GetAllowedCollectionStorageDrivers.test.ts Adds unit tests for listing allowed collection storage drivers.
test/unit/collections/DeleteCollectionStorageDriver.test.ts Adds unit tests for clearing a collection storage driver.
test/unit/collections/CollectionsRepository.test.ts Adds unit coverage for new repository endpoints and payload/content-type behavior.
test/testHelpers/collections/collectionHelper.ts Updates helper endpoint for setting a collection storage driver.
test/integration/collections/CollectionsRepository.test.ts Adds end-to-end tests for collection storage driver operations and inheritance.
test/environment/.env Updates Dataverse image registry/tag used by the integration environment.
src/datasets/infra/repositories/DatasetsRepository.ts Switches StorageDriver import to core.
src/datasets/index.ts Re-exports StorageDriver from core.
src/datasets/domain/useCases/GetDatasetStorageDriver.ts Switches StorageDriver import to core.
src/datasets/domain/repositories/IDatasetsRepository.ts Switches StorageDriver import to core.
src/core/infra/repositories/ApiConstants.ts Adds text/plain content type constant for plain-text PUTs.
src/core/index.ts Exposes StorageDriver from the core entrypoint.
src/core/domain/models/StorageDriver.ts Changes type/label to optional fields.
src/collections/infra/repositories/CollectionsRepository.ts Adds storage-driver API methods (get/set/delete + allowed list).
src/collections/index.ts Wires and exports new use cases + exports related types.
src/collections/domain/useCases/SetCollectionStorageDriver.ts New use case for assigning a storage driver by label.
src/collections/domain/useCases/GetCollectionStorageDriver.ts New use case for retrieving assigned/effective storage driver.
src/collections/domain/useCases/GetAllowedCollectionStorageDrivers.ts New use case for listing allowed storage drivers.
src/collections/domain/useCases/DeleteCollectionStorageDriver.ts New use case for clearing assigned storage driver.
src/collections/domain/repositories/ICollectionsRepository.ts Extends repository interface with new storage-driver methods/types.
src/collections/domain/models/AllowedStorageDrivers.ts Introduces AllowedStorageDrivers type alias.
docs/useCases.md Documents new collection storage-driver use cases and updates dataset storage-driver link.
Comments suppressed due to low confidence (1)

src/core/domain/models/StorageDriver.ts:4

  • Making type and label optional weakens the contract and can hide API regressions; existing integration tests for dataset storage drivers assert these properties are present. If the API can truly omit them, consider modeling that explicitly in the relevant endpoint transformer and updating docs/tests; otherwise keep them required on StorageDriver.

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

You can also share your feedback on Copilot code review. Take the survey.

DATAVERSE_IMAGE_REGISTRY=docker.io
DATAVERSE_IMAGE_TAG=unstable
DATAVERSE_IMAGE_REGISTRY=ghcr.io
DATAVERSE_IMAGE_TAG=storage-driver-endpoint
@ChengShi-1 ChengShi-1 self-assigned this Mar 17, 2026
@ChengShi-1 ChengShi-1 moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Mar 17, 2026
Copy link
Contributor

@ChengShi-1 ChengShi-1 left a comment

Choose a reason for hiding this comment

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

It's good! Could you update the changelog as well?

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

Labels

FY26 Sprint 19 FY26 Sprint 19 (2026-03-11 - 2026-03-25) GREI Re-arch GREI re-architecture-related Original size: 3 SPA.Q1.2026.8 Collections: select storage driver

Projects

Status: In Review 🔎

Development

Successfully merging this pull request may close these issues.

Create Use Case for Get Available Storage Drivers Create use case for Get Collection Storage Driver

3 participants