Skip to content

Conversation

@vera
Copy link
Contributor

@vera vera commented Nov 27, 2025

What this PR does / why we need it:

This PR adds "isInReviewState" to API responses about dataset versions, which is useful information.

Which issue(s) this PR closes:

Not aware of any issue.

Special notes for your reviewer:

/

Suggestions on how to test this:

I've extended the API test: mvn test -Dtest="DatasetsIT#testDatasetVersionsAPI"

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

/

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

I've added a short release note.

Additional documentation:

/

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Dec 1, 2025
@scolapasta scolapasta moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Dec 2, 2025
@stevenwinship stevenwinship self-assigned this Dec 3, 2025
@stevenwinship stevenwinship moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Dec 3, 2025
@stevenwinship stevenwinship added Size: 3 A percentage of a sprint. 2.1 hours. FY25 Sprint 11 FY25 Sprint 11 (2024-11-20 - 2024-12-04) labels Dec 3, 2025
@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Dec 3, 2025
@stevenwinship stevenwinship removed their assignment Dec 3, 2025
@stevenwinship stevenwinship self-requested a review December 3, 2025 19:28
@stevenwinship stevenwinship moved this from Ready for QA ⏩ to Ready for Review ⏩ in IQSS Dataverse Project Dec 3, 2025
.add("internalVersionNumber", dsv.getVersion())
.add("versionMinorNumber", dsv.getMinorVersionNumber())
.add("versionState", dsv.getVersionState().name())
.add("isInReviewState", dsv.isInReview())
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to isInReview since this is not a state. Being in review is a lock

Copy link
Contributor

@stevenwinship stevenwinship left a comment

Choose a reason for hiding this comment

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

Change isInReviewState to isInReview since this is not a state. Being in review is a lock

@stevenwinship stevenwinship moved this from Ready for Review ⏩ to In Progress 💻 in IQSS Dataverse Project Dec 3, 2025
@stevenwinship stevenwinship moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Dec 3, 2025
@cmbz cmbz added the FY26 Sprint 11 FY26 Sprint 11 (2025-11-20 - 2025-12-03) label Dec 3, 2025
@qqmyers
Copy link
Member

qqmyers commented Dec 3, 2025

@vera - FWIW: I think we have design questions about this. Being in review is because of a review lock and we already have an API for locks: https://guides.dataverse.org/en/latest/api/native-api.html#dataset-locks . While understanding that it can be convenient to get all useful info in a single call, having multiple ways to get the same info can be confusing. Further, making the output of a GET different from what's allowed in a PUT can also be confusing and make it harder for API users to deal with round trip changes. We certainly have cases where we've allowed extra info in GETs for convenience already, but we're starting to question doing more of that. In this case, I think there's an additional question too: are we starting down a road where we will also have entries for all the other possible locks in the version response?

I think the things were discussing are:

  • accept this and punt the question of what's best to the version 2 API (in the indefinite future),
  • if this info is always important when you get version info, does that also apply to other locks, and, if so, should we instead ask for a PR to add all locks to the version API (one "locks" key whose value is the same as the locks api?), or
  • just reject given that there is a way to get the info already.
    I'm not sure there's a consensus yet, but your opinion on whether the locks api is sufficient, whether getting the rest of the lock info is going to be needed and so making a more general PR makes sense, or whether this PR, as is, is really key for some reason, would be useful input.

@cmbz cmbz added the FY26 Sprint 12 FY26 Sprint 12 (2025-12-03 - 2025-12-17) label Dec 3, 2025
@ekraffmiller
Copy link
Contributor

I think it useful to add isInReview to the API response - although we haven't implemented the Submit for Review feature yet in the SPA, we do need to display an 'In Review' label in the View Dataset page, and we already are returning 'In Review' in the search results on the Collection Page.
When a Dataset is In Review, the search API returns that in an array of publicationStatuses (see example below). Other locks, like 'Ingest' and 'PidRegister' are more transient, they only last while an automatic process is ongoing. But since 'In Review' lock depends on user actions, it lasts longer, and I think it makes sense to return it as part of the response.

{
    "status": "OK",
    "data": {
        "q": "*",
        "total_count": 93,
        "start": 0,
        "spelling_alternatives": {},
        "items": [
            {
                "name": "Ellen's dataset",
                "type": "dataset",
                "url": "https://doi.org/10.5072/FK2/LXDCT9",
                "global_id": "doi:10.5072/FK2/LXDCT9",
                "description": "test",
                "publisher": "Root",
                "citationHtml": "Kraffmiller, Ellen, 2025, \"Ellen's dataset\", <a href=\"https://doi.org/10.5072/FK2/LXDCT9\" target=\"_blank\">https://doi.org/10.5072/FK2/LXDCT9</a>, Root, DRAFT VERSION",
                "identifier_of_dataverse": "root",
                "name_of_dataverse": "Root",
                "citation": "Kraffmiller, Ellen, 2025, \"Ellen's dataset\", https://doi.org/10.5072/FK2/LXDCT9, Root, DRAFT VERSION",
                "publicationStatuses": [
                    "Unpublished",
                    "Draft",
                    "In Review"
                ],
                "storageIdentifier": "s3://10.5072/FK2/LXDCT9",
                "subjects": [
                    "Agricultural Sciences"
                ],
                "fileCount": 0,
                "versionId": 89,
                "versionState": "DRAFT",
                "createdAt": "2025-12-03T14:51:18Z",
                "updatedAt": "2025-12-03T15:02:24Z",
                "contacts": [
                    {
                        "name": "Kraffmiller, Ellen",
                        "affiliation": ""
                    }
                ],
                "publications": [
                    {}
                ],
                "authors": [
                    "Kraffmiller, Ellen"
                ]
            },
         .....
        ],
        "count_in_response": 10
    }
}

@stevenwinship
Copy link
Contributor

@ekraffmiller
RE: "publicationStatuses": [
"Unpublished",
"Draft",
"In Review"
]

Does it make sense for the localization to be done in the backend? Wouldn't it make more sense to return a fixed value that can be localized by the UI?

@ekraffmiller
Copy link
Contributor

Hi @vera, thanks for your PR! We discussed it and think that for maintainability, it would be better to return a list of current locks on the dataset, rather than having a flag for the existence of a particular lock. That way if more locks are added in the future, the API code won't need to be updated.

@ekraffmiller
Copy link
Contributor

@ekraffmiller RE: "publicationStatuses": [ "Unpublished", "Draft", "In Review" ]

Does it make sense for the localization to be done in the backend? Wouldn't it make more sense to return a fixed value that can be localized by the UI?

This is a good point. We have discussed handling multiple languages in general by adding a requested language in the API header. We we implement that, this data could be returned in the requested language, rather than translated in the frontend.

@pdurbin
Copy link
Member

pdurbin commented Dec 5, 2025

We have discussed handling multiple languages in general by adding a requested language in the API header.

Yes, here's an (unmerged) example: 99fcede

And here's the (merged) language switcher:

@stevenwinship stevenwinship self-assigned this Dec 5, 2025
@stevenwinship stevenwinship moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY25 Sprint 11 FY25 Sprint 11 (2024-11-20 - 2024-12-04) FY26 Sprint 11 FY26 Sprint 11 (2025-11-20 - 2025-12-03) FY26 Sprint 12 FY26 Sprint 12 (2025-12-03 - 2025-12-17) Size: 3 A percentage of a sprint. 2.1 hours. Waiting

Projects

Status: In Review 🔎

Development

Successfully merging this pull request may close these issues.

6 participants