Skip to content

checkout: ensure subdirs are deleted before parent dir#601

Merged
skshetry merged 2 commits into
treeverse:mainfrom
baleian:diff
Apr 29, 2025
Merged

checkout: ensure subdirs are deleted before parent dir#601
skshetry merged 2 commits into
treeverse:mainfrom
baleian:diff

Conversation

@baleian
Copy link
Copy Markdown
Contributor

@baleian baleian commented Apr 22, 2025

@shcheklein shcheklein requested a review from skshetry April 22, 2025 18:35
@baleian
Copy link
Copy Markdown
Contributor Author

baleian commented Apr 26, 2025

Hi @skshetry ,

For more information, analysis of the linked issue's cause revealed the following:
during the deletion of deleted_dirs, if the process attempts to delete a parent directory before removing its nested children first, this deletion attempt is ignored by the try-catch block. This occurs because the parent directory is not yet empty.

To prevent this, we now perform reverse sorting beforehand to ensure that child directories targeted for removal are attempted first.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.53%. Comparing base (e38c8c2) to head (69f9ce0).
Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #601      +/-   ##
==========================================
+ Coverage   72.42%   73.53%   +1.10%     
==========================================
  Files          67       66       -1     
  Lines        5132     5037      -95     
  Branches      605      588      -17     
==========================================
- Hits         3717     3704      -13     
+ Misses       1227     1144      -83     
- Partials      188      189       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@skshetry skshetry merged commit 1e71489 into treeverse:main Apr 29, 2025
18 of 19 checks passed
@skshetry
Copy link
Copy Markdown
Collaborator

Thank you for contributing. :)

skshetry added a commit to skshetry/dvc that referenced this pull request Apr 29, 2025
See treeverse/dvc-data#601 that fixed the issue.
The test is based on reproduction steps from:
treeverse#4344 (comment)
skshetry added a commit to treeverse/dvc that referenced this pull request Apr 29, 2025
See treeverse/dvc-data#601 that fixed the issue.
The test is based on reproduction steps from:
#4344 (comment)
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.

Empty subdirectories left in place while checking out previous version of the datasets

3 participants