-
Notifications
You must be signed in to change notification settings - Fork 495
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
addDataverse API endpoint extension for input levels and facet list setup #10644
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…d for addDaraverse API
This comment has been minimized.
This comment has been minimized.
… in CreateDataverseCommand
…-collection-api-ext
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…d but not as included
@sekmiller Requested changes addressed. |
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good! Thanks for the updates and welcome back
@GPortas Please note that Jenkins tests keep failing. It appears that the 3 failures from last week happened because the version was still 6.2 in the dataverse-parent pom.xml. But I synced the branch with develop earlier today, and the tests failed again. I can't tell why it failed this time right away. |
@landreev I am still looking for the causes. The unit test action is also failing, the problem is on war file building. In particular, te issue happens when trying to download an artifact: This has happened since the develop merge you pushed, it had not happened before. I reran the action several times and encountered the same problem. In Jenkins, it seems that the job also fails at the same point, when building the war file, take a look at this screenshot: But war building and unit tests work on my localhost with no problems... |
I'm ready to merge this, but will wait until tomorrow for the Primefaces dependency issue to be fixed; just to see automated tests pass. |
What this PR does / why we need it:
The addDataverse (
/api/dataverses/{identifier}
) API endpoint has been extended to allow adding metadata blocks, input levels and facet ids at creation time, as the Dataverse page in create mode does in JSF.Which issue(s) this PR closes:
Special notes for your reviewer:
I had to modify the
CreateDataverseCommand
to add the logic for adding metadata blocks, as well as other logic related to the Dataverse instance and its input levels and facets. I also had to reorder the code for persisting the dataverse collection with all the changes.The logic I had to add to the command was previously handled in JSF from the Dataverse Page before calling the command, and without these modifications, calling the command from the API with input levels and/or facet ids resulted in an inconsistent state for the created Dataverse. The API was sending facetIds and inputLevels as null, since they were not supported in the endpoint request body, so these issues went unnoticed.
I have implemented the changes in such a way that they do not interfere with the current behavior of JSF, as the command is still consumed in the same way in JSF and I have not made any changes to the DataversePage.class. I have performed several manual tests with logging to ensure that there is no impact on the behavior of JSF, but due to the lack of test coverage in this area, I recommend an analysis of possible implications by the PR reviewer.
Suggestions on how to test this:
IT tests have been implemented, covering cases where metadata blocks, input levels, or facet IDs are set in the dataverse collection. However, I recommend performing manual tests by calling the endpoint and verifying the correct persistence of the dataverse, its metadata blocks, input levels, and facets.
Create JSON file following the new example provided in the docs: https://github.com/IQSS/dataverse/blob/e65eb9f947beec06ddbfc6f0bfb73f7ecaf60d28/doc/sphinx-guides/source/_static/api/dataverse-complete-optional-params.json
Call the endoint as described in the docs:
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X POST "https://demo.dataverse.org/api/dataverses/root" --upload-file dataverse-complete-optional-params.json
Now you need to verify that all necessary information about the new dataverse collection, its metadata blocks, input levels, and facet IDs has been correctly persisted.
We can confirm that the information has been correctly persisted if, after entering the dataverse collection page, the input levels and facets sections have the fields set in the JSON.
Input levels:
Facet ids:
As an additional verification, we can check the persisted information in the related database tables.
dataverse_metadatablock
tabledataversefieldtypeinputlevel
tabledataversefacet
tableDoes this PR introduce a user interface change? If mockups are available, please link/include them here:
None
Is there a release notes update needed for this change?:
Yes, attached
Additional documentation:
None