What was wrong: shallow snapshot verify counted every error from checking a blob or the encrypted database as "missing": a permission error, an S3 403 or a network error read as data loss, and the real error was printed nowhere.
What changed: only a not-found answer from storage counts as missing. Any other error is reported as could not be checked, with the error storage returned, and the run fails:
text report: a Could not check: line per blob naming the hash and the error, a count in the summary, and an Encrypted database: could not be checked line carrying the error;
--json: an unchecked list of hash and error pairs, and a database_check_error field;
--quiet (and --cron), which drop the report: each of those errors is logged as a warning on stderr, alongside the failure the command ends with.
The database check moved into its own small function, checkSnapshotDatabase, because VerifySnapshotWithOptions was at the linter's function-length limit.
The new --quiet test is not parallel: it captures the process's stderr, as the snapshot list stderr tests do.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/vaultik/issues/318.
**What was wrong:** shallow `snapshot verify` counted every error from checking a blob or the encrypted database as "missing": a permission error, an S3 403 or a network error read as data loss, and the real error was printed nowhere.
**What changed:** only a not-found answer from storage counts as missing. Any other error is reported as could not be checked, with the error storage returned, and the run fails:
- text report: a `Could not check:` line per blob naming the hash and the error, a count in the summary, and an `Encrypted database: could not be checked` line carrying the error;
- `--json`: an `unchecked` list of `hash` and `error` pairs, and a `database_check_error` field;
- `--quiet` (and `--cron`), which drop the report: each of those errors is logged as a warning on stderr, alongside the failure the command ends with.
The database check moved into its own small function, `checkSnapshotDatabase`, because `VerifySnapshotWithOptions` was at the linter's function-length limit.
The new `--quiet` test is not parallel: it captures the process's stderr, as the `snapshot list` stderr tests do.
Model: opus-5-5
Under --quiet the storage error is still printed nowhere (internal/vaultik/snapshot.go, verifyManifestBlobs, formatVerifyResult, shallowVerifyFailure). The Could not check lines and the summary are skipped, and the failure the command ends with says only "N blobs could not be checked" or "the encrypted database could not be checked". That is the defect #318 reports, left in place for quiet runs, where a transient error is lost for good; the README says --quiet suppresses only non-error output. Acceptable: under --quiet the error storage returned, for each blob and for the database, still reaches stderr.
The new test does not pin that a blob or database that could not be checked fails the run (internal/vaultik/shallow_verify_test.go, TestShallowVerifyReportsStatErrorsApartFromMissing). It always deletes a blob in the same run, so verify fails whatever else happens; the test would still pass if those two cases stopped failing the run, and a snapshot whose only problem is a blob storage could not check would then verify as OK. Acceptable: a run whose only problem is a blob that could not be checked, and one whose only problem is the database, each asserting that verify fails.
Model: opus-5-5
1. Under `--quiet` the storage error is still printed nowhere (`internal/vaultik/snapshot.go`, `verifyManifestBlobs`, `formatVerifyResult`, `shallowVerifyFailure`). The `Could not check` lines and the summary are skipped, and the failure the command ends with says only "N blobs could not be checked" or "the encrypted database could not be checked". That is the defect https://git.eeqj.de/sneak/vaultik/issues/318 reports, left in place for quiet runs, where a transient error is lost for good; the README says `--quiet` suppresses only non-error output. Acceptable: under `--quiet` the error storage returned, for each blob and for the database, still reaches stderr.
2. The new test does not pin that a blob or database that could not be checked fails the run (`internal/vaultik/shallow_verify_test.go`, `TestShallowVerifyReportsStatErrorsApartFromMissing`). It always deletes a blob in the same run, so verify fails whatever else happens; the test would still pass if those two cases stopped failing the run, and a snapshot whose only problem is a blob storage could not check would then verify as OK. Acceptable: a run whose only problem is a blob that could not be checked, and one whose only problem is the database, each asserting that verify fails.
Model: opus-5-5
Shallow snapshot verify counted every error from checking a blob or the
encrypted database as "missing" and printed the error nowhere, so a
permission error or an S3 403 read as data loss. Now only a not-found
answer from storage counts as missing. Any other error is reported as
could not be checked, with the error storage returned, in the text
report and under --json (the new unchecked list and
database_check_error field), and the run fails. Under --quiet, which
drops the report, each of those errors is logged as a warning on
stderr.
The database check moved into its own small function because the verify
function was at the linter's length limit.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #318.
What was wrong: shallow
snapshot verifycounted every error from checking a blob or the encrypted database as "missing": a permission error, an S3 403 or a network error read as data loss, and the real error was printed nowhere.What changed: only a not-found answer from storage counts as missing. Any other error is reported as could not be checked, with the error storage returned, and the run fails:
Could not check:line per blob naming the hash and the error, a count in the summary, and anEncrypted database: could not be checkedline carrying the error;--json: anuncheckedlist ofhashanderrorpairs, and adatabase_check_errorfield;--quiet(and--cron), which drop the report: each of those errors is logged as a warning on stderr, alongside the failure the command ends with.The database check moved into its own small function,
checkSnapshotDatabase, becauseVerifySnapshotWithOptionswas at the linter's function-length limit.The new
--quiettest is not parallel: it captures the process's stderr, as thesnapshot liststderr tests do.Model: opus-5-5
Under
--quietthe storage error is still printed nowhere (internal/vaultik/snapshot.go,verifyManifestBlobs,formatVerifyResult,shallowVerifyFailure). TheCould not checklines and the summary are skipped, and the failure the command ends with says only "N blobs could not be checked" or "the encrypted database could not be checked". That is the defect #318 reports, left in place for quiet runs, where a transient error is lost for good; the README says--quietsuppresses only non-error output. Acceptable: under--quietthe error storage returned, for each blob and for the database, still reaches stderr.The new test does not pin that a blob or database that could not be checked fails the run (
internal/vaultik/shallow_verify_test.go,TestShallowVerifyReportsStatErrorsApartFromMissing). It always deletes a blob in the same run, so verify fails whatever else happens; the test would still pass if those two cases stopped failing the run, and a snapshot whose only problem is a blob storage could not check would then verify as OK. Acceptable: a run whose only problem is a blob that could not be checked, and one whose only problem is the database, each asserting that verify fails.Model: opus-5-5
bf8bf5f49cto8b684320058b68432005to670c5703be670c5703beto3dbe4306593dbe430659to8a8793c2c0View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.