main.Version on sneak/api is set to "dev" instead of the git hash when being built under upaas, fix that
audit all other repos for that same bug. "docker build ." should pick up the git short rev or tag
Today: the program has no version at all: the image builds it with a bare go build and it reports none. Per the Go styleguide, the binary carries its version and logs it at startup. This repo has no next branch.
The stage that compiles has git and takes the version from the VERSION build argument when one is given, otherwise from git describe --tags --always (a tag when the commit has one, otherwise the short commit). ARG VERSION has no default.
The build fails if the context carries .git and the version still comes out empty, dev or unknown.
Host-side scripts that already pass --build-arg VERSION=... may keep doing so.
Any buildarch left in the repo goes too (sneak/project-management#19): the architecture is read at run time from runtime.GOARCH.
Definition of done:
A fresh clone, then docker build . with no build arguments, then running the binary: the version in the first startup log line shows the commit's tag or short commit, never dev, unknown or empty.
docker build --build-arg VERSION=x . stamps x; a context with .git from which no version can be derived fails the build.
make check passes; PR to main; independent review; squash.
Model: opus-5-5
Owner's words (chat, 2026-10-02 ~00:00 UTC; the rollout across repos is https://git.eeqj.de/sneak/project-management/issues/21):
> main.Version on sneak/api is set to "dev" instead of the git hash when being built under upaas, fix that
> audit all other repos for that same bug. "docker build ." should pick up the git short rev or tag
Today: the program has no version at all: the image builds it with a bare `go build` and it reports none. Per the Go styleguide, the binary carries its version and logs it at startup. This repo has no `next` branch.
The convention (canonical text: https://git.eeqj.de/sneak/prompts/issues/69; working examples: https://git.eeqj.de/sneak/upaas/pulls/242, https://git.eeqj.de/sneak/webhooker/pulls/410):
- `.dockerignore` lets `.git` into the build context.
- The stage that compiles has `git` and takes the version from the `VERSION` build argument when one is given, otherwise from `git describe --tags --always` (a tag when the commit has one, otherwise the short commit). `ARG VERSION` has no default.
- The build fails if the context carries `.git` and the version still comes out empty, `dev` or `unknown`.
- Host-side scripts that already pass `--build-arg VERSION=...` may keep doing so.
- Any `buildarch` left in the repo goes too (https://git.eeqj.de/sneak/project-management/issues/19): the architecture is read at run time from `runtime.GOARCH`.
Definition of done:
- A fresh clone, then `docker build .` with no build arguments, then running the binary: the version in the first startup log line shows the commit's tag or short commit, never `dev`, `unknown` or empty.
- `docker build --build-arg VERSION=x .` stamps `x`; a context with `.git` from which no version can be derived fails the build.
- `make check` passes; PR to `main`; independent review; squash.
Model: opus-5-5
Plan. #5 passed review against main before next existed. It now targets next, and the three units since then (standard layout, prettier, the shared lint config) changed the files it touches. So it is reworked onto current next, keeping its branch and history, and goes through a fresh review. "PR to main" in the definition of done above becomes "PR to next", as every unit here does.
The version convention follows REPO_POLICIES.md at sneak/prompts commit cc440118c876, the commit the rest of the repo is vendored from:
The builder stage installs git, marks /src safe for git, and takes ARG VERSION with no default. It falls back to git describe --tags --always, and fails if .git is present but the version comes out empty, dev or unknown.
.dockerignore, script/docker and script/cibuild already match that commit, so they need no change.
main.Version is set with -X. It is logged on the first line of every run and kept on --version, and reports dev when nothing set it.
Plan. https://git.eeqj.de/sneak/bsdaily/pulls/5 passed review against `main` before `next` existed. It now targets `next`, and the three units since then (standard layout, prettier, the shared lint config) changed the files it touches. So it is reworked onto current `next`, keeping its branch and history, and goes through a fresh review. "PR to `main`" in the definition of done above becomes "PR to `next`", as every unit here does.
The version convention follows `REPO_POLICIES.md` at `sneak/prompts` commit `cc440118c876`, the commit the rest of the repo is vendored from:
- The builder stage installs `git`, marks `/src` safe for git, and takes `ARG VERSION` with no default. It falls back to `git describe --tags --always`, and fails if `.git` is present but the version comes out empty, `dev` or `unknown`.
- `.dockerignore`, `script/docker` and `script/cibuild` already match that commit, so they need no change.
- `main.Version` is set with `-X`. It is logged on the first line of every run and kept on `--version`, and reports `dev` when nothing set it.
The earlier review findings on https://git.eeqj.de/sneak/bsdaily/pulls/5 still apply.
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.
Owner's words (chat, 2026-10-02 ~00:00 UTC; the rollout across repos is sneak/project-management#21):
Today: the program has no version at all: the image builds it with a bare
go buildand it reports none. Per the Go styleguide, the binary carries its version and logs it at startup. This repo has nonextbranch.The convention (canonical text: sneak/prompts#69; working examples: sneak/upaas#242, sneak/webhooker#410):
.dockerignorelets.gitinto the build context.gitand takes the version from theVERSIONbuild argument when one is given, otherwise fromgit describe --tags --always(a tag when the commit has one, otherwise the short commit).ARG VERSIONhas no default..gitand the version still comes out empty,devorunknown.--build-arg VERSION=...may keep doing so.buildarchleft in the repo goes too (sneak/project-management#19): the architecture is read at run time fromruntime.GOARCH.Definition of done:
docker build .with no build arguments, then running the binary: the version in the first startup log line shows the commit's tag or short commit, neverdev,unknownor empty.docker build --build-arg VERSION=x .stampsx; a context with.gitfrom which no version can be derived fails the build.make checkpasses; PR tomain; independent review; squash.Model: opus-5-5
Plan. #5 passed review against
mainbeforenextexisted. It now targetsnext, and the three units since then (standard layout, prettier, the shared lint config) changed the files it touches. So it is reworked onto currentnext, keeping its branch and history, and goes through a fresh review. "PR tomain" in the definition of done above becomes "PR tonext", as every unit here does.The version convention follows
REPO_POLICIES.mdatsneak/promptscommitcc440118c876, the commit the rest of the repo is vendored from:git, marks/srcsafe for git, and takesARG VERSIONwith no default. It falls back togit describe --tags --always, and fails if.gitis present but the version comes out empty,devorunknown..dockerignore,script/dockerandscript/cibuildalready match that commit, so they need no change.main.Versionis set with-X. It is logged on the first line of every run and kept on--version, and reportsdevwhen nothing set it.The earlier review findings on #5 still apply.
Model: opus-5-5