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

Update Dataverse API removes metadatablocks if optional params are omitted #11144

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

stevenwinship
Copy link
Contributor

@stevenwinship stevenwinship commented Jan 9, 2025

What this PR does / why we need it: Better control over updating dataverse metadatablocks - update/delete-inherit

Which issue(s) this PR closes:#11130

Special notes for your reviewer: See discussion in parent issue

Suggestions on how to test this: See DataversesIT. Test different combinations of Json with the three blocks and two flags.

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?: Included

Additional documentation: native-api

@stevenwinship stevenwinship self-assigned this Jan 9, 2025
@stevenwinship stevenwinship added Size: 30 A percentage of a sprint. 21 hours. (formerly size:33) Type: Bug a defect labels Jan 9, 2025

This comment has been minimized.

@stevenwinship stevenwinship removed their assignment Jan 10, 2025
Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:11130-update-dataverse-api-remove-metadatablock
ghcr.io/gdcc/configbaker:11130-update-dataverse-api-remove-metadatablock

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

@sekmiller sekmiller self-assigned this Jan 13, 2025
dataverse.addInputLevelsMetadataBlocksIfNotPresent(inputLevels);
ctxt.fieldTypeInputLevels().deleteFacetsFor(dataverse);
inputLevels.forEach(inputLevel -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have to worry about incompatible input levels where they might put in a dataset field type that doesn't belong to the installed metadata blocks of the given dataverse"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I understand the question. The new code does exactly what the old code did for inputLevel list that isn't empty. My goal was to remove the resetRelationsOnNullValues flag and implement a way to delete data or ignore the missing data based on the list being empty or null.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, what I was wondering about is what if you add an input level for a dataset field that isn't already in a metadata block that is part of the dataverse you're updating - the answer is in line 107 - if you add an input level for a dataset field that is not already included in the dataverse then dataverse.addInputLevelsMetadataBlocksIfNotPresent(inputLevels) - will add that metadata block to the dataverse.

Copy link
Contributor

@sekmiller sekmiller left a comment

Choose a reason for hiding this comment

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

This looks good. thanks for adding the tests.

@sekmiller sekmiller removed their assignment Jan 14, 2025
@ofahimIQSS ofahimIQSS self-assigned this Jan 14, 2025
@ofahimIQSS
Copy link
Contributor

Tests Passing - Merging PR

@ofahimIQSS ofahimIQSS merged commit 5073daa into develop Jan 14, 2025
14 checks passed
@ofahimIQSS ofahimIQSS deleted the 11130-update-dataverse-api-remove-metadatablock branch January 14, 2025 16:38
@ofahimIQSS ofahimIQSS removed their assignment Jan 14, 2025
@pdurbin pdurbin added this to the 6.6 milestone Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 30 A percentage of a sprint. 21 hours. (formerly size:33) Type: Bug a defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Dataverse API removes metadatablocks if optional params are omitted
4 participants