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

Add flags to borg extract Command (#8564) #8575

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

alighazi288
Copy link

@alighazi288 alighazi288 commented Nov 29, 2024

Summary

This pull request addresses the issue with the borg extract command not displaying the flags as seen in other commands eg. borg create and borg recreate.

@ThomasWaldmann
Copy link
Member

BTW, don't add coverage.* files to the repo, these are temporary files.

@alighazi288
Copy link
Author

Got it, I’ll ensure temporary files are omitted moving forward. Could you please share more details or context about the errors above? This would help me better understand and address the issue.

Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

some more feedback.

src/borg/testsuite/archiver/extract_cmd_test.py Outdated Show resolved Hide resolved
src/borg/testsuite/archiver/extract_cmd_test.py Outdated Show resolved Hide resolved
src/borg/archiver/extract_cmd.py Outdated Show resolved Hide resolved
@ThomasWaldmann
Copy link
Member

The failing test_return_codes test is because borg extract is used there and expected to finish with rc 0, but it crashes and returns rc 2.

@alighazi288
Copy link
Author

Changed the code and now everything seems to be running as expected at my end and borg extract finishes with rc 0. Just wanted to ask if the errors could be because of me working on MacOS and not having pyfuse3?

src/borg/archiver/extract_cmd.py Outdated Show resolved Hide resolved
src/borg/archiver/extract_cmd.py Outdated Show resolved Hide resolved
@ThomasWaldmann
Copy link
Member

The errors are unrelated to macOS and not having pyfuse3 - I also work on a macbook.

If one want to test or work on the mount / FUSE code in borg, one would need macFUSE installed and use llfuse (not pyfuse3). But this is not required here.

@alighazi288
Copy link
Author

@ThomasWaldmann Please review.

Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

This is getting tricky.

src/borg/archiver/extract_cmd.py Outdated Show resolved Hide resolved
src/borg/archiver/extract_cmd.py Outdated Show resolved Hide resolved
src/borg/archiver/extract_cmd.py Outdated Show resolved Hide resolved
src/borg/archiver/extract_cmd.py Outdated Show resolved Hide resolved
src/borg/archiver/extract_cmd.py Outdated Show resolved Hide resolved
@ThomasWaldmann
Copy link
Member

Can you rather rebase on master please than merge master in here?

@alighazi288 alighazi288 force-pushed the fix-issue-8564 branch 5 times, most recently from 5b617be to c9527a4 Compare December 24, 2024 22:43
Ensure preloading only for included items.

large amount of changes due to rebase mishap
@alighazi288
Copy link
Author

alighazi288 commented Dec 25, 2024

@ThomasWaldmann I wanted to let you know that there appears to be a large number of changes in this pull request because I encountered some issues while attempting to rebase on master. I apologize for any confusion this may have caused.

This is the most recent commit: 8404970

Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

That looks quite ok now, some minor things todo!

src/borg/archiver/extract_cmd.py Outdated Show resolved Hide resolved
src/borg/archiver/extract_cmd.py Show resolved Hide resolved
Copy link

codecov bot commented Dec 25, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.84%. Comparing base (694fa93) to head (e38be0d).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/borg/archiver/extract_cmd.py 92.85% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8575   +/-   ##
=======================================
  Coverage   81.84%   81.84%           
=======================================
  Files          74       74           
  Lines       13311    13317    +6     
  Branches     1960     1961    +1     
=======================================
+ Hits        10894    10899    +5     
  Misses       1755     1755           
- Partials      662      663    +1     

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

@@ -66,7 +67,10 @@ def do_extract(self, args, repository, manifest, archive):

is_matched = matcher.match(orig_path)
log_prefix = "+" if is_matched else "-"
logging.getLogger("borg.output.list").info(f"{log_prefix} {remove_surrogates(item.path)}")

# Conditionally log based on the output_list flag
Copy link
Member

Choose a reason for hiding this comment

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

please avoid such comments. it does not add any information that is not obvious from the next 2 lines anway.

Copy link
Author

Choose a reason for hiding this comment

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

Understood. Would you like me to remove it and commit again?

@alighazi288 alighazi288 changed the title Add Dry-Run Flags to borg extract Command (#8564) Add flags to borg extract Command (#8564) Dec 26, 2024
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.

2 participants