-
Notifications
You must be signed in to change notification settings - Fork 333
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
[ENG-6821] Fix CrossRef DOI check task #10886
[ENG-6821] Fix CrossRef DOI check task #10886
Conversation
* Ignore providers that are not configured * Improve exception handling and add sentry logging
dd5ffd2
to
0a46e0e
Compare
if not doi_prefix: | ||
sentry.log_message(f'Preprint [_id={preprint._id}] has been skipped for CrossRef DOI Check ' | ||
f'since the provider [_id={preprint.provider._id}] has invalid DOI Prefix ' | ||
f'[doi_prefix={doi_prefix}]') | ||
continue |
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.
For reviewer: Ignore provider that is not properly configured for CrossRef.
sentry.log_message(f'Could not contact crossref to check for DOIs, response returned with exception {exc}') | ||
continue |
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.
For reviewer: don't quit if one batch failed. Log to sentry and continue.
if not base_guid or not version: | ||
sentry.log_message(f'[Skipped] Preprint [_id={preprint__id}] returned by CrossRef API has invalid _id') | ||
continue |
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.
For reviewer: CrossRef must return the correct full (base and version) _id
. Similarly, don't quit but just skip if one fails.
).first() | ||
if not pending_preprint: | ||
sentry.log_message(f'[Skipped] Preprint [_id={preprint__id}] returned by CrossRef API is not found.') | ||
continue |
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.
For reviewer: use filter()
and added None
check. Similarly, don't quit but just skip if one fails.
No new failures and merging now. |
45af5db
into
CenterForOpenScience:feature/preprints-doi-versioning
Purpose
Fix CrossRef DOI check task
Changes
QA Notes
N/A
Documentation
N/A
Side Effects
N/A
Ticket
https://openscience.atlassian.net/browse/ENG-6821