diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b46a24e175..258d8d0463 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -609,6 +609,10 @@ jobs: with: go-version-file: go.mod cache: false + # Resolving this job's packages downloads modules; restore them through the shared + # bounded retry so one dropped Go proxy stream does not fail the job (#8053). + - name: ♻️ Restore Go modules + uses: devantler-tech/ksail/.github/actions/restore-go-modules@93412f612d35018a21eafd7cf28b523b92f5038a - name: 🔎 Verify complete and private regional inventories run: go test ./internal/maintenance/eksinventory/... @@ -1032,11 +1036,29 @@ jobs: with: go-version-file: go.mod cache: false + # Resolving this job's packages downloads modules; restore them through the shared + # bounded retry so one dropped Go proxy stream does not fail the job (#8053). + - name: ♻️ Restore Go modules + uses: devantler-tech/ksail/.github/actions/restore-go-modules@93412f612d35018a21eafd7cf28b523b92f5038a - name: 📦 Install pinned vulnerability scanner env: GOBIN: ${{ runner.temp }}/vulnerability-scanner - run: go install golang.org/x/vuln/cmd/govulncheck@v1.8.0 + # The scanner resolves outside this module, so the module restore above does not + # cover it; retry the same three times a dropped proxy stream gets elsewhere (#8053). + # A persistent failure still fails the job after the last attempt. + run: | + for attempt in 1 2 3; do + if go install golang.org/x/vuln/cmd/govulncheck@v1.8.0; then + exit 0 + fi + if [[ "$attempt" -eq 3 ]]; then + echo "::error::Installing govulncheck failed after 3 attempts." + exit 1 + fi + echo "::warning::govulncheck install attempt $attempt/3 failed; retrying in $((attempt * 5))s." + sleep "$((attempt * 5))" + done - name: 🧪 Verify actual scanner positive and negative controls env: @@ -2510,6 +2532,10 @@ jobs: with: go-version-file: go.mod cache: false + # Resolving this job's packages downloads modules; restore them through the shared + # bounded retry so one dropped Go proxy stream does not fail the job (#8053). + - name: ♻️ Restore Go modules + uses: devantler-tech/ksail/.github/actions/restore-go-modules@93412f612d35018a21eafd7cf28b523b92f5038a # `go build ./...` and `go test ./...` resolve only THIS module's packages and their own # tests. Neither resolves the tests of a DEPENDENCY, so a dependency whose test imports a @@ -2554,6 +2580,10 @@ jobs: with: go-version-file: go.mod cache: false + # Resolving this job's packages downloads modules; restore them through the shared + # bounded retry so one dropped Go proxy stream does not fail the job (#8053). + - name: ♻️ Restore Go modules + uses: devantler-tech/ksail/.github/actions/restore-go-modules@93412f612d35018a21eafd7cf28b523b92f5038a # The contracts keep the Gateway API CRDs KSail installs on the line the pinned Cilium # release is built against, and keep the module carrying their version tracked by diff --git a/internal/ciharness/go_module_cache_test.go b/internal/ciharness/go_module_cache_test.go index 4acb3554f4..37a19d05fa 100644 --- a/internal/ciharness/go_module_cache_test.go +++ b/internal/ciharness/go_module_cache_test.go @@ -31,6 +31,9 @@ func TestGoModuleRestoreConsumerBindings(t *testing.T) { // TestKSailBinaryArtifactMirrorWarmerConsumer instead. "warm-helm-cache", "test-release-config", "release-graph-audit", "local-recovery-trial", + // Module-resolving checks that set up Go without a build cache (#8053). + "eks-smoke-scripts", "verify-vulnerability-identities", + "verify-dependency-test-graph", "verify-dependency-contracts", "verify-todos-workflow-contract", }, "copilot-setup-steps.yml": {"copilot-setup-steps"},