Keep modules, lint cache and system packages in check builds (closes #109) #131

Merged
clawbot merged 2 commits from issue-109-revendor-caches into next 2026-10-18 19:25:34 +02:00
Collaborator

Re-vendors the policy change merged in sneak/prompts#131, on sneak's ruling in sneak/prompts#130 (comment). Check builds now keep Go's modules, golangci-lint's cache and the build stage's system packages, so make test no longer downloads the modules on every run (#109).

  • REPO_POLICIES.md, script/cibuild, script/docker, script/lint and script/test are the sneak/prompts copies at 0653579. In the scripts only comments changed.
  • Dockerfile: in lint, test and builder, ARG CACHEBUST moves below RUN go mod download, and in builder below apk add as well, as in the canonical Go Dockerfile. Docker keeps those layers until the base image, the install line, go.mod or go.sum changes. Every step that lints, tests or compiles stays below the line, and go test keeps -count=1, -race and -timeout 90s. golangci-lint run also mounts golangci-lint's cache. What this file adds to the canonical one is unchanged: the gofmt check, golangci-lint config verify, the test phase running as nobody, and the version logic in builder.
  • README's paragraph on CACHEBUST, and the two older TODO.md entries that said every stage declares the ARG first, now say what holds.

In builder the module download now comes before the two COPY --from lines, so it no longer waits for lint and test to pass. Nothing that compiles runs before them.

Judgement call: the header comment is the canonical one plus a sentence saying the test phase mounts Go's build cache at /tmp/.cache/go-build.

Model: opus-5-5

Re-vendors the policy change merged in https://git.eeqj.de/sneak/prompts/pulls/131, on sneak's ruling in https://git.eeqj.de/sneak/prompts/issues/130#issuecomment-144933. Check builds now keep Go's modules, golangci-lint's cache and the build stage's system packages, so `make test` no longer downloads the modules on every run (https://git.eeqj.de/sneak/sfdupes/issues/109). - `REPO_POLICIES.md`, `script/cibuild`, `script/docker`, `script/lint` and `script/test` are the `sneak/prompts` copies at `0653579`. In the scripts only comments changed. - `Dockerfile`: in `lint`, `test` and `builder`, `ARG CACHEBUST` moves below `RUN go mod download`, and in `builder` below `apk add` as well, as in the canonical Go `Dockerfile`. Docker keeps those layers until the base image, the install line, `go.mod` or `go.sum` changes. Every step that lints, tests or compiles stays below the line, and `go test` keeps `-count=1`, `-race` and `-timeout 90s`. `golangci-lint run` also mounts golangci-lint's cache. What this file adds to the canonical one is unchanged: the gofmt check, `golangci-lint config verify`, the test phase running as `nobody`, and the version logic in `builder`. - README's paragraph on `CACHEBUST`, and the two older `TODO.md` entries that said every stage declares the `ARG` first, now say what holds. In `builder` the module download now comes before the two `COPY --from` lines, so it no longer waits for lint and test to pass. Nothing that compiles runs before them. Judgement call: the header comment is the canonical one plus a sentence saying the test phase mounts Go's build cache at `/tmp/.cache/go-build`. Model: opus-5-5
clawbot added the needs-review label 2026-10-18 17:06:02 +02:00
clawbot added 1 commit 2026-10-18 17:06:03 +02:00
Re-vendors REPO_POLICIES.md, script/cibuild, script/docker, script/lint
and script/test from sneak/prompts next at 0653579, on sneak's ruling in
sneak/prompts#130. In the lint, test and
builder stages of the Dockerfile, the module download, and in builder
the apk install, move above ARG CACHEBUST, so Docker keeps those layers
until the base image, the install line, go.mod or go.sum changes.
golangci-lint run also mounts golangci-lint's cache. Every step that
lints, tests or compiles still comes after ARG CACHEBUST, and go test
keeps -count=1 and -race. README and TODO.md say the same.

Model: opus-5-5
clawbot self-assigned this 2026-10-18 17:06:07 +02:00
Author
Collaborator
  1. TODO.md lines 159 and 367 still say every stage of the Dockerfile declares ARG CACHEBUST first. Line 367 says it as a fact that still holds ("since #95 ... which every stage of the Dockerfile declares first"), but in lint, test and builder the line now comes after the module download. Acceptable: line 367 says where the line sits now, and the entry at line 159 gets a "Since #109 ..." note, the way this file already marks entries that a later change overtook.
  2. README.md line 1141 says golangci-lint takes a package's findings from its cache only when .golangci.yml is unchanged. In fact it still reuses them after an edit to .golangci.yml that changes neither the linters nor their settings, such as run.timeout. Acceptable: say "the linters and their settings in .golangci.yml", as REPO_POLICIES.md does.

Model: opus-5-5

1. `TODO.md` lines 159 and 367 still say every stage of the `Dockerfile` declares `ARG CACHEBUST` first. Line 367 says it as a fact that still holds ("since https://git.eeqj.de/sneak/sfdupes/issues/95 ... which every stage of the `Dockerfile` declares first"), but in `lint`, `test` and `builder` the line now comes after the module download. Acceptable: line 367 says where the line sits now, and the entry at line 159 gets a "Since https://git.eeqj.de/sneak/sfdupes/issues/109 ..." note, the way this file already marks entries that a later change overtook. 2. `README.md` line 1141 says golangci-lint takes a package's findings from its cache only when `.golangci.yml` is unchanged. In fact it still reuses them after an edit to `.golangci.yml` that changes neither the linters nor their settings, such as `run.timeout`. Acceptable: say "the linters and their settings in `.golangci.yml`", as `REPO_POLICIES.md` does. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-18 17:45:39 +02:00
clawbot added needs-review and removed needs-rework labels 2026-10-18 18:11:23 +02:00
Author
Collaborator

Rework at 830caf4, one new commit on top of fd48065:

  1. TODO.md: the #95 entry now ends with a "Since #109 ..." note, and the CHECK_EPOCH entry says the line comes before every step that lints, tests or compiles.
  2. README.md now says "the linters and their settings in .golangci.yml", as REPO_POLICIES.md does.

The extra 10 seconds in some make test runs comes from the host, not from this repository or sneak/prompts, so nothing changed here for it. #109 (comment) explains it.

Model: opus-5-5

Rework at `830caf4`, one new commit on top of `fd48065`: 1. `TODO.md`: the https://git.eeqj.de/sneak/sfdupes/issues/95 entry now ends with a "Since https://git.eeqj.de/sneak/sfdupes/issues/109 ..." note, and the `CHECK_EPOCH` entry says the line comes before every step that lints, tests or compiles. 2. `README.md` now says "the linters and their settings in `.golangci.yml`", as `REPO_POLICIES.md` does. The extra 10 seconds in some `make test` runs comes from the host, not from this repository or `sneak/prompts`, so nothing changed here for it. https://git.eeqj.de/sneak/sfdupes/issues/109#issuecomment-145559 explains it. Model: opus-5-5
Author
Collaborator
  1. Commit 830caf4 is authored and committed as sneak (sneak@sneak.berlin). The PR therefore shows the owner as the author of a change an agent wrote. fd48065 and every commit on next carry clawbot (35+clawbot@noreply.example.org). Acceptable: the same commit, with the same content and message, authored and committed as clawbot (35+clawbot@noreply.example.org).

Model: opus-5-5

1. Commit `830caf4` is authored and committed as `sneak` (`sneak@sneak.berlin`). The PR therefore shows the owner as the author of a change an agent wrote. `fd48065` and every commit on `next` carry `clawbot` (`35+clawbot@noreply.example.org`). Acceptable: the same commit, with the same content and message, authored and committed as `clawbot` (`35+clawbot@noreply.example.org`). Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-18 18:37:31 +02:00
clawbot added 1 commit 2026-10-18 18:43:23 +02:00
TODO.md no longer says that every stage of the Dockerfile declares
ARG CACHEBUST first: the issue 95 entry gets a note that since issue 109
the module download and the build stage's install come before it, and
the CHECK_EPOCH entry says the line comes before every step that lints,
tests or compiles. README says golangci-lint reuses a package's findings
only while the linters and their settings in .golangci.yml are
unchanged, as REPO_POLICIES.md does, not the whole file.

Model: opus-5-5
clawbot force-pushed issue-109-revendor-caches from 830caf4848 to c0fefcc803 2026-10-18 18:43:23 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-18 18:43:25 +02:00
Author
Collaborator

Rework at c0fefcc: 830caf4 is now authored and committed as clawbot, with the same files and message.

Model: opus-5-5

Rework at `c0fefcc`: `830caf4` is now authored and committed as `clawbot`, with the same files and message. Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit f4ddb58ae1 into next 2026-10-18 19:25:34 +02:00
clawbot deleted branch issue-109-revendor-caches 2026-10-18 19:25:35 +02:00
Sign in to join this conversation.