WIP: Add ntfy warning #664
No reviewers
Labels
No Label
blocked
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#664
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "phfn/borgmatic:ntfy-warn"
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?
Add a ntfy warn hook. See: borgmatic-collective/borgmatic#606
Still needs documentation. Also, if it'n not to complicated, i would add a
on_warning
hook.Thanks for diving into a PR for this! I really appreciate it.
The changes you've made to
ntfy
schema look like they would totally work. But if I'm reading the rest of the code correctly, I'm not sure the approach works for a couple reasons—one pretty easily surmountable and one more thorny:exit_code_indicates_error()
section withinlog_outputs()
, it does a bunch of cleanup stuff before raising. This includes gathering log output to stuff into the exception, killing other processes to prevent hangs, etc. So you'd presumably need to do at least some of that if raising for warnings as well. Also, don't forget thecaptured_outputs
return at the bottom oflog_outputs()
.command/borgmatic.py
. That means if you runborgmatic create check
, for instance, and Borg issues a warning duringcreate
, that'll prevent thecheck
from happening entirely.So my reaction is that using a raised exception to signal a warning state won't achieve what you're looking for—finding out about Borg warnings without interrupting borgmatic. If you wanted to address this issue, I think it would have to be by doing something like: Let borgmatic run its course normally, and then after all actions run, check if any of them exited with warnings. That information is unfortunately not readily available now, but it could potentially be bubbled up through successive calls and collected at the
commands/borgmatic.py
level. Then you could confidently ping monitors includingntfy
with the warning.I'm of course open to other approaches, especially if I'm missing something here!
Hey @phfn, I'm just checking in on this PR. Do you intend to follow up when you get a chance? I realize the work item may have gotten a little bigger in scope than you originally expected.
Hey, yeah the work actually was a bit bigger than i thought. I'm still interested in, but currently i'm working on my Thesis, so i don't have much time left. You can close this PR and i'll open one, when i have more time.
No worries! A Thesis sounds more important. 😄 I'll close this for now, but you can always reopen it or submit a new one. Thanks!
Pull request closed