Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10297 dataset metadata endpoint fix #10303

Merged
merged 4 commits into from
Feb 6, 2024

Conversation

jp-tosca
Copy link
Contributor

@jp-tosca jp-tosca commented Feb 6, 2024

What this PR does / why we need it:

When trying to access the endpoint api/datasets/{id}/metadata it will try by default to get the draft version and if this endpoint is used on a dataset with no draft it will return an error specifying that there is no draft version accompanied by an exception on the server side.

Which issue(s) this PR closes:

Closes #10297

Special notes for your reviewer: It was discussed on slack that this was the intended behavior of the endpoint. Tests were added to validate when multiple versions of the dataset exist.

Suggestions on how to test this:
Try to access the endpoint at api/datasets/{id}/metadata

If a draft exists and the user has access to it it should be prioritized, otherwise, a published version will provided if exists.

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

@jp-tosca jp-tosca added Type: Bug a defect Size: 3 A percentage of a sprint. 2.1 hours. labels Feb 6, 2024
Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

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

Looks good.

@coveralls
Copy link

coveralls commented Feb 6, 2024

Coverage Status

coverage: 20.145% (+0.004%) from 20.141%
when pulling 2f167cf on 10297-dataset-metadata-endpoint-fix
into 98231c5 on develop.

This comment has been minimized.

1 similar comment
Copy link

github-actions bot commented Feb 6, 2024

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10297-dataset-metadata-endpoint-fix
ghcr.io/gdcc/configbaker:10297-dataset-metadata-endpoint-fix

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@pdurbin pdurbin self-assigned this Feb 6, 2024
@pdurbin
Copy link
Member

pdurbin commented Feb 6, 2024

Tests are passing at https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-10303/1/testReport/

Looks good. Lots of tests added. I don't think it's worth adding this to the API Changelog, honestly. Merging.

@pdurbin pdurbin merged commit 08cf9a8 into develop Feb 6, 2024
19 checks passed
@pdurbin pdurbin deleted the 10297-dataset-metadata-endpoint-fix branch February 6, 2024 17:30
@pdurbin pdurbin added this to the 6.2 milestone Feb 6, 2024
@pdurbin pdurbin removed their assignment Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug a defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

api/datasets/{id}/metadata defaults to :draft causing a server error when no DRAFT version exist
4 participants