Add debug logging for VM/LXC backup-skip decisions#16
Draft
nomis52 wants to merge 2 commits into
Draft
Conversation
The stopped-guest skip logic in determineBackups only logged the successful-skip case, and at debug level. With debug logging enabled a guest that was unexpectedly backed up left no trace of why the skip branch was not taken. Add debug lines exposing the raw comparison inputs at each decision point: a per-resource evaluation dump (status, type, last_backup), the stop-time comparison (stopped_at, stop_time_found, backup_after_stop) logged before the skip test rather than only when it fires, and explicit select/skip lines for the age check. resource.Type is now included so VMs (qemu) and LXCs (lxc) are distinguishable in the logs. No behavioural change; logging only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
make fmt ran go fmt repo-wide and git add -A swept 13 pre-existing, non-gofmt-clean files into the previous commit. Restore them to their master state so this PR is scoped to the logging change alone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The backup workflow skips a stopped VM/LXC when its most recent backup already post-dates the guest's last power-off. The skip logic wasn't visibly firing — debug logging was enabled but the existing
"Skipping stopped VM already backed up after power-off"line never appeared, and nothing logged the inputs to the decision, so there was no way to see which condition was failing.Changes
All confined to
determineBackupsinworkflows/backup/backup_vms.go; logging only, no behavioural change:status,type,last_backupat the top of the loop, immediately revealing e.g. ifstatusisn't the literal"stopped"the code compares against.stopped_at,stop_time_found, andbackup_after_stopon the success path (before the skip test, not only when it fires), pinpointing whether the stop-task lookup returnedfound=falseor the timestamps didn't line up.resource.Type(qemu/lxc) added throughout so VMs and LXCs are distinguishable.Verification
make fmt && make build && make testall pass.🤖 Generated with Claude Code