Skip to content

utils/fs: checking files ownership in 'move' (#4348)#4832

Merged
pared merged 5 commits into
treeverse:masterfrom
danielfleischer:check-ownership
Nov 12, 2020
Merged

utils/fs: checking files ownership in 'move' (#4348)#4832
pared merged 5 commits into
treeverse:masterfrom
danielfleischer:check-ownership

Conversation

@danielfleischer
Copy link
Copy Markdown

@danielfleischer danielfleischer commented Nov 3, 2020

Files are checked for ownership by trying to chmod them before moving them around; if fail, return a verbose exception.
Previous behavior: moving files to a temp folder and then do the check; when fail, files seemed to be missing.

Should fix #4348 and maybe fix #2992.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

Comment thread dvc/utils/fs.py Outdated
Copy link
Copy Markdown
Contributor

@pared pared left a comment

Choose a reason for hiding this comment

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

Looks great! One minor thing

Comment thread dvc/utils/fs.py Outdated
Comment thread dvc/utils/fs.py Outdated
If error related to access/permission, throw the newly created
FileOwnershipError exception, otherwise throw the OSError as is.
@pared
Copy link
Copy Markdown
Contributor

pared commented Nov 9, 2020

@danielfleischer looks good, the tests test_add_symlink_file seems to be failing on windows due to this change.

Using the function _unlink which includes error handling.
@danielfleischer
Copy link
Copy Markdown
Author

Made a small fix; used _unlink instead, it's safer. Now all Windows tests pass.

@pared pared requested review from efiop, pmrowla and skshetry November 11, 2020 13:03
@pared pared merged commit 8e73826 into treeverse:master Nov 12, 2020
@pared
Copy link
Copy Markdown
Contributor

pared commented Nov 12, 2020

@danielfleischer Thank you very much!

@efiop efiop added the enhancement Enhances DVC label Nov 18, 2020
efiop pushed a commit that referenced this pull request Jan 24, 2021
Fixes #5255

We need a proper solution for #4832, will introduce later.

This reverts commit 8e73826.
efiop added a commit that referenced this pull request Jan 24, 2021
…#5321)

Fixes #5255

We need a proper solution for #4832, will introduce later.

This reverts commit 8e73826.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhances DVC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parquet file owned by other user gets deleted upon dvc add better message when trying to link from files that belong to another user

5 participants