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

Allow for null checksums returned by Google Drive, ignore files without download links #666

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

mbertrand
Copy link
Member

@mbertrand mbertrand commented Oct 8, 2021

Pre-Flight checklist

  • Migrations
    • Migration is backwards-compatible with current production code
  • Testing
    • Code is tested
    • Changes have been manually tested

What are the relevant tickets?

Closes #648

What's this PR do?

Allows DriveFile.checksum to be null because that's what Google Drive returns for some files.
Ignores any files that have null download links (because that link is used to upload to S3).
Also surrounds the body of gdrive_sync.api.process_file_result to log any errors instead of raising them.

How should this be manually tested?

  • Set DRIVE_, AWS_ env variables to the same as on RC
  • For a new or existing site, create a new google doc or sheet in the files_final subfolder beneath your site's folder in google drive. Also upload some other files there.
  • Click the `Sync w/Google Drive' button on your site's resources page. Wait a minute or so, then refresh the page. Your uploaded files should appear but not the google doc/sheet.

Any background context you want to provide?

Since I'm not 100% positive that null checksums occur only for native google drive files without download links, I changed the code to allow those through as long as they have that download link. But S3 uploads require the download link, so those files will be ignored. Support for native google docs/sheets will be added later (#668).

@mbertrand mbertrand changed the title Allow for null checksums returned by Google Drive Allow for null checksums returned by Google Drive, ignore files without download links Oct 8, 2021
@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2021

Codecov Report

Merging #666 (6cacde5) into master (ff01ce0) will increase coverage by 0.00%.
The diff coverage is 95.65%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #666   +/-   ##
=======================================
  Coverage   91.09%   91.10%           
=======================================
  Files         177      177           
  Lines        6493     6496    +3     
  Branches      991      991           
=======================================
+ Hits         5915     5918    +3     
  Misses        504      504           
  Partials       74       74           
Impacted Files Coverage Δ
gdrive_sync/api.py 92.02% <95.45%> (+0.12%) ⬆️
gdrive_sync/models.py 96.66% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff01ce0...6cacde5. Read the comment docs.

Copy link
Contributor

@gumaerc gumaerc left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@mbertrand mbertrand merged commit 8bef5e8 into master Oct 12, 2021
@odlbot odlbot mentioned this pull request Oct 12, 2021
5 tasks
@alicewriteswrongs alicewriteswrongs deleted the mb/null_checksums branch January 25, 2022 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Drive is returning null checksums for some files
3 participants