ci: reuse Go test cache in PR gate; fix stale .github paths filter #15
Reference in New Issue
Block a user
Delete Branch "ci/reuse-go-test-cache"
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?
Why
operator-config#184 (merged 2026-06-10) gave the runner fleet a persistent, host-mounted
GOCACHE. With-count=1pinned in theteststep, Go never reuses cached test results — the cache only accelerates compilation. The pin arrived in76569b7bundled with-race(the commit rationale covers the race detector, not cache-defeat) and was then mirrored into ci.yml — cargo-cult, not correctness:httptestmock servers, no live network/external state;-raceis kept (connect orchestrator heartbeat/poll goroutine races,76569b7).Also fixes the paths filters still pointing at
.github/workflows/ci.ymlafter the post-suspension rename — edits to the actual workflow file never re-triggered CI (this PR would not have run its own gate without the fix).release.ymlcarries the same-count=1but is a publish workflow — intentionally untouched.Before-measurement (Gitea
action_run_job, repo_id=15)7-day window: 0 successful runs (quiet repo) — all-time successful
testjobs used as baseline:Expected: on reruns / unchanged-package runs the
go test -race ./...step collapses to(cached)results (seconds instead of minutes); compile already warm via operator-config#184. Estimated cache-hit job duration ~60-90 s (checkout + setup-go + tidy + vet dominate). Runs that change Go code still pay for the affected packages — correct behavior, not a regression.Verify-after query (operator, gitea postgres)
Plus job-log spot-check:
ok <pkg> (cached)lines present on the rerun.🤖 Generated with Claude Code
Security 5-axis — APPROVE. ci: reuse Go test cache in PR gate + fix stale path (+8/-3, ci.yml only).
pathsfilter referenced.github/workflows/ci.yml, but on Gitea the workflow lives at.gitea/workflows/ci.yml— so edits to the CI file itself were NOT re-triggering the gate. The fix corrects the path. ✓-count=1fromgo test -race ./...so unchanged packages reuse the fleet-persisted GOCACHE (operator-config#184).-raceis retained. Go's cache key includes source+deps+env, so unchanged-package reuse is sound; the comment asserts tests are hermetic (httptest mocks). Non-blocking note:-count=1is the conventional guard against a cached pass masking an env/time/network-dependent flake — removing it trades a little CI-fidelity for speed; safe given the hermetic-test assertion, but if any test ever gains hidden external state a cached green could hide it.Gate GREEN (CI/Test ✓). Author devops-engineer ≠ me → APPROVE.
qa APPROVE (5-axis). Correctness: corrects a DEAD path filter — repo runs Gitea Actions so the push/PR trigger filtered on '.github/workflows/ci.yml' never matched; '.gitea/workflows/ci.yml' makes workflow edits re-trigger CI. Robustness: drops '-count=1' to allow GOCACHE reuse (operator-config#184 persistent cache) — justified because tests are hermetic (httptest mock servers) and the cache invalidates on any source/dep change; -race retained (
76569b7heartbeat/poll goroutines). NON-BLOCKING note: if any package later proves non-hermetic (order/state-dependent), restore -count=1 for that package — the cache would otherwise mask it. Security: none. Performance: improves (cache reuse). Readability: clear inline rationale. CI/Test green, mergeable. Approving.Blocked by branch-protection required-context name mismatch (the .gitea vs .github paths-filter issue this very PR aims to fix). The emitted context is
CI / Test / test(green) but the merge endpoint returns HTTP 405Not all required status checks successful— BP requires a context name that no workflow emits on this repo. Chicken-and-egg: cannot merge the fix because the broken required-context config blocks it. Needs an admin BP edit to align the required-context name (or temporarily relax it) to land this. Not forcing.