Check builds use Docker's normal cache (closes #177)
check / check (push) Successful in 1m33s

Drop the CACHEBUST build argument from script/lint, script/test,
script/docker, script/cibuild and every Dockerfile stage. REPO_POLICIES
now says check builds use Docker's normal cache: an unchanged tree reuses
each step's stored result, which Docker keeps only for steps that
succeeded. The rules on placing ARG CACHEBUST, re-vendoring it in one
commit and planting a defect to prove a changed check are gone. The
README, the Go style guide and both checklists restated those rules and
are updated to match.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-16 21:17:42 +00:00
1 parent 1ad7ae14be
commit ca36d0372c
10 files changed
+104 -269

No files matched your search

+1 -9
View File
@@ -1,12 +1,6 @@
#!/bin/sh
# script/docker: build the Docker image tagged with the project name.
# Identical in all repos; the tag comes from script/projectname.
# A new CACHEBUST value reruns every RUN step after the ARG CACHEBUST
# line, since a cached gate phase is a check that did not run; unlike
# --no-cache, it keeps the layers above that line and the cache mounts.
# This relies on every stage of the Dockerfile declaring ARG CACHEBUST
# before every step that lints, tests or compiles; a stage without that
# line is served from cache on an unchanged tree, with no warning.
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
@@ -22,9 +16,7 @@ main() {
version="$(git describe --tags --always --dirty 2>/dev/null || true)"
[ -n "$version" ] || version="unknown"
tag="$("$SCRIPT_DIR/projectname")"
docker build --build-arg CACHEBUST="$(date +%s)-$$" \
--build-arg VERSION="$version" \
-t "$tag" .
docker build --build-arg VERSION="$version" -t "$tag" .
}
main "$@"