Skip to content

Get Dataset Reviews use case#457

Merged
ChengShi-1 merged 5 commits into
developfrom
447-dataset-reviews-list
Jun 23, 2026
Merged

Get Dataset Reviews use case#457
ChengShi-1 merged 5 commits into
developfrom
447-dataset-reviews-list

Conversation

@ekraffmiller

@ekraffmiller ekraffmiller commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds a use case for getting dataset reviews

Which issue(s) this PR closes:

Special notes for your reviewer:

The integration test includes setup code that adds the review.tsv metadatablock, and updates the solar schema. This is required because the API endpoint uses solr search to find the reviews related to a dataset.

Suggestions on how to test this:

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

yes, an item as added to the CHANGELOG.md

Additional documentation:

@ekraffmiller ekraffmiller marked this pull request as ready for review June 16, 2026 12:48
@ekraffmiller ekraffmiller moved this to Ready for Review ⏩ in IQSS Dataverse Project Jun 16, 2026
@ekraffmiller ekraffmiller added FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) GREI Re-arch GREI re-architecture-related Size: 3 A percentage of a sprint. 2.1 hours. labels Jun 16, 2026
@cmbz cmbz added the FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) label Jun 18, 2026
@ChengShi-1 ChengShi-1 requested review from ChengShi-1 and Copilot June 22, 2026 15:02
@ChengShi-1 ChengShi-1 moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Jun 22, 2026
@ChengShi-1 ChengShi-1 self-assigned this Jun 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class support for retrieving “review datasets” associated with a target dataset via the Dataverse GET /api/datasets/{identifier}/reviews endpoint, including model/transformer wiring, public exports, and test coverage (unit + integration).

Changes:

  • Introduces DatasetReview domain model + payload/response transformer, and adds getDatasetReviews to IDatasetsRepository + DatasetsRepository.
  • Adds GetDatasetReviews use case and exports it from the datasets public API; updates docs and changelog.
  • Adds unit tests for the use case/repository method and an integration test that bootstraps required metadata blocks and Solr schema for the endpoint.

Reviewed changes

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

Show a summary per file
File Description
test/unit/datasets/GetDatasetReviews.test.ts Unit tests for the new GetDatasetReviews use case.
test/unit/datasets/DatasetsRepository.test.ts Unit tests for DatasetsRepository.getDatasetReviews (numeric + persistent id).
test/testHelpers/search/solrHelper.ts New helper to verify/update Solr schema in the test Docker environment.
test/testHelpers/datasets/datasetReviewHelper.ts Test factories for DatasetReview model/payload.
test/testHelpers/datasets/datasetHelper.ts Adds helper to load a metadata block via admin API for integration setup.
test/testHelpers/collections/collectionHelper.ts Adds helper to configure allowed dataset types on a collection for integration setup.
test/integration/metadataBlocks/MetadataFieldsInfoRepository.test.ts Makes facetable field count assertion tolerant to added metadata blocks.
test/integration/datasets/DatasetsRepository.test.ts Adds integration coverage for dataset reviews (with Solr/metadata bootstrapping).
test/functional/metadataBlocks/GetAllFacetableMetadataFields.test.ts Makes facetable field count assertion tolerant to added metadata blocks.
src/datasets/infra/repositories/transformers/datasetReviewTransformers.ts Transforms reviews endpoint response into DatasetReview[].
src/datasets/infra/repositories/transformers/DatasetReviewPayload.ts Defines the API payload shape for reviews.
src/datasets/infra/repositories/DatasetsRepository.ts Implements getDatasetReviews repository method.
src/datasets/index.ts Exports the new use case instance and DatasetReview types.
src/datasets/domain/useCases/GetDatasetReviews.ts Adds the GetDatasetReviews use case.
src/datasets/domain/repositories/IDatasetsRepository.ts Extends repository interface with getDatasetReviews.
src/datasets/domain/models/DatasetReview.ts Adds the new DatasetReview domain model.
docs/useCases.md Documents the new use case and usage example.
CHANGELOG.md Adds release note entry for dataset reviews support.

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

Comment on lines +2108 to +2111
await assertDatasetReviewsEndpointAvailable()
await ensureReviewMetadataBlocksExist()
await ensureReviewSolrSchemaFieldsExist()
await ensureReviewDatasetTypeExists()
Comment on lines +2253 to +2265
const reviewDatasetType = await getDatasetAvailableDatasetType
.execute(reviewDatasetTypeName)
.catch(async () => {
reviewDatasetTypeCreatedByTest = true
return await addDatasetType.execute({
name: reviewDatasetTypeName,
displayName: 'Review',
description: 'A review of a dataset compiled by the expert community.',
linkedMetadataBlocks: [],
availableLicenses: []
})
})

@ChengShi-1 ChengShi-1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good

@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Jun 22, 2026
@ChengShi-1 ChengShi-1 removed their assignment Jun 23, 2026
@ChengShi-1 ChengShi-1 merged commit 99147e7 into develop Jun 23, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for QA ⏩ to Merged 🚀 in IQSS Dataverse Project Jun 23, 2026
@pdurbin pdurbin moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) GREI Re-arch GREI re-architecture-related Project: Trusted Data Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

New Use Case: get local reviews of Dataset

5 participants