build: Check Go and Node before building and move Docker to Alpine 3.24 #22
No reviewers
Labels
No labels
blocked
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
s1d3sw1ped/helix-proxy!22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ash/toolchain-preflight-21"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #21
Why
Justin's forge rule (2026-10-10): any toolchain that can only have one version installed at a time gets a preflight that stops the build before it does anything and prints found / required / fix. helix-proxy's
make buildran npm and Go with no check, had no.nvmrc, and shipped onalpine:3.20(EOL 2026-04-01) with a floatinggolang:1.27-alpinebuilder. Standard: forge-standards/forge-toolchain.md.What changed
scripts/check-toolchain.sh: the forge-standard preflight, byte-identical to the forge-standards copy and bucket#21. It checks Go against go.mod (toolchain line wins), Node against.nvmrc, and that go.mod'sgo/toolchainlines match HEAD.Makefile: newcheck-toolchaintarget.build,ui,ui-buildandrundepend on it.ui-buildused to depend onclean, which deletes the binary,ui/distanddata/.cleannow runs as ui-build's first recipe line, after the preflight, so a failed check leaves the tree alone even undermake -j.test*,fmt,cleananddockerdon't depend on it.go.mod:toolchain go1.27.2undergo 1.27.0..nvmrc:24.ci.yaml, both jobs) andrelease.yaml: aCheck toolchainstep right after Setup Node. Action versions are unchanged.Dockerfile: buildergolang:1.27.2-alpine3.24, runtimealpine:3.24.node:24-alpineis unchanged.README.md(Development section): what the preflight checks and how to fix a mismatch.Proof (jumpbox, my own runs at
b0a3f1b)Right toolchain (go1.27.2 via GOTOOLCHAIN=auto, Node v24.21.0 / npm 11.19.0, GNU Make 4.4.1):
make check-toolchain,make ui,make ui-build,make build,make -j4 build: all rc=0. The binary built, andmake runstarted the proxy (stopped by a 6s timeout).git statusstayed clean.Wrong toolchain,
make build: each case stopped atcheck-toolchain(rc=2). Binary mtime andui/distwere unchanged andgit statusstayed clean:make -j4 build,make runandmake uiwith Node 26 also stopped at the preflight.Tests:
go test -count=1 ./...passed 233 tests and subtests (0 fail, 0 skip) across 8 packages.go test -race ./...passed.gofmt -l .is clean.go mod verifyOK. No.gofiles are touched.Docker: there's no docker on the jumpbox, so I couldn't run
docker build. I checked thatgolang:1.27.2-alpine3.24andalpine:3.24exist on Docker Hub (amd64 and arm64).Risk / rollback
Build-only. A dev machine without Node 24 or Go 1.27.2 now gets a clear stop instead of a build. With GOTOOLCHAIN=auto (the default), Go fetches 1.27.2 itself. Rollback:
git revertthe merge.Waterfall
Step 1: OpenCode on the jumpbox (
lemonade/gemma-26b-censored, one run of about 3 minutes, no stalls) wrote every file change. I committed it and ran all the proofs above myself.Base is
develop, per CONTRIBUTING.md ("Open a pull request againstdevelop"). develop and master are at the same tip,4054ea2.The code is good. Base is the current develop tip (
4054ea2), the preflight matches the bucket#21 copy, and the Makefile reorder fixes the old problem whereui-buildrancleanbefore anything was checked. The go.mod toolchain pin and the.nvmrcline up with the CI setup-go/setup-node steps, and the README note is enough.Two things before this merges:
b0a3f1b. Go Tests and Build are still pending.golang:1.27.2-alpine3.24, runtimealpine:3.24), and CI doesn't build the image. Only the release job does. Same as #20, I'm getting Jerry to run a throwawaydocker build --no-cache --pullon the lab with nothing pushed. I'll post the result here.Linus: hold the merge until both are done and I've posted the docker pass. This touches CI config and the release image, so it goes the normal way and isn't a low-risk auto-merge. Ash: nothing for you to do unless CI or the docker build fails.
Throwaway build and smoke of
b0a3f1bon dockge.lab.rrd: passes.sudo docker compose build --no-cache --pullsucceeded in 10s. Bases: node:24-alpine@sha256:44fce696f38b…, golang:1.27.2-alpine3.24@sha256:f92b6ef800e4…, alpine:3.24@sha256:294b683cb724… (runtime image is Alpine 3.24.2).GET /apireturned 200{"status":"OK"}, admin UI/returned 200, a bad login returned 401, and the proxy port answered 200.One note for the smoke only: the bind-mounted
data/has to be owned by uid 1000, or the app exits withmkdir /app/data/certs: permission denied. That is not a regression from this PR.Thanks @jerry. That clears the hold from my review 617: the image builds on the new Alpine 3.24 bases and the smoke passed. CI is green on
b0a3f1b, so this is GO from me. @linus, it's yours to merge.The uid 1000 note on
data/predates this PR, so it isn't blocking. It's worth a line in the compose docs some time.APPROVE on head
53f75d00d9.Delta since
b0a3f1be7d(my review 617, which Jerry's docker smoke test passed on) is two commits and nothing else:.gitea/workflows/{ci,fmt,release}.yamlremoved,.forgejo/workflows/{ci,fmt,release}.yamladded.gitea.ref_name,gitea.server_url,gitea.repository,gitea.actortogithub.*.CI is green on this exact head (gofmt, Build, Go Tests, push and pull_request). PR is open, mergeable, and not behind the base tip
48849fc078.REQUEST_CHANGES on head
53f75d00d9. This supersedes my APPROVE (review 642) from a minute ago, which was wrong: I said the head was not behind base, and it is.develop is now
48849fc078, and the head is 4 commits behind it: #23 and #24 already moved the workflows to .forgejo/workflows, and #25 merged master into develop. The two workflow commits on this branch (58d2214aca,53f75d00d9) now duplicate what develop has. The delta itself was clean (workflow move plus gitea.* to github.* only, no Dockerfile or code change, so the docker smoke onb0a3f1bstill carries over), but a head behind base can't merge, however green its old CI was.Please rebase this branch onto current develop and drop the two workflow commits, leaving only b0a3f1b's content, on this same branch. Check the Dockerfile and Makefile are unchanged by the rebase, then push. I will re-review the new head; if the Dockerfile is byte-identical to b0a3f1b's, the smoke result carries over.
REQUEST_CHANGES on head
f2c5db6d3d. The code is right now, but the branch history still needs the cleanup I asked for in my last review.Merging develop in fixed the behind-base problem, and the net diff against develop
48849fcis exactly the toolchain change: the preflight script, the check steps in the two .forgejo workflows, .nvmrc, the go.mod toolchain line, the Makefile order and the Alpine 3.24 bases. CI is green on it. The Dockerfile hasn't changed since the head Jerry's docker build passed on.The problem is what lands in develop with it. Our merge lever only does merge commits, so
58d2214and53f75d0would go in as a second copy of the workflow move that develop already got from #23 to #25, plus a "Merge remote-tracking branch" commit. Anyone reading the log later sees the move twice and has to work out which one counted.The quickest way to get one clean commit, since the merge commit already has the tree we want:
That leaves a single "build: Check Go and Node before building and move Docker to Alpine 3.24" commit on top of develop with the same content. Wait for CI to go green on it and I'll approve.
APPROVE on head
f2c5db6d3d. This supersedes my REQUEST_CHANGES 649; I was wrong to ask for a history cleanup. A merge commit in the branch history is fine, and no force push is needed.Checked on this exact head:
48849fcis 8 files, +87/-9: the two .forgejo workflows (a "Check toolchain" step each), .nvmrc, Dockerfile, Makefile, README, go.mod toolchain line and scripts/check-toolchain.sh. There is no .gitea directory and no duplicate workflow move in the net diff.b0a3f1b(the head Jerry's docker build passed on) and this head, the only changes are the workflow move that develop already carries. The Dockerfile, Makefile, go.mod, .nvmrc and script are untouched, so Jerry's docker smoke CLEAR carries over.f2c5db6d3dis green: Format / gofmt (push and pull_request), CI / Build (push and pull_request), CI / Go Tests (pull_request).Linus: clear to merge at this head.