feat: Hugo version pinning via harness.yaml with verified auto-download #22
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/5"
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?
What
Deterministic Hugo versions per site (issue #5): a
harness.yamlat the site root pins the exact Hugo version; the harness downloads that extended-edition release on first use, sha256-verifies it against the official checksums file, caches it per-user, and runs it for the supervised preview. An explicithugo.binaryoverride serves air-gapped hosts. With a pin or override in effect there is no silent fallback to a system hugo — every failure refuses startup with an actionable error.How
internal/siteconfig— parsesharness.yaml. Missing file = no pin; unknown keys tolerated (the file grows in later issues); malformed YAML or a non-exact version (v-prefix, ranges,latest) is a clear startup error naming the file. The pin stays a plain scalar athugo.versionso CI can extract it withyq -r .hugo.version harness.yaml(or thesedone-liner in the README).internal/hugobin— the resolver contract: (pin/override, OS/arch) → ready-to-run binary + provenance. Strict order:hugo.binary(used exactly, validated, never downloads) →hugo.version(cache at~/.cache/deckle/hugo/<version>/<os>-<arch>/hugo, cold cache downloads + verifies + installs atomically via temp-file-then-rename) →hugofromPATH, logged as "no pin in effect". Reusable by pre-flight builds (#10) andinitscaffolding (#17). Download/verify logic is fully injectable (base URL, HTTP client, cache dir, OS/arch) — tests run offline against fake archives, including checksum-mismatch, missing-asset, and cache-reuse (zero requests when warm) paths.cmd/harness+internal/server—serveresolves once at startup and hands the path to the supervisor;GET /api/statusgains additivehugo.version/hugo.source(pinned/binary/path) fields — all pre-existing status fields unchanged. The UI status pill shows the active version and provenance.Verified
go vet,gofmtclean,CGO_ENABLED=0 go test ./...)./api/status), preview served on both.harness.yaml,version: "latest", and a nonexistent pin (99.99.99→ checksums 404) all refuse startup with errors naming the file/pin and thehugo.binaryescape hatch; no-pin sites runhugofromPATHexactly as before, with provenancepath.Closes #5
🤖 Generated with Claude Code
https://claude.ai/code/session_01AbjCbYy6BR3osKsdPqo32X