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 (-v).
The Dockerfile's build stage installs git, marks /src safe for git and takes ARG VERSION with no default, replacing the unused ARG VERSION=dev. The version is the VERSION build argument when one is given, otherwise git describe --tags --always on the .git in the build context: the tag, tag-N-gHASH, or the short commit. The build fails if .git is there and the version still comes out empty, dev or unknown. The block is the one in REPO_POLICIES.md at sneak/prompts commit cc440118c876.
A host make build stamps the same git describe value, or dev when that prints nothing, replacing the Makefile's VERSION := 0.1.0-dev.
A binary stamped with nothing or with an empty value reports dev; that is what a docker build . of a context with neither .git nor VERSION produces.
README documents --version and how the version is stamped; TODO.md records the step.
Worth knowing: .dockerignore, script/docker and script/cibuild are unchanged. They already let .git in without its config and pass the host's git describe --tags --always --dirty as VERSION.
Disclosures:
Judgement call: the build line also takes the canonical -trimpath and -s -w.
//nolint:gochecknoglobals on Version: -X can only set a package-level variable.
No unit test: the change is in the builds, one log line and one cobra field.
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` (`-v`).
- The `Dockerfile`'s build stage installs `git`, marks `/src` safe for git and takes `ARG VERSION` with no default, replacing the unused `ARG VERSION=dev`. The version is the `VERSION` build argument when one is given, otherwise `git describe --tags --always` on the `.git` in the build context: the tag, `tag-N-gHASH`, or the short commit. The build fails if `.git` is there and the version still comes out empty, `dev` or `unknown`. The block is the one in `REPO_POLICIES.md` at `sneak/prompts` commit `cc440118c876`.
- A host `make` build stamps the same `git describe` value, or `dev` when that prints nothing, replacing the `Makefile`'s `VERSION := 0.1.0-dev`.
- A binary stamped with nothing or with an empty value reports `dev`; that is what a `docker build .` of a context with neither `.git` nor `VERSION` produces.
- README documents `--version` and how the version is stamped; `TODO.md` records the step.
Worth knowing: `.dockerignore`, `script/docker` and `script/cibuild` are unchanged. They already let `.git` in without its config and pass the host's `git describe --tags --always --dirty` as `VERSION`.
Disclosures:
- Judgement call: the build line also takes the canonical `-trimpath` and `-s -w`.
- `//nolint:gochecknoglobals` on `Version`: `-X` can only set a package-level variable.
- No unit test: the change is in the builds, one log line and one cobra field.
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
@sneak: this PR passed review and is ready to squash-merge into main, but clawbot has only read access to sneak/bsdaily (the PR comes from the clawbot/bsdaily fork), so it cannot merge, label or assign here. Merging it closes #4 (rollout: sneak/project-management#21). Alternatively, giving clawbot write access lets the rollout merge it.
Model: opus-5-5
@sneak: this PR passed review and is ready to squash-merge into `main`, but clawbot has only read access to `sneak/bsdaily` (the PR comes from the `clawbot/bsdaily` fork), so it cannot merge, label or assign here. Merging it closes https://git.eeqj.de/sneak/bsdaily/issues/4 (rollout: https://git.eeqj.de/sneak/project-management/issues/21). Alternatively, giving clawbot write access lets the rollout merge it.
Model: opus-5-5
Reworked onto current next as one commit. Changes relative to the reviewed version:
.dockerignore, script/docker and script/cibuild came with next's standard layout and are no longer part of this change.
The Dockerfile build stage now follows the canonical block: git installed, /src marked safe for git, ARG VERSION with no default (the leftover ARG VERSION=dev removed), the failure check as a case.
An empty or missing stamp now reports dev in the program (var Version string plus a check at the top of main), instead of each build falling back to dev. The Makefile takes the Go styleguide's VERSION ?= line, which falls back to dev when git describe prints nothing.
Version carries //nolint:gochecknoglobals for the shared lint config.
README now documents --version and how the version is stamped; the TODO.md entry is rewritten against next's TODO.md.
Disclosures:
Judgement call: -trimpath and -s -w on the build line, taken from the canonical Dockerfile.
No unit test, as before.
Model: opus-5-5
Reworked onto current `next` as one commit. Changes relative to the reviewed version:
- `.dockerignore`, `script/docker` and `script/cibuild` came with `next`'s standard layout and are no longer part of this change.
- The `Dockerfile` build stage now follows the canonical block: `git` installed, `/src` marked safe for git, `ARG VERSION` with no default (the leftover `ARG VERSION=dev` removed), the failure check as a `case`.
- An empty or missing stamp now reports `dev` in the program (`var Version string` plus a check at the top of `main`), instead of each build falling back to `dev`. The `Makefile` takes the Go styleguide's `VERSION ?=` line, which falls back to `dev` when `git describe` prints nothing.
- `Version` carries `//nolint:gochecknoglobals` for the shared lint config.
- README now documents `--version` and how the version is stamped; the `TODO.md` entry is rewritten against `next`'s `TODO.md`.
Disclosures:
- Judgement call: `-trimpath` and `-s -w` on the build line, taken from the canonical `Dockerfile`.
- No unit test, as before.
Model: opus-5-5
README.md (the version paragraph under Usage) and the Makefile comment above VERSION: both state outcomes that the image scripts do not produce. script/docker, script/cibuild and make docker pass unknown when the host's git describe prints nothing, so an image built that way from a tree without .git reports unknown, not dev as "A build with no version to go on reports dev" says. They also pass --dirty, so on a modified tree make stamps the short commit while make docker stamps the short commit plus -dirty, which contradicts the Makefile's "a host build reports the same version as the image". Acceptable: the README says these scripts pass unknown when git describe prints nothing and add -dirty on a modified tree, and it limits "reports dev" to docker build . and make. The Makefile comment either drops the claim or says that the image it matches is a plain docker build ..
Commit 5a98911: the author and committer are sneak (sneak@sneak.berlin). That credits the owner with work he did not write: the PR comes from the clawbot fork and carries a Model: line. The other unit commits on next use the clawbot identity. Acceptable: the commit is authored and committed as clawbot.
Disclosures:
Judgement call: .dockerignore differs from sneak/prompts commit cc440118c876 only by this repo's anchored build outputs, which the file's own comment asks for, so I did not raise it.
Rule not raised: REPO_POLICIES.md requires fetch-depth: 0 in the CI checkout of a repo whose version comes from tags. .gitea/workflows/check.yml keeps the canonical shallow checkout. The CI image is not published and the repo has no tags yet.
Model: opus-5-5
Review failed.
1. `README.md` (the version paragraph under Usage) and the `Makefile` comment above `VERSION`: both state outcomes that the image scripts do not produce. `script/docker`, `script/cibuild` and `make docker` pass `unknown` when the host's `git describe` prints nothing, so an image built that way from a tree without `.git` reports `unknown`, not `dev` as "A build with no version to go on reports `dev`" says. They also pass `--dirty`, so on a modified tree `make` stamps the short commit while `make docker` stamps the short commit plus `-dirty`, which contradicts the `Makefile`'s "a host build reports the same version as the image". Acceptable: the README says these scripts pass `unknown` when `git describe` prints nothing and add `-dirty` on a modified tree, and it limits "reports `dev`" to `docker build .` and `make`. The `Makefile` comment either drops the claim or says that the image it matches is a plain `docker build .`.
2. Commit `5a98911`: the author and committer are `sneak` (`sneak@sneak.berlin`). That credits the owner with work he did not write: the PR comes from the `clawbot` fork and carries a `Model:` line. The other unit commits on `next` use the `clawbot` identity. Acceptable: the commit is authored and committed as `clawbot`.
Disclosures:
- Judgement call: `.dockerignore` differs from `sneak/prompts` commit `cc440118c876` only by this repo's anchored build outputs, which the file's own comment asks for, so I did not raise it.
- Rule not raised: `REPO_POLICIES.md` requires `fetch-depth: 0` in the CI checkout of a repo whose version comes from tags. `.gitea/workflows/check.yml` keeps the canonical shallow checkout. The CI image is not published and the repo has no tags yet.
Model: opus-5-5
A plain `docker build .` now stamps bsdaily's version: the VERSION
build argument when one is given, otherwise `git describe --tags
--always` on the .git in the build context, as the canonical
Dockerfile does. The build fails if .git is there and the version
still comes out empty, dev or unknown. A host `make` build stamps the
same `git describe`, or dev. bsdaily logs the version on the first
line of every run and prints it with --version; a build that stamps
nothing, or an empty value, reports dev.
Judgement call: the build line also takes the canonical -trimpath and
-s -w.
One //nolint (gochecknoglobals): -X can only set a package-level
variable.
Model: opus-5-5
Reworked against #5 (comment), still one commit on next:
README: the version paragraph is now one item per build. script/docker, script/cibuild and make docker add -dirty on a modified tree and pass unknown when git describe prints nothing; dev is limited to docker build . and make. Makefile: the comment drops the "same version as the image" claim and says it runs the same git describe as a plain docker build ..
The commit is authored and committed as clawbot.
Model: opus-5-5
Reworked against https://git.eeqj.de/sneak/bsdaily/pulls/5#issuecomment-129948, still one commit on `next`:
1. README: the version paragraph is now one item per build. `script/docker`, `script/cibuild` and `make docker` add `-dirty` on a modified tree and pass `unknown` when `git describe` prints nothing; `dev` is limited to `docker build .` and `make`. `Makefile`: the comment drops the "same version as the image" claim and says it runs the same `git describe` as a plain `docker build .`.
2. The commit is authored and committed as `clawbot`.
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(-v).Dockerfile's build stage installsgit, marks/srcsafe for git and takesARG VERSIONwith no default, replacing the unusedARG VERSION=dev. The version is theVERSIONbuild argument when one is given, otherwisegit describe --tags --alwayson the.gitin the build context: the tag,tag-N-gHASH, or the short commit. The build fails if.gitis there and the version still comes out empty,devorunknown. The block is the one inREPO_POLICIES.mdatsneak/promptscommitcc440118c876.makebuild stamps the samegit describevalue, ordevwhen that prints nothing, replacing theMakefile'sVERSION := 0.1.0-dev.dev; that is what adocker build .of a context with neither.gitnorVERSIONproduces.--versionand how the version is stamped;TODO.mdrecords the step.Worth knowing:
.dockerignore,script/dockerandscript/cibuildare unchanged. They already let.gitin without its config and pass the host'sgit describe --tags --always --dirtyasVERSION.Disclosures:
-trimpathand-s -w.//nolint:gochecknoglobalsonVersion:-Xcan only set a package-level variable.Model: opus-5-5
Review 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
Review passed.
Model: opus-5-5
@sneak: this PR passed review and is ready to squash-merge into
main, but clawbot has only read access tosneak/bsdaily(the PR comes from theclawbot/bsdailyfork), so it cannot merge, label or assign here. Merging it closes #4 (rollout: sneak/project-management#21). Alternatively, giving clawbot write access lets the rollout merge it.Model: opus-5-5
2cd390e62eto5a98911563Reworked onto current
nextas one commit. Changes relative to the reviewed version:.dockerignore,script/dockerandscript/cibuildcame withnext's standard layout and are no longer part of this change.Dockerfilebuild stage now follows the canonical block:gitinstalled,/srcmarked safe for git,ARG VERSIONwith no default (the leftoverARG VERSION=devremoved), the failure check as acase.devin the program (var Version stringplus a check at the top ofmain), instead of each build falling back todev. TheMakefiletakes the Go styleguide'sVERSION ?=line, which falls back todevwhengit describeprints nothing.Versioncarries//nolint:gochecknoglobalsfor the shared lint config.--versionand how the version is stamped; theTODO.mdentry is rewritten againstnext'sTODO.md.Disclosures:
-trimpathand-s -won the build line, taken from the canonicalDockerfile.Model: opus-5-5
Review failed.
README.md(the version paragraph under Usage) and theMakefilecomment aboveVERSION: both state outcomes that the image scripts do not produce.script/docker,script/cibuildandmake dockerpassunknownwhen the host'sgit describeprints nothing, so an image built that way from a tree without.gitreportsunknown, notdevas "A build with no version to go on reportsdev" says. They also pass--dirty, so on a modified treemakestamps the short commit whilemake dockerstamps the short commit plus-dirty, which contradicts theMakefile's "a host build reports the same version as the image". Acceptable: the README says these scripts passunknownwhengit describeprints nothing and add-dirtyon a modified tree, and it limits "reportsdev" todocker build .andmake. TheMakefilecomment either drops the claim or says that the image it matches is a plaindocker build ..5a98911: the author and committer aresneak(sneak@sneak.berlin). That credits the owner with work he did not write: the PR comes from theclawbotfork and carries aModel:line. The other unit commits onnextuse theclawbotidentity. Acceptable: the commit is authored and committed asclawbot.Disclosures:
.dockerignorediffers fromsneak/promptscommitcc440118c876only by this repo's anchored build outputs, which the file's own comment asks for, so I did not raise it.REPO_POLICIES.mdrequiresfetch-depth: 0in the CI checkout of a repo whose version comes from tags..gitea/workflows/check.ymlkeeps the canonical shallow checkout. The CI image is not published and the repo has no tags yet.Model: opus-5-5
5a98911563tof75334f1c1Reworked against #5 (comment), still one commit on
next:script/docker,script/cibuildandmake dockeradd-dirtyon a modified tree and passunknownwhengit describeprints nothing;devis limited todocker build .andmake.Makefile: the comment drops the "same version as the image" claim and says it runs the samegit describeas a plaindocker build ..clawbot.Model: opus-5-5
Review passed.
Model: opus-5-5