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

IQSS-5505 - only update DOI metadata at PIDprovider when it changes #5506

Conversation

qqmyers
Copy link
Member

@qqmyers qqmyers commented Jan 31, 2019

New Contributors

Welcome! New contributors should at least glance at CONTRIBUTING.md, especially the section on pull requests where we encourage you to reach out to other developers before you start coding. Also, please note that we measure code coverage and prefer you write unit tests. Pull requests can still be reviewed without tests or completion of the checklist outlined below. Thanks!

Related Issues

Pull Request Checklist

@coveralls
Copy link

coveralls commented Jan 31, 2019

Coverage Status

coverage: 20.699% (-0.01%) from 20.709%
when pulling 912a15c on QualitativeDataRepository:5505-Update_modifyRegistration_API_calls_to_only_update_when_necessary
into 9bda7dd on IQSS:develop.

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.

@qqmyers we added this endpoint specifically for situations where we know we have to update the target url of all of our dvObjects(when we changed the base url of Dataverse. My concern is that having the call to the DataCite api to retrieve and compare the metadata would double the hits to DataCite. Would it make sense to add a flag that would allow you to bypass the compare when you know that update all is required? Or maybe we don't need to be concerned about hitting their api multiple times.
Thanks.

@qqmyers qqmyers changed the title IQSS-5505 IQSS-5505 - only update DOI metadata at PIDprovider when it changes Feb 8, 2019
@qqmyers
Copy link
Member Author

qqmyers commented Feb 12, 2019

@sekmiller - maybe some renaming/refactoring is in order: right now there are /modifyRegistration and /modifyRegistrationAll calls that invoke UpdateDatasetTargetURLCommand which updates both the targetURL and metadata (two API calls) without checking the current values (I haven't changed these). Then there are the /modifyRegistrationMetadata and /modifyRegistrationPIDMetadataAll calls which invoke UpdateDvObjectPIDMetadataCommand which also updates the targetUrl and metadata, which I've modified to check current values (just for DataCite). If a fast way to modify just the targetURLs is needed, the former could drop its second call to replace the metadata. Or we could rename these two sets of calls to be the always modify and modify if needed calls. Or both - make one set just push a new target while the other updates targetUrl and/or metadata as needed. I'm open to these or other options - just let me know what fits the use cases best.

5505-Update_modifyRegistration_API_calls_to_only_update_when_necessary

Conflicts:
	src/main/java/edu/harvard/iq/dataverse/DOIDataCiteRegisterService.java
	src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDvObjectPIDMetadataCommand.java
@dataversebot
Copy link

Can one of the admins verify this patch?

@qqmyers
Copy link
Member Author

qqmyers commented Jun 23, 2020

Note in #6845 - @landreev comments just mentioned not updating file DOIs on version updates if that's not needed. This PR would do that. The discussion that has this PR in limbo is about how to expose this capability in the API. That's potentially separable, but also something we could probably figure out an answer for without too much trouble.

@pdurbin
Copy link
Member

pdurbin commented Feb 14, 2022

I just noticed that @jggautier mentioned the issue that this pull request closes at #5144 (comment)

It looks like it has merge conflicts, though.

@mreekie mreekie added the bk2211 label Nov 1, 2022
@mreekie mreekie removed the bk2211 label Jan 11, 2023
@qqmyers qqmyers self-assigned this Mar 27, 2024
@qqmyers qqmyers added the Size: 3 A percentage of a sprint. 2.1 hours. label Mar 27, 2024
5505-Update_modifyRegistration_API_calls_to_only_update_when_necessary
@qqmyers qqmyers removed their assignment Mar 27, 2024
@cmbz cmbz added the GREI 2 Consistent Metadata label Apr 10, 2024
…gistration_API_calls_to_only_update_when_necessary
@sekmiller sekmiller self-assigned this Apr 29, 2024
@@ -695,7 +696,14 @@ public Response updateDatasetPIDMetadataAll(@Context ContainerRequestContext crc
return response( req -> {
datasetService.findAll().forEach( ds -> {
try {
logger.fine("ReRegistering: " + ds.getId() + " : " + ds.getIdentifier());
if (!ds.isReleased() || (!ds.isIdentifierRegistered() || (ds.getIdentifier() == null))) {
if (ds.isReleased()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this fails because the datasets is not released then nothing will go into the log. Do we want to put something in the logs?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess not, we just want to skip it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah - we currently don't update the PID service after every edit. We could but there's also not a lot of value since the PID isn't searchable.

@sekmiller sekmiller removed their assignment Apr 30, 2024
@landreev landreev self-assigned this Jun 28, 2024
@landreev landreev added Size: 10 A percentage of a sprint. 7 hours. and removed Size: 3 A percentage of a sprint. 2.1 hours. labels Jun 28, 2024
@landreev
Copy link
Contributor

Looking good so far!

@landreev landreev merged commit 2917dbe into IQSS:develop Jun 28, 2024
11 checks passed
@landreev landreev removed their assignment Jun 28, 2024
@pdurbin pdurbin added this to the 6.3 milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GREI 2 Consistent Metadata Size: 10 A percentage of a sprint. 7 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update modifyRegistration API calls to only update when necessary
8 participants