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

Adds new update dataverse general endpoint #10925

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

GPortas
Copy link
Contributor

@GPortas GPortas commented Oct 15, 2024

What this PR does / why we need it:

Adds a new endpoint (PUT /api/dataverses/<identifier>) for updating an existing Dataverse collection using a JSON file following the same structure as the one used in the API for the creation.

Which issue(s) this PR closes:

Special notes for your reviewer:

I have refactored commands CreateDataverseCommand and UpdateDataverseCommand, so that they now inherit from a common parent class called AbstractWriteDataverseCommand, where the shared logic of these commands is centralized.

Suggestions on how to test this:

Call the new API endpoint using curl:

curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT "http://localhost:8080/api/dataverses/<ALIAS_OF_CREATED_DV>" --upload-file <YOUR_JSON_FILE>

Verify that the new properties specified in the JSON are correctly reflected in the dataverse collection.

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

No.

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

Yes. Attached.

@coveralls
Copy link

coveralls commented Oct 15, 2024

Coverage Status

coverage: 20.889% (+0.02%) from 20.868%
when pulling 4f98be6 on 10904-edit-dataverse-collection
into d039a10 on develop.

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.

@DS-INRAE
Copy link
Member

Hi @GPortas Sorry I didn't take a look at the code if it would have answered my question.
Does this new endpoint also addresses some of the editable elements of the collections that are hard-coded ?

This comment has been minimized.

2 similar comments

This comment has been minimized.

This comment has been minimized.

@GPortas
Copy link
Contributor Author

GPortas commented Oct 21, 2024

Hi @GPortas Sorry I didn't take a look at the code if it would have answered my question. Does this new endpoint also addresses some of the editable elements of the collections that are hard-coded ?

Hi @DS-INRAE,

If I understood it correctly, your issue is related to creating custom metadata structures for collections, while this PR focuses on creating a new endpoint for updating existing collections based on the only structure currently supported.

So I think your requested changes are not related, sorry!

@GPortas GPortas marked this pull request as ready for review October 21, 2024 15:58
@GPortas GPortas added Size: 3 A percentage of a sprint. 2.1 hours. SPA These changes are required for the Dataverse SPA Original size: 3 labels Oct 21, 2024
@GPortas GPortas added SPA.Q4.3 Edit Collection Page GREI Re-arch Issues related to the GREI Dataverse rearchitecture labels Oct 21, 2024
Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10904-edit-dataverse-collection
ghcr.io/gdcc/configbaker:10904-edit-dataverse-collection

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

@GPortas GPortas self-assigned this Oct 22, 2024
@scolapasta scolapasta added the Status: Waiting for Related Issues/PRs This issue depends upon the completion of one or more issues/PRs label Oct 22, 2024
@cmbz cmbz added FY25 Sprint 8 FY25 Sprint 8 (2024-10-09 - 2024-10-23) FY25 Sprint 9 FY25 Sprint 9 (2024-10-23 - 2024-11-06) labels Oct 23, 2024
@GPortas GPortas removed the Status: Waiting for Related Issues/PRs This issue depends upon the completion of one or more issues/PRs label Oct 24, 2024
@GPortas GPortas removed their assignment Oct 24, 2024
@sekmiller sekmiller assigned sekmiller and unassigned sekmiller Oct 31, 2024
@sekmiller
Copy link
Contributor

Not sure if it's 100% related to the issue at hand here, but I think it would be helpful in general and possibly to make this endpoint more useful for the non-SPA user if we updated the getDataverse endpoint/ jsonPrinter for Dataverses to include/return the metadata blocks for the Dataverse

@GPortas
Copy link
Contributor Author

GPortas commented Nov 1, 2024

Not sure if it's 100% related to the issue at hand here, but I think it would be helpful in general and possibly to make this endpoint more useful for the non-SPA user if we updated the getDataverse endpoint/ jsonPrinter for Dataverses to include/return the metadata blocks for the Dataverse

Yes, it is not entirely related to this issue, as we are only focusing on the creation of the dataverse through the API, not on reading it.

Currently, if you want to obtain the metadata blocks of the dataverse, you would have to call the listMetadata blocks endpoint separately from the getDataverse endpoint. It could be interesting, as you say, to offer the option in the future to get everything together in the getDataverse endpoint. We can create an issue to prioritize this at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 8 FY25 Sprint 8 (2024-10-09 - 2024-10-23) FY25 Sprint 9 FY25 Sprint 9 (2024-10-23 - 2024-11-06) GREI Re-arch Issues related to the GREI Dataverse rearchitecture Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA.Q4.3 Edit Collection Page SPA These changes are required for the Dataverse SPA
Projects
Status: In Review 🔎
Development

Successfully merging this pull request may close these issues.

Edit Dataverse Collection Native API endpoint
6 participants