Skip to content
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

Update google drive action #869

Merged
merged 10 commits into from
Dec 24, 2024
Merged

Conversation

gabestein
Copy link
Member

@gabestein gabestein commented Dec 21, 2024

Issue(s) Resolved

High-level Explanation of PR

  • Casts some values so they validate
  • Allows use of set communitySlug rather than hardcoding
  • Adds discussions and versions only when they don't already exist
  • Adds a new version if old and new content don't match

Test Plan

  1. Test the google drive action on the gdrive folder with a URL field configured to hold a gdrive folder
  2. Ensure that:
  • On a first run, new discussions and versions are created
  • On second run, no new versions and discussions are created
  1. Update the main doc in the google drive folder
  2. Re-run the action
  3. Ensure that a new version is created, with new content

Screenshots (if applicable)

Notes

@gabestein gabestein requested a review from isTravis December 21, 2024 21:50
: undefined,
"arcadia:content": comment.text,
"arcadia:publication-date": comment.createdAt,
"arcadia:full-name": comment.author.fullName,
"arcadia:orcid": comment.author.orcid,
"arcadia:orcid": `https://orcid.org/${comment.author.orcid}`,
Copy link
Member

Choose a reason for hiding this comment

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

Current use pages on legacy just render the orcid value - (and construct the URL for the href). Is there a reason to store the whole URL, as opposed to just the ORCID? Somehow feels cleaner to me to construct the URL when we need, than to try and parse out just the ID value when we need it.

Copy link
Member Author

@gabestein gabestein Dec 23, 2024

Choose a reason for hiding this comment

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

Yes. Storing them as just the ID part causes a bunch of problems on Legacy because ORCIDs are technically fully qualified RDF IRIs — the https:// is part of the ID — and people are used to pasting in the full URL on every other system. All the validators are built assuming this. Etc. So on Legacy we're parsing in and parsing out all the time anyway. They're useless as the numbers alone.

Copy link
Member

@isTravis isTravis left a comment

Choose a reason for hiding this comment

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

This does fix the anchor validation issue. The problem I'm bumping into now is that it doesn't remove or check for duplicate IDs on versions or discussions when re-run, and errors on that. I knew that was one of the things still to fix.

My preference would be for ORCID to be a string, not URL type, and to just store the ID - not the full https.... If there's a good reason not to do it that way though, this should work as is.

@gabestein
Copy link
Member Author

See comment above for why we should store ORCID as a URL.

Re: duplicates...what's the error? My assumption would be that it would successfully create duplicates via the upsert.

@gabestein gabestein changed the title Fix Google Drive Action Field Validation Errors Update google drive action Dec 24, 2024
@gabestein gabestein requested a review from isTravis December 24, 2024 19:24
@gabestein gabestein marked this pull request as ready for review December 24, 2024 19:28
@gabestein gabestein force-pushed the gs/fix-gdrive-action-validation-errors branch from b492252 to 2569317 Compare December 24, 2024 19:38
@gabestein gabestein merged commit d82ab08 into main Dec 24, 2024
8 checks passed
@gabestein gabestein deleted the gs/fix-gdrive-action-validation-errors branch December 24, 2024 20:01
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.

2 participants