Expand description
Turn kopia’s raw stderr tail into a tight, operator-readable extract.
kopia prints a lot to stderr: a running progress meter (… 95.0% 12s left),
per-shard bookkeeping, and — buried among it — the one line that actually
explains the failure. The raw tail also carries per-attempt volatile
fragments like .shards.tmp.9f3ac1, whose randomness is exactly what once
caused a reconcile hot-loop when it leaked into a status condition.
humanize_tail extracts the salient error line(s), drops the progress
noise, and strips the volatile temp fragments — deterministically, so the same
failure always renders the same string. It feeds
KopiaError’s Display (which flows to Warning
Events, status.failure.message, and logs); the full raw tail is preserved
separately in the error’s stderr_tail field for status.failure.stderrTail.
Pure string work only — no allocation-heavy regex crate, no new dependencies.
Functions§
- exit_
code_ desc - Render a process exit code for an operator, without the
Some(1)Debugleak the old{code:?}interpolation produced. - humanize_
tail - Extract the actionable part of a kopia stderr tail: drop progress/noise lines,
strip volatile temp-path fragments, and keep at most the last few salient
lines (newest last), joined with
;so the result stays a single line.