Report comparison cleanup recovery state

This commit is contained in:
2026-08-13 03:18:55 +00:00
parent 302f5aba2d
commit 79cba800ee
11 changed files with 228 additions and 51 deletions

View File

@@ -225,7 +225,7 @@ func safeComparisonSummaryError(err error) *comparison.SafeError {
}
var cleanupErr *comparison.PublicationCleanupError
if errors.As(err, &cleanupErr) {
safe := comparison.NewSafeError("publication_cleanup", "comparison published but cleanup did not complete")
safe := comparison.NewSafeError("publication_cleanup", publicationCleanupMessage(cleanupErr.RecoveryState))
return &safe
}
var destinationErr *comparison.DestinationError
@@ -249,6 +249,19 @@ func safeComparisonSummaryError(err error) *comparison.SafeError {
return &safe
}
func publicationCleanupMessage(state comparison.BackupRecoveryState) string {
switch state {
case comparison.BackupRecoveryComplete:
return "comparison published but a complete prior bundle remains"
case comparison.BackupRecoveryPartial:
return "comparison published but partial cleanup remnants remain"
case comparison.BackupRecoveryAbsent:
return "comparison published but no prior bundle remains"
default:
return "comparison published but cleanup recovery state is unknown"
}
}
func comparisonAggregateErrorMessage(err error) (string, bool) {
const prefix = "comparison completed with "
const suffix = " failed profiles"