-
Notifications
You must be signed in to change notification settings - Fork 170
Fix exclusion handling for source size estimation #2206
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
Conversation
|
This will pass more exclusions to the function sizing directories. So it's an improvement. It does NOT fix #2115 because it won't catch long filename errors from the OS. It also won't cover all exclusions, since the path is only compared as Regex, while Borg supports many more exclusion patterns. I'm still OK to merge this, since it improves something. |
|
Let us know when you tested this and we'll merge it. |
|
I've now tested this; it appears to work fine, the estimated size goes way down if I add a large directory to the "custom" tab (and the estimated size with no custom/preset options selected agrees with the stable Vorta I have installed). |
m3nu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Code Review
PR: #2206 - Fix exclusion handling for source size estimation
Branch: push-vmkyyknpmvty → master
Changes: +2 / -2 lines across 2 files
📋 Summary
This PR fixes source size estimation to use the complete set of exclusion patterns (presets, custom, and raw) rather than just raw exclusions. It also correctly handles comment lines in exclusion patterns as per Borg's documented behavior.
📏 Rules Applied
- Project config:
.claude-review.yml✗ - CLAUDE.md conventions: ✓
- Default rules: ✓
✅ What's Good
- Correct Borg compatibility: Lines starting with
#are now properly treated as comments, matching Borg's pattern syntax - Consistent exclusions: Uses
get_combined_exclusion_string()which is the same method used byBorgCreateJob(seecreate.py:183), ensuring size estimation matches actual backup behavior - Synergistic changes: The two modifications work together -
get_combined_exclusion_string()includes comment headers like# custom added rules, and the parser now correctly skips them - Minimal impact: Small, focused changes that solve the reported issue without unnecessary modifications
🔍 Review Details
0 inline comment(s) added.
| Severity | Count |
|---|---|
| 🔴 Error | 0 |
| 🟡 Warning | 0 |
| 🔵 Info | 0 |
📊 Verdict: APPROVE ✅
The changes correctly address issue #2115 by ensuring source size estimation uses all configured exclusions, preventing over-estimation and potential crashes when traversing directories like /proc or /run.
🤖 Reviewed by Claude Code
Description
Firstly: if there's an exclude pattern that starts with a
#, it should be ignored when doing source size estimation. Seeborg help patterns:Secondly: rather than just using the profile's
exclude_patterns(text entered in the "raw" exclusions tab), we should estimate source size based on the combined set of patterns from the profile, includingExclusionModeletc. (the "presets" and "custom" tabs) – we do this by using the conveniently namedget_combined_exclusion_string()method.Related Issue
Fixes part of #2115.
Motivation and Context
Previously, only the "raw" exclusions were used when estimating size of a backup source, not the "presets" or "custom" exclusions. (All exclusions were still passed to Borg for the actual backup.) This could lead to over-estimating the amount of material to be backed up, or even traversing parts of the filesystem that should be ignored, like
/procor/run, and potentially crashing Vorta.How Has This Been Tested?
I have not, yet, tested this – I have an ongoing backup I'd rather not interrupt, and running two instances of Vorta at the same time seems like a bad idea. I can do so next weekend, probably.
Screenshots (if appropriate):
Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.