GeezerVison is showing github.com — pkgs/import: go.mod/go.sum are not tidy (lib/pq recorded indirect though directly imported) — and no CI checks tidiness for the go-modules-build modules · Issue #347 · developing-today/code
pkgs/import: go.mod/go.sum are not tidy (lib/pq recorded indirect though directly imported) — and no CI checks tidiness for the go-modules-build modules #347
Description
Summary
pkgs/import's go.mod/go.sum are not tidy, and no workflow checks tidiness for this module — so the drift is invisible. go build/go vet pass anyway (extra indirect requirements don't break a build), which is why the #342 build workflow's green runs don't reveal it.
Evidence (verified on main ff21d17, with the module's own Go 1.21.3)
Running go mod tidy in a scratch copy of pkgs/import changes both files:
github.com/lib/pq v1.10.9 moves from the indirect block to the direct require block. It is imported directly: pkgs/import/main.go:12 has _ "github.com/lib/pq" (the Postgres driver for goose). Recording a direct dependency as // indirect is exactly what tidy exists to prevent.
- Stale indirect requirements are dropped — nothing in the module imports them (leftover goose dependency graph):
github.com/cockroachdb/cockroach-go/v2 v2.3.5, github.com/jackc/pgx/v5 v5.5.1 (+ pgpassfile, pgservicefile), golang.org/x/crypto v0.16.0, golang.org/x/text v0.14.0.
go.sum shrinks accordingly (13 diff lines under Go 1.21.3; the same classification changes appear under Go 1.25.1's go mod tidy -diff).
The tidied module builds and vets clean under Go 1.21.3 (go build ./... + go vet ./... pass).
Why no check caught it
.github/workflows/mod-tidy.yml — the repo's only tidy check — covers only pkgs/graph.
.github/workflows/go-modules-build.yml (CI: five pkgs Go modules (chat, database, import, launcher, tea) are built by nothing — the map/identity rot pattern, still unguarded #342) builds and vets pkgs/import but never tidies; build/vet do not fail on an untidy module.
- Sibling audit this run (same Go 1.21.3 tidy, scratch copies):
chat, database, launcher, tea are all tidy-clean — import is the only drifting module among the five. (pkgs/mcpx already has its own tidy guard, added with the nix#436 set; pkgs/map/pkgs/identity are tidy-clean too.)
Why it matters
An untidy module misstates its real dependencies (a direct driver recorded as indirect; dead pgx/cockroach requirements kept in the graph). Renovate bumps and future go gets build on this graph, and the first person to run tidy for an unrelated change inherits an unrelated-looking go.mod/go.sum diff — the same class of silent rot #342/#340 fixed for builds.
Acceptance criteria
-
pkgs/import is tidy-clean: go mod tidy (module's Go 1.21.3) produces no changes to go.mod/go.sum; the module still builds and vets.
- A CI guard fails when any of the five
go-modules-build.yml modules is untidy (mirroring mod-tidy.yml's verify pattern: run tidy, fail if go.mod/go.sum changed) — a guard covering only import would let the next module drift the same way.
- The guard passes for the other four modules (verified tidy-clean above).
Single-repo: pkgs/import exists only in this repo (no such module in opencode/openchamber/nix).
Metadata
Metadata
Development
No branches or pull requestsIssue actions