ci(appsec): tolerate Go module cache miss instead of hard-failing#5065
Conversation
The three "Restore Go modules cache" steps (macos, disabled, golang-linux-container jobs) set fail-on-cache-miss: true. When the GitHub Actions cache service times out during restore, that turns a transient miss into a hard job failure instead of falling back to a rebuild (e.g. run 30056911582, linux/arm64 golang:1.26-trixie). Set fail-on-cache-miss: false on the three restore steps. These jobs manage caching themselves (setup-go cache: false) and point GOMODCACHE at the restored path with no -mod=readonly, so on a miss Go re-fetches the modules pinned by go.sum -- same versions, slower run. The go-mod-caching job already relies on this cold path.
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 08b51d3 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-24 11:19:25 Comparing candidate commit 08b51d3 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 326 metrics, 0 unstable metrics, 1 flaky benchmarks without significant changes.
|
What does this PR do?
The three
Restore Go modules cachesteps inappsec.yml(themacos,disabled, andgolang-linux-containerjobs) setfail-on-cache-miss: true. When the GitHub Actions cache service times out during restore, that turns a transient miss into a hard job failure instead of falling back to a rebuild.Example: run 30056911582 —
linux/arm64 golang:1.26-trixiefailed on anactions/cachedownload timeout plusfail-on-cache-miss.This sets
fail-on-cache-miss: falseon those three restore steps.Why it's safe
These jobs manage caching themselves (
actions/setup-gowithcache: false) and pointGOMODCACHEat the restored path with no-mod=readonly. On a miss, Go re-fetches the modules pinned bygo.sum— same versions, just a slower run. Thego-mod-cachingjob already relies on this cold path.Motivation
Removes a class of infra-only CI failures (cache-service timeouts) seen in the CI report for commit
7e9bb86f. CI-only; no code orgo.modchanges. Verified withactionlint.