initSchema in db.go stops scan when the database's PRAGMA user_version is neither 0 (a fresh database) nor schemaVersion. No test reaches that branch, so deleting it still passes every test. The only version-mismatch test, TestOpenReportDatabaseVersionMismatch in db_test.go, goes through openReportDatabase, the check used by report and trees. This gap predates #62.
Definition of done:
A test stamps a database with a version other than 0 and schemaVersion, opens it through openScanDatabase, and requires errSchemaVersion.
With the default: branch of initSchema removed, that test fails.
make check is green.
#58 adds a test for the unversioned case in the same function and test file, so whichever lands second rebases onto the other.
Model: opus-5-5
`initSchema` in `db.go` stops `scan` when the database's `PRAGMA user_version` is neither 0 (a fresh database) nor `schemaVersion`. No test reaches that branch, so deleting it still passes every test. The only version-mismatch test, `TestOpenReportDatabaseVersionMismatch` in `db_test.go`, goes through `openReportDatabase`, the check used by `report` and `trees`. This gap predates https://git.eeqj.de/sneak/sfdupes/pulls/62.
Definition of done:
- A test stamps a database with a version other than 0 and `schemaVersion`, opens it through `openScanDatabase`, and requires `errSchemaVersion`.
- With the `default:` branch of `initSchema` removed, that test fails.
- `make check` is green.
https://git.eeqj.de/sneak/sfdupes/pulls/58 adds a test for the unversioned case in the same function and test file, so whichever lands second rebases onto the other.
Model: opus-5-5
clawbot
added this to the 1.0.0 milestone 2026-09-23 13:51:24 +02:00
clawbot
self-assigned this 2026-09-23 13:51:24 +02:00
The version-mismatch test in db_test.go now also opens its database through openScanDatabase and requires errSchemaVersion; it fails with the default: branch of initSchema removed. PR: #82
Model: opus-5-5
The version-mismatch test in `db_test.go` now also opens its database through `openScanDatabase` and requires `errSchemaVersion`; it fails with the `default:` branch of `initSchema` removed. PR: https://git.eeqj.de/sneak/sfdupes/pulls/82
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.
initSchemaindb.gostopsscanwhen the database'sPRAGMA user_versionis neither 0 (a fresh database) norschemaVersion. No test reaches that branch, so deleting it still passes every test. The only version-mismatch test,TestOpenReportDatabaseVersionMismatchindb_test.go, goes throughopenReportDatabase, the check used byreportandtrees. This gap predates #62.Definition of done:
schemaVersion, opens it throughopenScanDatabase, and requireserrSchemaVersion.default:branch ofinitSchemaremoved, that test fails.make checkis green.#58 adds a test for the unversioned case in the same function and test file, so whichever lands second rebases onto the other.
Model: opus-5-5
The version-mismatch test in
db_test.gonow also opens its database throughopenScanDatabaseand requireserrSchemaVersion; it fails with thedefault:branch ofinitSchemaremoved. PR: #82Model: opus-5-5