Open elichad opened 1 year ago
For furthere context, this is how we do this in our lesson release script:
# default on AMY profile info
# first use profile info if user specified it's what they wanted
lesson_publication_consent == "amy" |
lesson_publication_consent == "unset" ~ person_name_with_middle,
# then orcid info
lesson_publication_consent == "orcid" &
is_valid_orcid(clean_up_orcid(orcid)) ~ tryCatch(get_orcid_name(clean_up_orcid(orcid)), error = function(e) person_name_with_middle) ,
# then github (just return GitHub username)
# 2023-01-27, ZNK: AMY's github consent is for the _handle_ not the name.
lesson_publication_consent == "github" ~ github, #get_github_name(github),
# if all else fails, use git info
TRUE ~ name
These rules are structured in a first-come-first-served manner of TEST ~ RESULT
So if someone sets AMY, then they get person_name_with_middle. If they set "orcid", we try to get the orcid name If they set "github", we use their GitHub ID (not their github handle as we previously thought) or if nothing else matches, we use the name provided in the git log.
Raised by @zkamvar, who has been running into an issue with publication names for lesson releases, using an old dependency written by Francois which needs to be updated. For the may-publish-name consent, there are four current options: “AMY ID”, “unset,” "GitHub," and “ORCID”, and for ORCID they have updated their API. AMY would need to run a query against the ORCID API if a user has chosen to publish under their ORCID name. This has to be done on a regular basis, so it would be good if AMY had a “publication name” field that is regularly updated. However, the lesson release schedule isn’t frequent.
Initial thoughts:
get_published_name(person_id)
view/API endpoint (separate from other Person views) would allow us to provide this data on request. This could be designed to work in bulk too.