CI: download gc from the package registry instead of building it #15
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-464"
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?
test / lintno longer builds gc from source: it downloads the build gascity-root's gc workflow publishes forGC_SHA, and builds only when there is none..forgejo/workflows/test.yaml,lintjob only): a newid: gcstep, gascity-root'stest / configstep with the pin read fromGC_SHAinstead ofgc.pin. It fetchesgc-linux-<amd64|arm64>and its.sha256from$GITHUB_SERVER_URL/api/packages/mikluko/generic/gc/$GC_SHA/, checks them withsha256sum -c, puts the binary onPATHand setsdownloaded=true. Thego installstep is nowif: steps.gc.outputs.downloaded != 'true': it runs only when the pin is not published or the download or its checksum fails.setup-gostays unconditional, since the job'sgo vetandgo testneed Go.test / linttook 3m06s to 4m06s (typically about 3m10s) over its last eleven successful runs. gascity-root'stest / config, which this step was copied from (its commit08a14b0), went from about three minutes to 8s on its pull request and 11s onmain.bash -ewith a fake runner environment (RUNNER_TEMP,HOME,GITHUB_PATH,GITHUB_OUTPUT). Against the real registry forGC_SHA, once per architecture branch:gc-linux-<arch>: OK,downloaded=true, a static ELF of that architecture installed755, its SHA-256 equal to the published one. Against a local server with the registry's URL layout: a wrong checksum, a corrupted binary, a missing.sha256, an unpublished pin and a pin published for the other architecture only each leavedownloadedunset, install nothing and exit 0, so the fallback runs, and the log says why.gc lint .,go vet,go test,tests/worktree-setup.sh,tests/merge.shandtests/upgrade.shpass; thescriptsandchangelogjobs are unchanged.test / lintis the check:go installshould show as skipped, and the job should finish well under the baseline above. If it builds instead, theid: gcstep's log gives curl's orsha256sum's reason.mikluko/changelog@v1) has no per-pull-request requirement. The checksum comes from the same registry as the binary, as in gascity-root: it catches a corrupt or truncated download, not a replaced artifact. BumpingGC_SHAto a pin gascity-root has not published yet builds from source, as before.🤖 Generated with Claude Code
Bead: gascitypacks-464
Review: passes. Reviewed at
bf0b14ca6eba28ce8aedb77fffcb6f64721c1a97against bead gascitypacks-464.Checked
.forgejo/workflows/test.yaml, +17 −1, in thelintjob only: the newid: gcstep and anif:on thego installstep. Nothing unrelated.main(eeb3aef) has not changed this file since the branch pointb341fca, so the squash lands cleanly.id: gcstep is gascity-root'stest / configstep line for line, with$(cat gc.pin)replaced by$GC_SHA: it fetchesgc-linux-<arch>and its.sha256, runssha256sum -c, installs the binary as$HOME/.local/bin/gc, adds that directory toGITHUB_PATHand setsdownloaded=true.go installruns only when that output is nottrue.setup-gostays unconditional, as the bead asks.test,pull_request,bf0b14c):lint,scriptsandchangelogsucceeded. Thelintlog shows the download path taken:gc-linux-amd64: OK, thengc lint: 2 pack(s) ok0.14 s later with nogo: downloadingline between them, then the forgejo pack'sgo testpassing.linttook 15 s; onmainateeb3aef(run 37) it took 3m04s, building gc.curl -forsha256sum -cleaves theifuntaken, the step exits 0 without the output, andgo installruns as before. Against the registry without a token:gc-linux-amd64,gc-linux-arm64and both.sha256files answer 200 for this pin, each checksum file names its binary by basename, and an unpublished pin answers 404.test / changelogpassed without it. The README does not say how CI gets gc, so nothing there goes stale. The merge does not startrelease, whosepathsfilter names onlyCHANGELOG.mdandrelease.yaml.Follow-ups, none blocking
GC_SHAnames. The checksum comes from the same registry, as the description says, so it catches a corrupt download and not a replaced artifact. Keeping the expected SHA-256 besideGC_SHA, one per architecture, would bind the binary to the pin again.setup-gostill caches inlint. With gc not built there, it saves only the forgejo pack's build cache, warns that the module cache directory does not exist, and the cache service answers 500 on the save, as it does onmain.cache: false, as in gascity-root, would drop the step's work and its warnings.curlhas no--max-time: a registry that accepts the connection and then stalls holds the job until the runner's timeout instead of falling back to the build.Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.