config bootstrap CLI parsing issues #712
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#712
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
As part of developing another feature (#529), I found a few edge cases where the new
config bootstrap
action (#697) doesn't work quite as intended on the command-line.First issue: Steps to reproduce
First issue: Actual behavior
First issue: Expected behavior
Successful bootstrap with verbosity level 1.
Second issue: Steps to reproduce
Second issue: Actual behavior
Second issue: Expected behavior
Error about unknown
bootstrap
action or similar, as the parentconfig
action is missing.Other notes / implementation ideas
Some of this might be a side effect of the
bootstrap
argument parser "living" at the top level alongside the other parsers.Environment
borgmatic version: main (these issues do not occur in any released versions)
borgmatic installation method: pip editable
Borg version: 1.2.4
Python version: 3.10.10
Database version (if applicable): n/a
operating system and version: Manjaro stable
I have a fix in hand. I may have, uh, majorly refactored all of argument parsing though as part of this. Currently working on tests....
Done and pushed. High-level, even before #697, argument parsing was kind of a complexity farm, having gotten that way through gradual accretion. So it wasn't a great foundation upon which to build the #697
config bootstrap
feature. As part of fixing this ticket, I did a refactor of argument parsing both to support thebootstrap
use cases and all the other random argument parsing use cases that code needed to support. I think the end result is still quite complex and more than a little brittle, but some of the incidental complexity has been stripped away.Summary of changes:
parse_known_args()
calls. There's a single pass now.I want to emphasize that this is largely me cleaning up long-standing tech debt in this area of code while still trying to incorporate and support your changes from #697.
Found another couple...
3. Steps to reproduce
3. Actual behavior
3. Expected behavior
Successful bootstrap with verbosity level 1.
...
4. Steps to reproduce
4. Actual behavior
4. Expected behavior
The
config
action is not treated as a second configuration file, the actual configuration file is ignored, and the bootstrap proceeds as per normal.Just released in borgmatic 1.7.15.