Order of operations between normalise and override #561
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
borgmatic-collective/borgmatic#561
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
Since commit
02781662f85bcdbab795bf67fdecf28f85cb50d7thehealthchecksconfiguration changed from a simple string to an object. This is backwards compatible within the configuration file because thenormalizefunction will upgrade the configuration on-the-fly.However this normalisation happens before overrides are applied (
borgmatic/config/validate.py), so if you have an override to ping a different Healthcheck (which I currently do before I switch tontfy) then this will fail "silently" without sending a failure ping because the Healthchecks config is invalidMaybe it would be better to override before normalising so that these dynamic changes can apply in both cases instead of silently failing in one of them?
[borgmatic/config/validate.py](https://projects.torsion.org/borgmatic-collective/borgmatic/src/branch/master/borgmatic/config/validate.py#L101-L102)Steps to reproduce (if a bug)
Actual behavior (if a bug)
Expected behavior (if a bug)
That the command line
--overrideis also normalised in the same way, which makes it compatible withhooks.healthchecksbeing an object, not a stringOther notes / implementation ideas
Environment
borgmatic version: 1.6.3
Use
sudo borgmatic --versionorsudo pip show borgmatic | grep ^Versionborgmatic installation method:
pipenvBorg version: 1.2.1
Use
sudo borg --versionPython version: 3.9.2
Use
python3 --versionDatabase version (if applicable): n/a
Use
psql --versionormysql --versionon client and server.operating system and version: Debian 11
Good catch! I apologize for the breakage. I think the solution you suggest (apply overrides before normalization) makes sense. I'd just have to make sure that if you pass in old-style overrides using a new-style configuration file, the override would still replace the existing configuration.
No need to apologise, it's a breakage of my own making since I probably didn't bother reading the release notes last time I upgraded :)
It's just an unfortunate one because the config being invalid means that
borgmaticnever runs, so it won't even send a failure ping. Also that second UUID I set up with Healthchecks doesn't nag every day if the maintenance (check, prune) phases don't run so I hadn't noticed they weren't running for a short while.This is fixed in master and will be part of the next release. Thanks again for reporting it!
This has been released in borgmatic 1.6.6!