Skip to content

Fix DOI Updating#10030

Merged
jwalz merged 6 commits into
CenterForOpenScience:feature/registration_resourcesfrom
jwalz:resources/fix_doi_update
Aug 22, 2022
Merged

Fix DOI Updating#10030
jwalz merged 6 commits into
CenterForOpenScience:feature/registration_resourcesfrom
jwalz:resources/fix_doi_update

Conversation

@jwalz
Copy link
Copy Markdown
Contributor

@jwalz jwalz commented Aug 19, 2022

Purpose

DOI update was failing validation due to the inclusion of duplicates. It also wasn't excluding deleted Resources or non-final Resources, and there were some lingering issues with the existing Datacite update logic to be resolved.

Changes

  • Only list each resource as a relatedIdentifier one time
  • Exclude deleted and non-finalized Resources from the relatedIdentifiers
  • Add tests for these cases
  • Use known DOI values for the node when updating DOIs instead of always inferring
  • Fix the logical flow within DataciteClient.update_identifier
  • Fix tests for the sync_dois management command

QA Notes

Please make verification statements inspired by your code and what your code touches.

  • Verify
  • Verify

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

Ticket

return self.create_identifier(node, category)
logger.info('TEST ENV: DOI built but not minted')

return {'doi': doi_value, 'metadata': metadata}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: it would be nice to have consistency with the crossref client with these return values.

Copy link
Copy Markdown
Member

@mfraezz mfraezz left a comment

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

@brianjgeiger brianjgeiger 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. A little surprise about a comparison working, but if that's all fine, this seems good to me.

Comment thread tests/identifiers/test_datacite.py
@jwalz jwalz merged commit 3aab720 into CenterForOpenScience:feature/registration_resources Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants