410, 411 Add Collection Storage Driver use cases #431
410, 411 Add Collection Storage Driver use cases #431ekraffmiller wants to merge 7 commits intodevelopfrom
Conversation
…to use shared StorageDriver model.
There was a problem hiding this comment.
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
StorageDrivertosrc/coreand 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
typeandlabeloptional 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 onStorageDriver.
💡 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
left a comment
There was a problem hiding this comment.
It's good! Could you update the changelog as well?
|
Thanks @ChengShi-1 , I updated the Changelog and also reorganized it a bit, let me know what you think |
ChengShi-1
left a comment
There was a problem hiding this comment.
Looks good! Thanks for reorganizing Changelog
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.