Export Metadata Use Case#463
Open
ChengShi-1 wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new datasets use case for exporting dataset metadata via Dataverse GET /datasets/export (including draft support), exposing it through the public datasets API and documenting it. Also updates unlink-collection tests to validate unlinking through the links API rather than Solr-backed search results.
Changes:
- Introduce
exportDatasetMetadatause case + repository method, and exportExportedDatasetMetadatatype. - Add unit + integration coverage for metadata export (latest published default + draft export).
- Stabilize unlink-collection tests by asserting via
getCollectionLinksinstead of/search?subtree=....
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/unit/datasets/ExportDatasetMetadata.test.ts | Adds unit tests for the new ExportDatasetMetadata use case behavior. |
| test/integration/datasets/DatasetsRepository.test.ts | Adds integration coverage for exporting latest published and draft dataset metadata. |
| test/integration/collections/CollectionsRepository.test.ts | Updates unlink test to validate via collection links API instead of Solr search. |
| test/functional/collections/UnlinkCollection.test.ts | Updates functional unlink test to verify via getCollectionLinks. |
| src/datasets/infra/repositories/DatasetsRepository.ts | Implements exportDatasetMetadata API call and response shaping. |
| src/datasets/index.ts | Wires/export the new use case and exports the response type. |
| src/datasets/domain/useCases/ExportDatasetMetadata.ts | Adds the new domain use case wrapper. |
| src/datasets/domain/repositories/IDatasetsRepository.ts | Extends repository interface with exportDatasetMetadata. |
| src/datasets/domain/models/ExportedDatasetMetadata.ts | Introduces the response type for exported metadata. |
| docs/useCases.md | Documents the new use case and updates the datasets read use-cases list. |
| CHANGELOG.md | Adds a changelog entry for the new dataset metadata export feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
What this PR does / why we need it:
Export Metadata Use Case
Which issue(s) this PR closes:
Related Dataverse PRs:
Special notes for your reviewer:
UnlinkCollection test error, the subcollection was removed from the collection links API response, but it still appeared in the Solr-backed
/search?subtree=...response, which led an error when ofgetCollectionItemuse case. I fixed by usinggetCollectionLinksuse case to check if the unlinking works successfullySuggestions on how to test this:
Is there a release notes or changelog update needed for this change?:
YES
Additional documentation: