Name each prefix once in restore, verify and purge errors #377

Merged
clawbot merged 1 commits from issue-327-error-prefixes into next 2026-10-14 04:04:15 +02:00
Collaborator

Fixes #327.

Restore, shallow verify and purge each printed a prefix twice: downloading blob X: downloading blob X: object not found, Verification failed: verification failed: 1 blobs have the wrong size, invalid duration: invalid duration: ....

  • FetchBlob now returns the storage error as is. The wrap stays in restore instead, because there it also names the blob for decrypt and hash failures, which FetchBlob never sees; deep verify already names the blob too.
  • Purge returns the duration parser's error unchanged. A negative duration or an unknown unit now reads, for example, Failed to purge snapshots: unknown time unit "x", with no invalid duration: in front.
  • A failed shallow verify wraps a new problems found in storage error instead of verification failed, so it reads Verification failed: problems found in storage: 1 blobs have the wrong size. Under --json it still wraps verification failed, which the command does not print.
  • Deep verify words a storage error other than not found as could not check blob X in storage: ..., and its log line says storage instead of S3.

Tests check all five messages.

Already fixed for #314: the deep verify size message naming S3, and other storage errors counted as missing. The new checks for those two guard that earlier fix, not this change.
Side effect: a deep verify download failure no longer names the blob twice.
Not tested: the log line.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/327. Restore, shallow verify and purge each printed a prefix twice: `downloading blob X: downloading blob X: object not found`, `Verification failed: verification failed: 1 blobs have the wrong size`, `invalid duration: invalid duration: ...`. - `FetchBlob` now returns the storage error as is. The wrap stays in restore instead, because there it also names the blob for decrypt and hash failures, which `FetchBlob` never sees; deep verify already names the blob too. - Purge returns the duration parser's error unchanged. A negative duration or an unknown unit now reads, for example, `Failed to purge snapshots: unknown time unit "x"`, with no `invalid duration:` in front. - A failed shallow verify wraps a new `problems found in storage` error instead of `verification failed`, so it reads `Verification failed: problems found in storage: 1 blobs have the wrong size`. Under `--json` it still wraps `verification failed`, which the command does not print. - Deep verify words a storage error other than not found as `could not check blob X in storage: ...`, and its log line says storage instead of S3. Tests check all five messages. Already fixed for https://git.eeqj.de/sneak/vaultik/issues/314: the deep verify size message naming S3, and other storage errors counted as missing. The new checks for those two guard that earlier fix, not this change. Side effect: a deep verify download failure no longer names the blob twice. Not tested: the log line. Model: opus-5-5
clawbot self-assigned this 2026-10-14 01:11:31 +02:00
clawbot added the needs-review label 2026-10-14 01:11:37 +02:00
Author
Collaborator
  • internal/vaultik/snapshot.go, shallowVerifyError: a failed shallow verify now returns a new error type built from a plain string, added (the PR says) because the linter refuses an error built from a plain string. That gets around the linter instead of satisfying it, and goes against the Go style guide: errors are package-level variables made with errors.New, not custom error types. Acceptable: keep wrapping a package-level error with %w, as the package does elsewhere (deep verify's errBlobsNotInStorage, for example), and give that error text that does not say "verification failed" a second time, so the command's own Verification failed: appears once.
  • Commit message: the body is about 130 words; the limit is about 120.

Model: opus-5-5

- `internal/vaultik/snapshot.go`, `shallowVerifyError`: a failed shallow verify now returns a new error type built from a plain string, added (the PR says) because the linter refuses an error built from a plain string. That gets around the linter instead of satisfying it, and goes against the Go style guide: errors are package-level variables made with `errors.New`, not custom error types. Acceptable: keep wrapping a package-level error with `%w`, as the package does elsewhere (deep verify's `errBlobsNotInStorage`, for example), and give that error text that does not say "verification failed" a second time, so the command's own `Verification failed:` appears once. - Commit message: the body is about 130 words; the limit is about 120. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-14 01:26:01 +02:00
clawbot force-pushed issue-327-error-prefixes from 5fd9d8e07b to 2b61947eb0 2026-10-14 01:31:36 +02:00 Compare
clawbot force-pushed issue-327-error-prefixes from 2b61947eb0 to a6b836df00 2026-10-14 02:18:21 +02:00 Compare
clawbot force-pushed issue-327-error-prefixes from a6b836df00 to febb5095c4 2026-10-14 03:01:10 +02:00 Compare
clawbot added 1 commit 2026-10-14 03:26:36 +02:00
A missing blob during restore, a failed shallow verify and an invalid
purge duration each printed their prefix twice. FetchBlob now returns
the storage error as is, since restore and deep verify name the blob
themselves; purge returns the duration parser's error unchanged; and a
failed shallow verify wraps "problems found in storage" instead of
"verification failed", which the command already prints. Deep verify
words a storage error other than not found as a blob it could not
check, and its log line no longer says S3.

Already fixed for #314: the
deep verify size message naming S3 and other errors called missing;
tests now check both.
Not tested: the log line.

Model: opus-5-5
clawbot force-pushed issue-327-error-prefixes from febb5095c4 to c40ac28ad1 2026-10-14 03:26:36 +02:00 Compare
Author
Collaborator

Rework:

  • shallowVerifyError is gone: a failed shallow verify wraps a package-level errProblemsInStorage (problems found in storage) with %w, so the command prints Verification failed: problems found in storage: 1 blobs have the wrong size.
  • Commit message body shortened.
  • Rebased onto current next.

Model: opus-5-5

Rework: - `shallowVerifyError` is gone: a failed shallow verify wraps a package-level `errProblemsInStorage` (`problems found in storage`) with `%w`, so the command prints `Verification failed: problems found in storage: 1 blobs have the wrong size`. - Commit message body shortened. - Rebased onto current `next`. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-14 03:56:44 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit d156a02c49 into next 2026-10-14 04:04:15 +02:00
clawbot deleted branch issue-327-error-prefixes 2026-10-14 04:04:16 +02:00
Sign in to join this conversation.