Stamp the git commit into images built from the Dockerfile (closes #236) #242

Merged
clawbot merged 1 commits from issue-236-stamp-version-in-image into next 2026-09-29 12:35:46 +02:00
Collaborator

Closes #236

.dockerignore left out .git, so make build inside the image had no git metadata and stamped dev. It now sends .git, so an image built by the Compose file or by docker build . on a clone carries its git describe output with no extra step.

.dockerignore also no longer leaves out tracked files (LICENSE, README.md, REPO_POLICIES.md, CONVENTIONS.md, .editorconfig): git inside the build would see them as deleted and add -dirty. What it still leaves out (.env, bin/, editor directories, *.test) is untracked, which --dirty ignores.

The footer and /health already read the same version. The startup log line that reports it (the logger's Identify()) was never called; main now calls it once at startup.

The README says to build from a git clone, since a copy without .git still shows dev.

Worth knowing: the layers after COPY . . now rebuild whenever .git changes (any commit or fetch), and make lint sends .git too, since Dockerfile.lint shares .dockerignore.

  • Deviation: the plan said the startup log needed no change; it did, as nothing logged the version.
  • Recorded check instead of a Go test: built the image from a clone with docker build . (the context the Compose file uses); the footer, /health and the startup log all showed 1.0.0-36-g29f95db for git rev-parse --short HEAD 29f95db; container and image removed.
  • Judgement call: no safe.directory setting; files copied into the build are owned by root, the user the build runs as.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/upaas/issues/236 `.dockerignore` left out `.git`, so `make build` inside the image had no git metadata and stamped `dev`. It now sends `.git`, so an image built by the Compose file or by `docker build .` on a clone carries its `git describe` output with no extra step. `.dockerignore` also no longer leaves out tracked files (`LICENSE`, `README.md`, `REPO_POLICIES.md`, `CONVENTIONS.md`, `.editorconfig`): git inside the build would see them as deleted and add `-dirty`. What it still leaves out (`.env`, `bin/`, editor directories, `*.test`) is untracked, which `--dirty` ignores. The footer and `/health` already read the same version. The startup log line that reports it (the logger's `Identify()`) was never called; `main` now calls it once at startup. The README says to build from a git clone, since a copy without `.git` still shows `dev`. Worth knowing: the layers after `COPY . .` now rebuild whenever `.git` changes (any commit or fetch), and `make lint` sends `.git` too, since `Dockerfile.lint` shares `.dockerignore`. - Deviation: the plan said the startup log needed no change; it did, as nothing logged the version. - Recorded check instead of a Go test: built the image from a clone with `docker build .` (the context the Compose file uses); the footer, `/health` and the startup log all showed `1.0.0-36-g29f95db` for `git rev-parse --short HEAD` `29f95db`; container and image removed. - Judgement call: no `safe.directory` setting; files copied into the build are owned by root, the user the build runs as. Model: opus-5-5
clawbot added the needs-review label 2026-09-29 11:52:08 +02:00
clawbot self-assigned this 2026-09-29 11:52:08 +02:00
Author
Collaborator

Review failed.

  • TODO.md, Completed Steps: the branch conflicts with the current next, which now opens that list with the entry for #238 where this PR adds its own entry, so the PR cannot be merged. Rebase onto the current next and keep both entries.

Model: opus-5-5

Review failed. - `TODO.md`, Completed Steps: the branch conflicts with the current `next`, which now opens that list with the entry for https://git.eeqj.de/sneak/upaas/issues/238 where this PR adds its own entry, so the PR cannot be merged. Rebase onto the current `next` and keep both entries. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-09-29 12:13:33 +02:00
clawbot force-pushed issue-236-stamp-version-in-image from 29f95dbc0f to 6e24aa1106 2026-09-29 12:17:13 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-09-29 12:17:20 +02:00
Author
Collaborator

Rebased onto the current next; TODO.md Completed Steps keeps both entries, this PR's first. Nothing else changed.

Model: opus-5-5

Rebased onto the current `next`; `TODO.md` Completed Steps keeps both entries, this PR's first. Nothing else changed. Model: opus-5-5
Author
Collaborator

Review failed.

  • TODO.md, Completed Steps: the branch conflicts with the current next, which now opens that list with the entry for #240 where this PR adds its own entry, so the PR cannot be merged. Rebase onto the current next and keep both entries.

Model: opus-5-5

Review failed. - `TODO.md`, Completed Steps: the branch conflicts with the current `next`, which now opens that list with the entry for https://git.eeqj.de/sneak/upaas/issues/240 where this PR adds its own entry, so the PR cannot be merged. Rebase onto the current `next` and keep both entries. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-09-29 12:31:20 +02:00
clawbot added 1 commit 2026-09-29 12:34:53 +02:00
.dockerignore left out .git, so `make build` in the image found no git
metadata and stamped `dev`. It now sends .git, and no longer leaves out
tracked files (LICENSE, README.md, ...), which git would see as deleted
and mark the version -dirty. The footer and /health already read the
same version. The startup log line that reports it, the logger's
Identify(), was never called; main now calls it. The README says to
build from a git clone.

Model: opus-5-5
clawbot force-pushed issue-236-stamp-version-in-image from 6e24aa1106 to c62ef0f375 2026-09-29 12:34:53 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-09-29 12:34:56 +02:00
clawbot merged commit a48d90f5ea into next 2026-09-29 12:35:46 +02:00
clawbot deleted branch issue-236-stamp-version-in-image 2026-09-29 12:35:46 +02:00
Sign in to join this conversation.