[SVCS-146] In GDrive, a .gdoc and a .docx with the same name don't fully register#229
Open
Johnetordoff wants to merge 9 commits intoCenterForOpenScience:developfrom
Open
Conversation
…doc and test.docx will cause a naming conflict when exported to a new provider, like during registration) and change tests to accommodate.
…erbutler into register-gdrive-export-names * 'develop' of https://github.com/CenterForOpenScience/waterbutler: (90 commits) Remove impossible conditional from _delete_folder Remove unnecessary check for sha. Remove tests for the never called is_sha function. Remove is_sha and _is_sha functions which are never called. Remove isinstance check that data is not list. Remove this check which is also made in function _fetch_tree Handle all github revision-identification parameters bump version & update changelog Allow NoneType checksums for non-exportable files. Add PR template. Fix s3 metadata_headers path tests Document APIv1 query parameters Remove strange use of query params Remove unused path property from BoxRevision Prune unused methods and error-handling from Box Removed three unused googledrive methods Rewrite osfstorage tests, add fixtures and metadata tests Increasing test coverage for figshare provider, path, and metadata bump version & update changelog Expand test coverage for owncloud provider+metadata ... # Conflicts: # tests/providers/googledrive/test_metadata.py
…erbutler into register-gdrive-export-names * 'develop' of https://github.com/CenterForOpenScience/waterbutler: Revert "Handle all github revision-identification parameters" Add __init__.py to modules missing them Adding AuthType over `is_source` Removing old comment Test unsupported actions in auth handler explicit auth provider source/destination w/ custom v1 post actions Allow copy requests to public resources
This reverts commit c9b61a6.
…netordoff/waterbutler into register-gdrive-export-names * 'register-gdrive-export-names' of https://github.com/johnetordoff/waterbutler:
cslzchen
requested changes
Jun 27, 2018
Contributor
There was a problem hiding this comment.
For ⛺️ 🔥 :
This PR looks good to me. Issue is in the ticket is clear and the fix is simple and elegant. I suggest this to be included in the next release.
For CR:
The commit history looks bad. I will cherry pick your commits and then rebase on the latest develop. I will approve it after I tested locally 🎆 .
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
When a gFile, (.gdoc, .gslides etc) gets exported we change the ext to .docx, .ppt etc. If this happens one file at a time waterbulter will deal with conflicts appropriately and prompt the user to rename/replace the file, but when multiple files are exported and uploaded coherently (like during registration or a folder drop, WB will overlook the conflict and replace/overwrite files with export conflicts.
For example: two files named test.gdoc and test.docx will cause a naming conflict when exported because they both will be exported as a docx file called test.docx.
This fix will modify the export path to append to the new extension. so test.gdoc and test.docx will be test.gdoc.docx and test.docx .
Changes
Simple change to metadata path property and modification so tests fit the new behavior.
Side Effects
Exported paths retain their old extensions, new extensions are appended.
Ticket
https://openscience.atlassian.net/browse/SVCS-146