chore: deploy-audit cleanup (drop fictional binary scaffolding, fix version embed)#19
Merged
Merged
Conversation
…version embed
A deploy-readiness audit on the hawk-eco set surfaced several files in this
repo that referenced a `yaad` binary, a Homebrew bottle, and a Docker image
— none of which yaad actually produces. yaad is a Go library (no `cmd/`,
no `package main`, no goreleaser config). All four are removed and the
runtime version constant is wired up correctly.
Removed
-------
- install.sh — fetched `yaad_${OS}_${ARCH}` from GitHub Releases and
invoked `yaad auto`. No binary exists, no goreleaser is configured to
build one, and there is no `auto` subcommand. Following this script
would always fail.
- Formula/yaad.rb — Homebrew formula pointed at
`releases/download/v0.2.0/yaad_<os>_<arch>` artifacts that have never
been published, ran `yaad --version` against an absent binary, and was
still pinned at `0.2.0` while the rest of the repo had re-baselined to
`0.1.0` (CHANGELOG explicitly claimed it had been rebaselined — it had
not). Will return once a binary actually ships.
- deploy/docker/docker-compose.yml + .dockerignore — `dockerfile:
Dockerfile` with context `../../`; no Dockerfile is present anywhere
in the repo. `docker compose build` would fail on first invocation.
Consumers wire `internal/server.RESTServer` into their own daemons,
or use `hawk daemon` which embeds yaad.
- deploy/ directory — removed (empty after the compose file went away).
Fixed
-----
- internal/version/version.go: `Version` is now populated at compile
time via `go:embed` from the new `internal/version/VERSION` file
(kept in sync with the root VERSION via `make sync-version`).
Previously hard-coded to `"dev"` and only overrideable through
ldflags — but yaad has no build path that sets those ldflags, so
every `go build` / `go install` / `go get` reported `dev` regardless
of the VERSION file. Matches the pattern eyrie + tok already use.
- Makefile: documents the go:embed pattern in the versioning comment
and adds a `make sync-version` target that copies root VERSION into
internal/version/VERSION.
- CHANGELOG.md: dropped the (false) claim that Formula/yaad.rb was
rebaselined; documents the removal of install.sh / Formula /
deploy/docker; documents the version.go embed switch.
Pinned
------
- .github/workflows/ci.yml: deadcode pinned to v0.30.0 (was `@latest`).
Matches eyrie + hawk and gives reproducible CI.
Validation
----------
- go build ./... — clean
- go vet ./... — clean
- gofumpt -l . / goimports -l . — clean
- golangci-lint run --timeout=5m — 0 issues
- go test ./internal/version/... -v — all 5 tests PASS
- go test ./... -short — all 33 packages PASS
- govulncheck ./... — no vulnerabilities
Contributor
Author
|
Self-review: removed user-facing fictional binary scaffolding (install.sh, Formula, deploy/docker) that always failed; fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A deploy-readiness audit across the hawk-eco set found that this repo was carrying scaffolding for a
yaadbinary — an installer, a Homebrew formula, a Docker compose file, and aVersion = "dev"constant waiting for ldflags. yaad is a Go library (nocmd/, nopackage main, no goreleaser config,Makefilebuild target literally says "library consumed by hawk; no standalone binary"). None of that scaffolding could actually work, and one piece directly contradicted the CHANGELOG.What changed
Removed
install.sh— fetchedyaad_${OS}_${ARCH}from GitHub Releases and invokedyaad auto. No binary exists, no goreleaser is configured to build one, and there is noautosubcommand. Following the README's curl-pipe-sh would always fail.Formula/yaad.rb— Homebrew formula pointed atreleases/download/v0.2.0/yaad_<os>_<arch>artifacts that have never been published; ranyaad --versionagainst an absent binary; and was still pinned at0.2.0while the rest of the repo had re-baselined to0.1.0. (The CHANGELOG explicitly claimed this file had been rebaselined — it hadn't.)deploy/docker/docker-compose.yml+.dockerignore—build.dockerfile: Dockerfilewith context../../; noDockerfileexists anywhere in the repo.docker compose buildwould fail on first invocation. Consumers who want an HTTP service wireinternal/server.RESTServerinto their own daemon (or usehawk daemon).deploy/— directory deleted entirely (empty after the compose file went away).Fixed
internal/version/version.go—Versionis now populated at compile time viago:embedfrom the newinternal/version/VERSIONfile. Previously hard-coded to"dev"and overrideable only via ldflags — but yaad has no build path that sets those ldflags, so everygo build/go install/go getwas reportingdevregardless of the root VERSION file. Matches the pattern eyrie + tok already use.Makefile— documents the newgo:embedpattern in the versioning comment block and adds amake sync-versiontarget that copies rootVERSIONintointernal/version/VERSION.CHANGELOG.md— dropped the false claim thatFormula/yaad.rbhad been rebaselined; documents the removal of install.sh / Formula / deploy/docker; documents the version.go embed switch.Pinned
.github/workflows/ci.yml—deadcodepinned tov0.30.0(was@latest). Matches eyrie + hawk and gives reproducible CI.Validation
All run locally on Go 1.26.4 (matches
go.mod):go build ./...go vet ./...gofumpt -l ./goimports -l .golangci-lint run --timeout=5mgo test ./internal/version/... -vgo test ./... -shortgovulncheck ./...Risk
Low. The only
*.gochange is ininternal/version/, covered by existing tests. The deletions remove user-facing footguns (broken installer, stale Homebrew formula).Follow-ups (separate PRs)
The audit also fixed similar issues in tok (GrayCodeAI/tok#56), eyrie (GrayCodeAI/eyrie#26), and a larger one coming for hawk.