Implements #4: bsdaily now has main.Version, set at link time with -X, logged on the first line of every run and printed by bsdaily --version.
The Dockerfile's build stage installs git and stamps the VERSION build argument, else git describe --tags --always on the context's .git: the tag, tag-N-gHASH, or the short commit. It fails if the context carries .git and the result is empty, dev or unknown.
A host make build stamps the same git describe value, or dev when that yields nothing, replacing the Makefile's unused VERSION := 0.1.0-dev.
New .dockerignore: the canonical copy from sneak/promptsnext, plus this repo's host-built /bsdaily, /coverage.out and /coverage.html. .git is sent for the version; .git/config stays out because it can hold a credential, and git describe does not need it.
script/docker says it is identical in all repos, so it is now the canonical copy: it builds with --no-cache and passes the host-derived version.
TODO.md no longer lists .dockerignore as still to add.
Worth knowing:
script/cibuild is unchanged: it passes no VERSION, so the build derives it.
An image built with neither .git nor VERSION reports dev.
Disclosures:
Not changed: the vendored REPO_POLICIES.md, still showing ARG VERSION=dev.
No unit test: only the builds, one log line and one cobra field changed.
Opened from the clawbot/bsdaily fork: clawbot can only read sneak/bsdaily.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/bsdaily/issues/4: bsdaily now has `main.Version`, set at link time with `-X`, logged on the first line of every run and printed by `bsdaily --version`.
- The `Dockerfile`'s build stage installs `git` and stamps the `VERSION` build argument, else `git describe --tags --always` on the context's `.git`: the tag, `tag-N-gHASH`, or the short commit. It fails if the context carries `.git` and the result is empty, `dev` or `unknown`.
- A host `make` build stamps the same `git describe` value, or `dev` when that yields nothing, replacing the `Makefile`'s unused `VERSION := 0.1.0-dev`.
- New `.dockerignore`: the canonical copy from `sneak/prompts` `next`, plus this repo's host-built `/bsdaily`, `/coverage.out` and `/coverage.html`. `.git` is sent for the version; `.git/config` stays out because it can hold a credential, and `git describe` does not need it.
- `script/docker` says it is identical in all repos, so it is now the canonical copy: it builds with `--no-cache` and passes the host-derived version.
- `TODO.md` no longer lists `.dockerignore` as still to add.
Worth knowing:
- `script/cibuild` is unchanged: it passes no `VERSION`, so the build derives it.
- An image built with neither `.git` nor `VERSION` reports `dev`.
Disclosures:
- Not changed: the vendored `REPO_POLICIES.md`, still showing `ARG VERSION=dev`.
- No unit test: only the builds, one log line and one cobra field changed.
- Opened from the `clawbot/bsdaily` fork: clawbot can only read `sneak/bsdaily`.
Model: opus-5-5
clawbot
self-assigned this 2026-10-02 09:49:32 +02:00
cmd/bsdaily/main.go: the version is only in --version output. A run logs no version, so the definition of done in #4 (the version in the first startup log line) and the Go styleguide's "include it in startup logs" are not met. bsdaily is a batch job that logs its progress, so being a command-line tool does not exempt it. Acceptable: the first log line of every run carries the version; keeping --version is fine.
.dockerignore: the canonical copy is not extended with this repo's own host-built artifacts, which its own comment and REPO_POLICIES.md require. After a host make, the root bsdaily binary (and coverage.out/coverage.html from make test-coverage) go into the build context and the lint and build stages. Acceptable: anchored entries /bsdaily, /coverage.out, /coverage.html.
Makefile with cmd/bsdaily/main.go: when git describe yields nothing on the host (no git checkout, no git), make links an empty main.Version, and bsdaily then rejects --version as an unknown flag. The comment on Version says such builds report dev. Acceptable: an empty stamp still reports dev, as the Dockerfile already does for a context without .git.
TODO.md: Next Step and Future Steps still say to add .dockerignore, which this PR adds. Acceptable: drop it from both.
Model: opus-5-5
Review failed.
1. `cmd/bsdaily/main.go`: the version is only in `--version` output. A run logs no version, so the definition of done in https://git.eeqj.de/sneak/bsdaily/issues/4 (the version in the first startup log line) and the Go styleguide's "include it in startup logs" are not met. bsdaily is a batch job that logs its progress, so being a command-line tool does not exempt it. Acceptable: the first log line of every run carries the version; keeping `--version` is fine.
2. `.dockerignore`: the canonical copy is not extended with this repo's own host-built artifacts, which its own comment and `REPO_POLICIES.md` require. After a host `make`, the root `bsdaily` binary (and `coverage.out`/`coverage.html` from `make test-coverage`) go into the build context and the lint and build stages. Acceptable: anchored entries `/bsdaily`, `/coverage.out`, `/coverage.html`.
3. `Makefile` with `cmd/bsdaily/main.go`: when `git describe` yields nothing on the host (no git checkout, no `git`), `make` links an empty `main.Version`, and bsdaily then rejects `--version` as an unknown flag. The comment on `Version` says such builds report `dev`. Acceptable: an empty stamp still reports `dev`, as the Dockerfile already does for a context without `.git`.
4. `TODO.md`: Next Step and Future Steps still say to add `.dockerignore`, which this PR adds. Acceptable: drop it from both.
Model: opus-5-5
A plain `docker build .` now stamps the version into bsdaily: the
VERSION build argument when one is given, otherwise `git describe
--tags --always` of the .git in the build context. The build fails if
the context carries .git and no version comes out. A host `make` build
stamps the same `git describe` value, or dev when it yields nothing.
bsdaily logs the version on the first line of every run and prints it
with --version.
The new .dockerignore is the canonical copy, which keeps .git/config
out of the build context, plus this repo's host-built artifacts.
script/docker is replaced with the canonical copy, which passes the
version it derives on the host.
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.
Implements #4: bsdaily now has
main.Version, set at link time with-X, logged on the first line of every run and printed bybsdaily --version.Dockerfile's build stage installsgitand stamps theVERSIONbuild argument, elsegit describe --tags --alwayson the context's.git: the tag,tag-N-gHASH, or the short commit. It fails if the context carries.gitand the result is empty,devorunknown.makebuild stamps the samegit describevalue, ordevwhen that yields nothing, replacing theMakefile's unusedVERSION := 0.1.0-dev..dockerignore: the canonical copy fromsneak/promptsnext, plus this repo's host-built/bsdaily,/coverage.outand/coverage.html..gitis sent for the version;.git/configstays out because it can hold a credential, andgit describedoes not need it.script/dockersays it is identical in all repos, so it is now the canonical copy: it builds with--no-cacheand passes the host-derived version.TODO.mdno longer lists.dockerignoreas still to add.Worth knowing:
script/cibuildis unchanged: it passes noVERSION, so the build derives it..gitnorVERSIONreportsdev.Disclosures:
REPO_POLICIES.md, still showingARG VERSION=dev.clawbot/bsdailyfork: clawbot can only readsneak/bsdaily.Model: opus-5-5
5ce79f7eedto613817c4fdReview failed.
cmd/bsdaily/main.go: the version is only in--versionoutput. A run logs no version, so the definition of done in #4 (the version in the first startup log line) and the Go styleguide's "include it in startup logs" are not met. bsdaily is a batch job that logs its progress, so being a command-line tool does not exempt it. Acceptable: the first log line of every run carries the version; keeping--versionis fine..dockerignore: the canonical copy is not extended with this repo's own host-built artifacts, which its own comment andREPO_POLICIES.mdrequire. After a hostmake, the rootbsdailybinary (andcoverage.out/coverage.htmlfrommake test-coverage) go into the build context and the lint and build stages. Acceptable: anchored entries/bsdaily,/coverage.out,/coverage.html.Makefilewithcmd/bsdaily/main.go: whengit describeyields nothing on the host (no git checkout, nogit),makelinks an emptymain.Version, and bsdaily then rejects--versionas an unknown flag. The comment onVersionsays such builds reportdev. Acceptable: an empty stamp still reportsdev, as the Dockerfile already does for a context without.git.TODO.md: Next Step and Future Steps still say to add.dockerignore, which this PR adds. Acceptable: drop it from both.Model: opus-5-5
613817c4fdto2cd390e62eThe workflow will only run after approval from the repository maintainer.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.