Repository navigation
feat(nix-checks): add atlas-sum-check derivation + binary - #1222
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new Go tool, atlas-sum-check, which verifies the integrity of atlas.sum files across multiple database dialects (sqlite, postgres, and mysql) to ensure migration consistency. Additionally, it integrates this check into the Nix CI pipeline and updates the project task list. Feedback was provided to align the tool's documentation with its implementation, specifically noting that the binary reports all failures across dialects before exiting rather than stopping at the first mismatch.
2a5b056 to
b58ba2f
Compare
99c0299 to
c199666
Compare
The package doc claimed the binary exits non-zero on the first mismatch. The implementation actually iterates every dialect and only exits at the end, reporting all offending directories at once. Update the doc to match. Addresses gemini-code-assist comment on PR #1222 (PRRT_kwDONV6tZs6D31Je). Co-Authored-By: Claude Opus 4.7 <[email protected]>
b58ba2f to
03b777f
Compare
c199666 to
5132a2b
Compare
The package doc claimed the binary exits non-zero on the first mismatch. The implementation actually iterates every dialect and only exits at the end, reporting all offending directories at once. Update the doc to match. Addresses gemini-code-assist comment on PR #1222 (PRRT_kwDONV6tZs6D31Je). Co-Authored-By: Claude Opus 4.7 <[email protected]>
03b777f to
7cf61e7
Compare
5132a2b to
8913971
Compare
The package doc claimed the binary exits non-zero on the first mismatch. The implementation actually iterates every dialect and only exits at the end, reporting all offending directories at once. Update the doc to match. Addresses gemini-code-assist comment on PR #1222 (PRRT_kwDONV6tZs6D31Je). Co-Authored-By: Claude Opus 4.7 <[email protected]>
7cf61e7 to
56eadca
Compare
8913971 to
eb26bb2
Compare
The package doc claimed the binary exits non-zero on the first mismatch. The implementation actually iterates every dialect and only exits at the end, reporting all offending directories at once. Update the doc to match. Addresses gemini-code-assist comment on PR #1222 (PRRT_kwDONV6tZs6D31Je). Co-Authored-By: Claude Opus 4.7 <[email protected]>
56eadca to
b262a7c
Compare
eb26bb2 to
3a60ea9
Compare
The package doc claimed the binary exits non-zero on the first mismatch. The implementation actually iterates every dialect and only exits at the end, reporting all offending directories at once. Update the doc to match. Addresses gemini-code-assist comment on PR #1222 (PRRT_kwDONV6tZs6D31Je). Co-Authored-By: Claude Opus 4.7 <[email protected]>
b262a7c to
3c2e869
Compare
3a60ea9 to
0c17a85
Compare
The package doc claimed the binary exits non-zero on the first mismatch. The implementation actually iterates every dialect and only exits at the end, reporting all offending directories at once. Update the doc to match. Addresses gemini-code-assist comment on PR #1222 (PRRT_kwDONV6tZs6D31Je). Co-Authored-By: Claude Opus 4.7 <[email protected]>
3c2e869 to
e5890cd
Compare
0c17a85 to
3c9e1b6
Compare
|
Automated stack merge failed during the rebase step. The |
Adds a new `cmd/atlas-sum-check` Go binary that opens each `migrations/<dialect>/` directory via Atlas `sqltool.NewGooseDir`, recomputes the checksum, and compares against the on-disk `atlas.sum`. Any drift fails the build with a diagnostic pointing at `go run ./cmd/generate-migrations` as the remediation. Wires the binary into `nix flake check` via a new `atlas-sum-check` derivation in `nix/checks/flake-module.nix`. The derivation reuses the ncps Go module setup but runs the new binary instead of the full build. Marks task 13.3 complete in the migrate-to-ent-and-atlas change.
The parent atlas-sum-check commit upgrades ariga.io/atlas in go.mod from v0.36.2 to v0.38.0 (needed for the new check binary). The vendor tree shrinks/grows accordingly, so the FOD hash changes. Bump vendorHash to match — without this, golangci-lint-check fails with "inconsistent vendoring: ariga.io/[email protected] ... but not marked as explicit in vendor/modules.txt".
The parent atlas-sum-check commit upgrades ariga.io/atlas in go.mod from v0.36.2 to v0.38.0. ent-codegen-drift-check uses proxyVendor=true with its own vendorHash, so the bump on ncps.goModules isn't enough — the drift check's GOPROXY cache also needs to be re-populated for the new atlas version. Without this, the check fails with: ariga.io/[email protected]: reading file://.../v0.38.0.zip: no such file or directory
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1222 +/- ##
=====================================
Coverage 5.50% 5.50%
=====================================
Files 6 6
Lines 400 400
=====================================
Hits 22 22
Misses 374 374
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds a new
cmd/atlas-sum-checkGo binary that opens eachmigrations/<dialect>/directory via Atlassqltool.NewGooseDir,recomputes the checksum, and compares against the on-disk
atlas.sum.Any drift fails the build with a diagnostic pointing at
go run ./cmd/generate-migrationsas the remediation.Wires the binary into
nix flake checkvia a newatlas-sum-checkderivation in
nix/checks/flake-module.nix. The derivation reuses thencps Go module setup but runs the new binary instead of the full build.
Marks task 13.3 complete in the migrate-to-ent-and-atlas change.