carpentries / amy

A web-based workshop administration application built using Django.
https://amy.carpentries.org
MIT License
113 stars 72 forks source link

Provide a way to get the "publication name" for a person #2385

Open elichad opened 1 year ago

elichad commented 1 year ago

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:

zkamvar commented 1 year ago

For furthere context, this is how we do this in our lesson release script:

https://github.com/carpentries/chisel/blob/cc888c50fb58f71caff7c390fb8a30b3b9dea267/R/release.R#L591-L602

      # 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.