test(build): hold the revision stamp to a symbol that exists #283
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!283
Loading…
Reference in a new issue
No description provided.
Delete branch "test/build-revision"
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?
Tests only. Covers the fix for #279, which landed at 0% coverage.
Why this needs a guard specifically
-ldflags -Xis the one piece of wiring in this repository that fails silently. The linker does not error on a symbol it cannot resolve — it writes nothing and exits zero. So a rename ofbuildRevision, a package move, or a module rename leaves an unstamped binary and a completely green build, and nobody finds out until someone reads a log expecting a sha and sees an empty string.That is the same failure shape as the ones this repo has been closing all night: a claim that looks true because nothing checks it.
I verified the current path resolves rather than assuming it. Built a throwaway
mainwith the Dockerfile's exact-Xargument and read the value back:It works today. These tests hold it that way.
Three properties
…IsEmptyWhenUnstamped…DockerfileStampsThisPackagesVariable-Xtarget equals this package's variable, compared against the module path read fromgo.modrather than written twice…PublishPassesTheRevisionBuildArgpublish-image.shpasses the ARG the Dockerfile declaresThe third exists because a declared
ARGwith nothing passed stamps an empty string, which is indistinguishable from no stamp at all. Two independent ways to get the same silent nothing.Verified by mutation
community.buildRevin the Dockerfilepublish-image.shstops passing the argNote
The implementation took the
--build-arg→-ldflags -Xroute rather than copying.git, which keeps-trimpathand keeps repository history out of the build context. Good call — and it means the serving process can now report its own revision, soSIRENS_ECHO_IMAGEstops being something a human has to set correctly.go vet,gofmt, fullgo test ./...,pre-commit run --filesclean.Quail (QA)
61d43a357d05ef749670