feat: dashboard stats fallback for externally managed repos - #1322
Open
Yeraze wants to merge 2 commits into
Open
feat: dashboard stats fallback for externally managed repos#1322Yeraze wants to merge 2 commits into
Yeraze wants to merge 2 commits into
Conversation
For repos whose backups are managed outside of backrest, the dashboard now populates ProtectedBytes and TotalSnapshots from the most recent OperationStats when no OperationBackup data is available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
Interested people can test this by pulling the container from ghcr.io/yeraze/backrest:dev |
… repos For repos whose backups are managed outside backrest, the dashboard now: - Shows Check/Prune/Forget/Stats operations in the 30-day history strip instead of showing every day as "Missing" - Displays "Managed externally" state label (blue) instead of "No backups yet" when the repo has snapshots but no backup operations - Adds observeMaintenance() to track non-backup ops in per-day buckets without affecting backup-specific counters Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
works fine for me, thanks |
|
like @Yeraze , i would like to see this merged as well @garethgeorge |
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.
Summary
Closes issue #1257
For repos whose restic backups are managed outside of backrest (no plans configured), the dashboard repo cards currently show empty stats. This change makes the dashboard fall back to the most recent
OperationStatsdata when noOperationBackupoperations exist for a repo:ProtectedBytesfromRepoStats.TotalSizeandTotalSnapshotsfromRepoStats.SnapshotCountRepoCardalready rendersprotectedByteswhen > 0ProtectedBytes == 0(i.e., no backup operations have set it), so repos with plans are unaffectedChanges
internal/api/summarydashboard.go— During the oplog walk, also capture the most recentOperationStatsper repo GUID. After finalize, apply the fallback for repos without backup data.internal/api/backresthandler_test.go— NewTestGetSummaryDashboardStatsFallbackverifying the fallback behavior for a repo with only stats operations and no backups.Test plan
TestGetSummaryDashboard*tests pass (5 existing + 1 new)