Repository navigation
ci: refresh the Go module cache on toolchain bumps, and pin semgrep - #23775
Merged
Merged
Conversation
The Go module cache key now includes go.mod. A toolchain-directive bump changes only go.mod, and cache keys are immutable, so after each such bump every Go job downloaded the new toolchain until go.sum next changed. The restore helper also sets GOMODCACHE, because machine images default GOPATH to ~/.go_workspace and ignored the restored ~/go/pkg/mod. A setup-job test checks both. The semgrep image is pinned by tag and digest. Both semgrep jobs gate ci-gate, so a floating tag lets an upstream release fail every PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teddyknox
marked this pull request as ready for review
October 29, 2026 16:26
This was referenced Nov 6, 2026
einar-oplabs
self-requested a review
November 10, 2026 14:32
einar-oplabs
approved these changes
Nov 10, 2026
mds1
added a commit
that referenced
this pull request
Nov 10, 2026
Resolve the Go module cache conflict with #23775. The key keeps the branch scope and gains go.mod, so a toolchain bump still gets a fresh key: <branch>:<go.mod>-<go.sum>, falling back to develop's. prep-go-modules now counts the module cache through the GOMODCACHE that restore-go-mod-cache sets, instead of "go env". After a go.mod toolchain bump, "go env" downloads the toolchain before the count, so the halt would skip the save that #23775 needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 5 tasks
Contributor
Agent approval checkHead branch claude/circle-go-cache-fixes matches agent prefix claude/ Current head: A write-capable human can approve by submitting a native review or by commenting:
|
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.
Two small CircleCI fixes. Neither changes what CI does today; both remove a way for CI to get slower or to break without a change in this repo.
1. Go jobs stop re-downloading the Go toolchain after a
go.mod-only bump.go.sum. A toolchain-directive bump such as security: Update go toolchain directive to v1.26.9 [SECURITY] #23290 or security: Update go toolchain directive to v1.26.10 [SECURITY] #23546 changes onlygo.mod. Cache keys are immutable, so the cache never captured the new toolchain, and every Go job downloaded it again untilgo.sumnext changed.go.mod.GOPATHto~/.go_workspace, so they ignored the restored~/go/pkg/mod. Today that affects the dailypreimage-reproducibilityjob, which restored 2.3 GiB and still downloaded modules (job 5798921).GOMODCACHE.2. semgrep is pinned to 1.182.1 by tag and digest.
semgrep-scan-localandsemgrep-testgateci-gate. With a floating image, an upstream release can fail every PR.latestand thepipx:semgreppin inmise.toml, so nothing changes today.Effect. CI only. No effect on any product code.
Trade-offs.
go.modis ahead of mise's Go keeps that toolchain. Later snapshots carry it untilc-go-cache-versionis bumped, the same way old module versions accumulate today.mise.toml, so tool bumps do not re-save the ~2 GiB snapshot.mise.toml, but nothing enforces that the two stay equal.Testing. All 116 CI checks pass on this PR. A new setup-job step (about 1–2 s) runs a regression test,
.circleci/scripts/test-go-mod-cache.py. It checks that the key changes withgo.modandgo.sum, and that Go reads the restored directory under a machine image'sGOPATH.ci-config-reviewerfound no blockers.Context. This is one of four small PRs that change code CircleCI runs, found while reviewing the RWX pilot (#23151): #23772, #23775, #23776 and #23780. Each stands alone. The additive RWX shadow is #23783. The reviewer flagged the per-node
go-testsbuild cache as unmeasured, so that change moved to #23776.Tracked in #24044.
🤖 Generated with Claude Code