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

[SVCS-479] Raise exception for copy/move replace folder that orphans itself. #333

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

NyanHelsing
Copy link
Contributor

@NyanHelsing NyanHelsing commented Apr 10, 2018

Ticket

https://openscience.atlassian.net/browse/SVCS-479

Replaces: #274

Purpose:

Replace folder from inside folder deletes both

Changes:

  • Updated waterbutler/core/provider.py
    • Add def replace_will_orphan
    • Update def move calls replace_will_orphan
    • Update def copy calls replace_will_orphan
  • Update waterbutler/core/exceptions.py
    • Add class OrphanSelfError
  • Update tests/providers/osfstorage/test_provider.py
    • Add test test_intra_copy_folder_orphan

Side effects

Folder move/copies that use conflict=replace may now be more costly

@NyanHelsing
Copy link
Contributor Author

See previous PR for discussion #274

@NyanHelsing NyanHelsing force-pushed the ft/move-orphan-delete branch 6 times, most recently from 6318684 to b2dcd9f Compare April 11, 2018 19:55
Copy link
Contributor

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

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

As discussed, please finish the implementation according to the final discussion in #274. Back to Add'l Dev 🔥

Copy link
Contributor

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

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

@birdbrained Thanks for the rebase 👍 and please fix travis 🔥 .

AddisonSchiller and others added 11 commits June 5, 2018 12:04
Fixing an issue where when a child component is hooked up
To a project, and they share the same provider, it is
possible to silently delete files
[#SVCS-479] Replace folder from inside folder deletes both

Add replace_will_orphan(src_path,dest_path)
Checks if dest_path overwrite will orphan src_path
Call replace_will_orphan in copy/move defs in waterbutler.core.provider
SVCS-479

Move three pieces of overwrite conflict logic from move/copy into
handle_naming and rename handle_naming to handle_conflict. Improved
logic and reduced code.
There was some places where the http method 'get' was written in
lowercase. this was changed to upper case to match the rest of the
codebase, and broke some tests. This fixes those tests also.
Box's validate_v1_path http method name should be lowercase.
@coveralls
Copy link

coveralls commented Jun 5, 2018

Coverage Status

Coverage decreased (-0.003%) to 91.981% when pulling e012a51 on birdbrained:ft/move-orphan-delete into 5c637a2 on CenterForOpenScience:develop.

Copy link
Contributor

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

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

This PR is blocked by: #341. Work will continue once that PR has been merged.

@NyanHelsing
Copy link
Contributor Author

@cslzchen Can you note here what specifically blocks this PR that is resolved by #341?

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.

5 participants