Repository navigation
fix(ci): setup-go never snapshots a persistent runner's Go cache - #334
Conversation
The required `validate / validate` job died three times today in "Set up Go" with "No space left on device" (charly-ci-qo-4-1, -no-2-1, -no-1-1). setup-go's default cache tars GOMODCACHE + GOCACHE in its post step and untars them on the next run. On the persistent self-hosted runners those directories already survive between jobs, so: - each save snapshotted the runner's whole accumulated cache: a 2,846,485,519-byte archive under the shared key setup-go-Linux-x64-undefined-…, with ~3 min of tar and upload in teardown (#324's original signature); - each restore wrote that archive back over the live copy until the disk ran out (today's signature). Every setup-go step in this repo now states its cache decision: - pr-validator `validate` (the contract sweep): `cache: false`. Built cold with an empty module cache and GOPROXY=off, the sweep compiles in 3.6s and the module cache stays empty, so no cache helps it on any runner. Its `cache-dependency-path` goes with it. - pr-validator `lint`: `cache: false`. Its cache never worked: the PR sits under pr-head/, so every run logged "Restore cache failed: Dependencies file is not found" and "Primary key was not generated". - candy-validate and image-build (charly builds with real dependencies): `cache: ${{ runner.environment == 'github-hosted' }}`, so the cache is used only where the runner starts empty. scripts/setup-go-cache_test.sh (wired into workflow-checks) refuses any setup-go step without an explicit decision, or with any other value. It fails on all four steps at origin/main and passes here, and its self-test proves the checker rejects both bad forms. Closes #324 Agent: cloud-charly · Claude Code session 4f8404c4-b4fe-44e0-90d2-89db3fe800d5 Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system) Claude-Session: https://claude.ai/code/session_01Tvdn3vuAwUEWaR9p9fc7ca
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no weakened gate (setup-go cache flags only; the validator's logic, prompt, and branch-protection posture are untouched; the new test strengthens the gate). Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
The org's required
validate / validatejob died three times today in Set up Go withNo space left on device, on three runners (charly-ci-qo-4-1,charly-ci-no-2-1,charly-ci-no-1-1). The cause isactions/setup-go's default cache on persistent self-hosted runners. It also explains #324's original teardown signature. This closes #324.Mechanism, measured:
GOMODCACHE(/home/ubuntu/.cache/charly/go/mod) andGOCACHE(/home/ubuntu/.cache/go-build) persist between jobs.setup-go-Linux-x64-undefined-…, becauseImageOSis unset on self-hosted runners. That took 84 s of tar plus about 3 min of upload in a passing run's teardown, which is fix(runner): self-hosted runner exhausts disk during workflow teardown and tag-on-merge #324's original signature.tar: … Cannot open: File exists×96,327) until the disk runs out, which is today's signature.The fix: every
setup-gostep in this repo states its cache decision.pr-validator.ymlvalidate(the contract sweep)cache: false, and the deadcache-dependency-pathis droppedGOPROXY=off, it compiles in 3.6 s and the module cache stays at 4.0K. No runner gains from a cache.pr-validator.ymllintcache: falsepr-head/, so every run logged##[warning]Restore cache failed: Dependencies file is not foundandPrimary key was not generated.candy-validate.yml,image-build.yml(charly builds with real dependencies)cache: ${{ runner.environment == 'github-hosted' }}scripts/setup-go-cache_test.sh(new, wired intoworkflow-checks.yml) refuses anysetup-gostep with no explicitcache:, or with any other value.How tested
Head
7c5c840374cb1bff844a5df000c8ff7422b27fc6(treef5c7bba673beb8824bed58c23dfa0d35ee9f00fe), worktree.worktrees/cloud-charly/dotgithubofforigin/main6f5b133bf9d3a655dee1081418e802880e5c252c.The evidence the mechanism rests on (job logs, read with
gh api --allow-escape-sequences repos/opencharly/spec/actions/jobs/<id>/logs):charly-ci-no-1-1):Cache hit for: setup-go-Linux-x64-undefined-go-1.26.0-272dcab0…, thenReceived … of 2846485519, thentar: …/.cache/go-build/…: Cannot write: No space left on device, then##[error]No space left on device./usr/bin/tar --posix -cf cache.tzst … --files-from manifest.txtat 15:14:06, thenSent … of 2846485519, thenCache saved with the key: setup-go-Linux-x64-undefined-…at 15:17:11.gh api orgs/opencharly/actions/cache/usage-by-repository): pod-kde-vnc-cdp 15.5 GB in 3 entries, sdk 12.3 GB, spec 10.9 GB, .github 10.7 GB, and so on.The new test fails on
origin/main's workflows (swapped in, run, restored):With the change:
actionlint on the four edited workflows (actionlint 1.7.7):
Every test
workflow-checks.ymlruns, run locally on this tree; the last output line of each and its exit code:Change class: CI workflow configuration (
opencharly/.github). Its gate isworkflow-checks.yml, reproduced locally above, plus this PR's own validator run. The changed steps run frommainonly after the merge: the org-required workflow is read at@refs/heads/main. So the post-merge proof is the next validator runs on other PRs, where Set up Go must log noCache hit/Cache savedfor the validate step. I will paste it on #324.Spike
The three candidates, each held to one requirement (the table below): the required job must pass on these runners without a manual infrastructure command.
false, or GitHub-hosted only)GOPROXY=off, empty module cache, rc=0), so the 2.85 GB restore and the ~3 min save disappear. The lint cache was already a no-op with a warning. actionlint typesrunner.environment(its error for an unknown property listsenvironment: stringin the runner object type; control:runner.nonexistentis rejected).Winner: A.
Rulebook compliance
/charly-internals:repo-setup,/charly-internals:root-cause-analyzerand/charly-internals:git-workflowwere loaded, and this repo'sAGENTS.md("Build / validate / test") was read.setup-gocache a decision, so the default (a cache) was taken silently. The new test is that control. Zero new warnings: the lint job's per-run##[warning]is removed.setup-goin this repo is covered: the test lists all five steps, includingworkflow-checks.yml's existingcache: false. The same default in 27 workflow files of 22 other repositories is filed as Per-repo workflows still take setup-go's default cache on persistent self-hosted runners #333 (one PR per repository, each owned elsewhere).origin/mainand passes here.workflow-checks.ymlsuite and actionlint on the committed tree..worktrees/cloud-charly/dotgithub. fix(runner): self-hosted runner exhausts disk during workflow teardown and tag-on-merge #324 was claimed before the edit, and the open-PR list showed no other session touching these workflows.Plan conformance
Winning candidate: A, an explicit
setup-gocache decision per step.No DESIGN-governed surface — the change is the org's CI workflow configuration (
setup-gocache decisions in four workflows, plus a policy test). It touches noDESIGN.cuedefinition, noai.opencharly.*label and no InstallPlan surface. The rule it follows is AGENTS.md C5: "Do: fix the cause instead" of a blind retry or a manual infrastructure command.Filed issues
setup-godefault in 27 per-repository workflow files of 22 repositories. Each repo applies the rule this PR establishes.Change classification
Change class: CI workflow configuration. Gate: the
workflow-checks.ymlsuite (reproduced locally) and actionlint; the live proof follows the merge on other PRs' validator runs. Tier: analysed on a live system. The mechanism is measured on live runs and the checks pass locally, but the changed workflow cannot run on its own PR.Breaking change + rollback: none for consumers. Jobs stop restoring and saving the multi-GB cache; on a GitHub-hosted runner, candy-validate and image-build keep their cache. Rollback: revert this commit.
https://claude.ai/code/session_01Tvdn3vuAwUEWaR9p9fc7ca
Agent:
cloud-charly· Claude Code session4f8404c4-b4fe-44e0-90d2-89db3fe800d5Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)