Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

deal with another alternate orcid format for contributors #1059

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

peetucket
Copy link
Contributor

Why was this change made? 🤔

Same thing as sul-dlss/orcid_client#30, i.e. we have varying formats of how ORCIDs are represented in contributors. This deals with another case that caused https://app.honeybadger.io/projects/50568/faults/102209790

We also needed to add to orcid_client until we consolidate as described in sul-dlss-deprecated/dor_indexing#15

How was this change tested? 🤨

Updated spec

@@ -48,6 +48,9 @@ def orcidid(contributor)
return identifier.uri if identifier.uri
return identifier.value if identifier.value.start_with?('https://orcid.org/')

# some records have just the ORCIDID without the URL prefix, add it if so, e.g. druid:tp865ng1792
return URI.join('https://orcid.org/', identifier.value).to_s if identifier.source.uri.blank?
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there ever a case in which identifier.source.uri isn't https://orcid.org or blank? If not, how about getting rid of L52 and replacing L54 with URI.join('https://orcid.org/', identifier.value).to_s.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good question ... I support in theory it could be "sandbox" for test data, or maybe it might change in the future? Seems unlikely though.

Our test do verify it works with an alternate URI and I think it was speced this way, but unclear if that's a common situation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the rest of orcid_builder assumes that you can just used https://orcid.org when it is missing, seems fine to always use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed (and also in orcid_client PR)

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it ok to put a [HOLD] on this until we've got some clarity around how ORCID identifiers are structured in Cocina?

Copy link
Contributor

Choose a reason for hiding this comment

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

Err, never mind :-)

@justinlittman justinlittman merged commit dde95e4 into main Nov 15, 2023
@justinlittman justinlittman deleted the alternate-orcid-format branch November 15, 2023 22:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants