Skip to content

Conversation

pdurbin
Copy link
Member

@pdurbin pdurbin commented Sep 8, 2025

What this PR does / why we need it:

At dataset creation time, we need to allow datasetType to be passed so that types other than the default ("dataset") can be persisted to the database.

Which issue(s) this PR closes:

Related Dataverse PRs:

Special notes for your reviewer:

We also need to support listing dataset types ( https://guides.dataverse.org/en/6.7.1/api/native-api.html#list-dataset-types ) but perhaps that should be a separate issue and pull request?

Suggestions on how to test this:

{
  "datasetType": "software",
  "datasetVersion": {
    "license": {
      "name": "CC0 1.0",
      "uri": "http://creativecommons.org/publicdomain/zero/1.0"
    },
    "metadataBlocks": {
      "citation": {
        "fields": [
          {
            "value": "pyDataverse",
            "typeClass": "primitive",
            "multiple": false,
            "typeName": "title"
          },
...

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

Yes, we should add something like this:

You can now specify a datasetType when creating a dataset.

Additional documentation:

None.

@pdurbin pdurbin moved this to Ready for Review ⏩ in IQSS Dataverse Project Sep 8, 2025
pdurbin added a commit to pdurbin/dataverse-frontend that referenced this pull request Sep 8, 2025
Note that it depends on this PR:
IQSS/dataverse-client-javascript#354

However, there's a new PR to try instead:
IQSS/dataverse-client-javascript#360
@ChengShi-1 ChengShi-1 self-assigned this Sep 8, 2025
@ChengShi-1 ChengShi-1 moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Sep 8, 2025
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.

Looks awesome!

Could you also add or edit test cases in integration test test/integration/datasets/DatasetsRepository.test.ts and functional test test/functional/datasets/CreateDataset.test.ts? it may be harder to test if we don't have datasetType on DatasetDTO and dataset model.
Also, the useCase.md may need to be updated with new parameter.

newDataset: DatasetDTO,
collectionId = ROOT_COLLECTION_ID
collectionId = ROOT_COLLECTION_ID,
datasetType?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add the param to the description above @param {string}...

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, added in 156963d.

testMetadataBlocks,
ROOT_COLLECTION_ID
ROOT_COLLECTION_ID,
undefined
Copy link
Contributor

@ChengShi-1 ChengShi-1 Sep 8, 2025

Choose a reason for hiding this comment

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

You could add an additional test to make sure datasetType would be called here.
For example,
you could create a function createDatasetwithDatasetType in DataseHelper and do something similar with this
expect(datasetsRepositoryStub.createDatasetwithDatasetType).toHaveBeenCalledWith( testDataset, testMetadataBlocks, ROOT_COLLECTION_ID, datasetType )

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. Added in 48cc5dc. Thanks for the help with this!

@g-saracca g-saracca added GREI Re-arch GREI re-architecture-related and removed GREI Re-arch GREI re-architecture-related labels Sep 9, 2025
@cmbz cmbz added the FY26 Sprint 5 FY26 Sprint 5 (2025-08-27 - 2025-09-10) label Sep 10, 2025
@pdurbin
Copy link
Member Author

pdurbin commented Sep 10, 2025

Closing. As discussed with @ChengShi-1 we're thinking a better order for PRs would be:

  • get dataset types: for this I created a new PR: Use Case for Getting Available Dataset Types #366
  • add, modify and delete dataset types (I'll work on this next)
  • save a dataset with a specific dataset type (this PR, but I'll make a new one after I'm done with the PRs above)

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

Labels

FY26 Sprint 5 FY26 Sprint 5 (2025-08-27 - 2025-09-10)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants