Skip to content

ci: retry Go module downloads after every module cache restore - #8349

Merged
devantler merged 2 commits into
mainfrom
claude/ci-module-download-retry-8053
Nov 12, 2026
Merged

devantler merged 2 commits into
mainfrom
claude/ci-module-download-retry-8053

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Why

When a pull request changes the Go dependency list, CI downloads every Go module fresh, and a single dropped connection to the Go module mirror fails the job. Each such failure costs a dependency rebase and another full CI cycle of about 70 minutes, even though nothing in the pull request was wrong.

What

Every CI job that restores the shared Go module cache now downloads any missing modules with the same short, bounded retry the release builds already use, so a brief mirror outage no longer turns a correct pull request red. A genuinely missing or tampered module still fails the job, and every attempt's error stays visible in the log. The workflow-contract check, which previously downloaded modules with no cache and no retry, now uses the shared cache too.

Part of #8053

devantler and others added 2 commits November 12, 2026 21:32
A cache miss, for example on a pull request that changes go.sum, fetches
modules fresh, and one dropped Go proxy stream failed the whole job.
The restore-go-modules action now runs the shared bounded download
retry from its own pinned checkout, the same way setup-desktop-build
does, and the retry script is bound to the audited action content.

Part of #8053

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin all restore-go-modules consumers to the commit that adds the
bounded download, and restore modules in the workflow-contract job,
whose tests resolved modules with no cache and no retry.

Part of #8053

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

@github-code-quality

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Go

Go / code-coverage/go

main 2c9c263 claude/ci-module-dow... e892f85 +/-
72% 72% 0%
View coverage of the 3 most impacted files.
File main 2c9c263 claude/ci-module-dow... e892f85 +/-
pkg/client/reconciler/poll.go 85% 79% -6%
pkg/svc/install...site_removal.go 90% 92% +2%
pkg/svc/provisi...pgrader_wait.go 92% 94% +2%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 92cf0f1 and e892f85.

Files selected for processing: 11

  • .github/actions/restore-go-modules/action.yaml
  • .github/workflows/ci.yaml
  • .github/workflows/copilot-setup-steps.yml
  • .github/workflows/mutation-testing.yaml
  • .github/workflows/system-test-eks.yaml
  • .github/workflows/system-test-hetzner.yaml
  • .github/workflows/system-test-omni.yaml
  • .github/workflows/update-hetzner-talos-iso.yaml
  • internal/ciharness/go_module_cache_test.go
  • internal/ciharness/module_download_test.go
  • pkg/client/kubescape/release_action_pins_test.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional context used

Code guidelines: 3

CONTRIBUTING.md — auto-discovered
.github/instructions/go-code.instructions.md — auto-discovered
.github/instructions/go-testing.instructions.md — auto-discovered
Path-based instructions: 4

Applicability reference: AGENTS.md: # KSail - Kubernetes SDK for Local GitOps Development **Recommended local validation before any PR** (matches `CONTRIBUTING.md`; CI re-runs equivalents via the org-wide `validate-go-proj...

CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • internal/ciharness/go_module_cache_test.go
  • internal/ciharness/module_download_test.go
  • pkg/client/kubescape/release_action_pins_test.go
Source excerpt: **All user-supplied file paths** must be canonicalized with `fsutil.EvalCanonicalPath` before use (resolves symlinks, prevents symlink-escape attacks).

CodeRabbit inference engine (.github/instructions/go-code.instructions.md)

Files:

  • internal/ciharness/go_module_cache_test.go
  • internal/ciharness/module_download_test.go
  • pkg/client/kubescape/release_action_pins_test.go
Applicability reference: AGENTS.md: # KSail - Kubernetes SDK for Local GitOps Development **Recommended local validation before any PR** (matches `CONTRIBUTING.md`; CI re-runs equivalents via the org-wide `validate-go-project` reusable work...

CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • internal/ciharness/go_module_cache_test.go
  • internal/ciharness/module_download_test.go
  • pkg/client/kubescape/release_action_pins_test.go
Source excerpt: **Black-box tests**: Use `package foo_test` (not `package foo`).

CodeRabbit inference engine (.github/instructions/go-testing.instructions.md)

Files:

  • internal/ciharness/go_module_cache_test.go
  • internal/ciharness/module_download_test.go
  • pkg/client/kubescape/release_action_pins_test.go
Additional comments: 11

.github/actions/restore-go-modules/action.yaml: 1

2-4: LGTM!

Also applies to: 32-34

.github/workflows/ci.yaml: 1

1084-1084: LGTM!

Also applies to: 1219-1219, 1321-1321, 1661-1661, 2011-2011, 2053-2053, 2592-2593, 2779-2779, 2852-2852, 2914-2914

.github/workflows/copilot-setup-steps.yml: 1

31-31: LGTM!

.github/workflows/mutation-testing.yaml: 1

55-55: LGTM!

.github/workflows/system-test-eks.yaml: 1

111-111: LGTM!

.github/workflows/system-test-hetzner.yaml: 1

152-152: LGTM!

Also applies to: 181-181

.github/workflows/system-test-omni.yaml: 1

104-104: LGTM!

Also applies to: 133-133

.github/workflows/update-hetzner-talos-iso.yaml: 1

51-51: LGTM!

internal/ciharness/go_module_cache_test.go: 1

24-24: LGTM!

Also applies to: 34-34, 152-190

internal/ciharness/module_download_test.go: 1

78-80: LGTM!

Also applies to: 160-160, 164-164, 184-184

pkg/client/kubescape/release_action_pins_test.go: 1

69-75: LGTM!

Walkthrough

The restore action now runs the shared Go module download script after cache restoration. The script downloads missing modules with bounded retries. CI and other workflows use the updated action revision, including the workflow-contract job. Harness tests cover warm-cache, transient-failure, exhausted-retry, and downstream-build-error scenarios. Pin tests update the action and script witnesses.

Possibly related issues

Possibly related PRs

Merge Risk: Minimal · up to e892f

This change adds bounded retries for Go module downloads after the shared cache restore in CI. No concrete merge-blocking risk was identified, and the failure behavior for missing or tampered modules is preserved.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Go module downloads now get bounded retries after every shared module cache restore in CI. The raw summary shows the restore-go-modules action adding a retry-based dow…
Description check Passed The description explains the motivation (a dropped connection to the Go module mirror fails CI jobs), the change (a bounded retry for missing modules after shared cache restore, reusing the release-bu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Go module downloads now get bounded retries after every shared module cache restore in CI. The raw summary shows the restore-go-modules action adding a retry-based download step, with consumer pins updated to match. The title is concise, specific, and follows the ci: convention.

Full details: Description check

Explanation

The description explains the motivation (a dropped connection to the Go module mirror fails CI jobs), the change (a bounded retry for missing modules after shared cache restore, reusing the release-build retry), and the workflow-contract job now using the shared cache. This matches the raw summary and objectives. It is related to the changeset, so the check passes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@devantler
devantler marked this pull request as ready for review November 12, 2026 22:39
@devantler
devantler merged commit 52396f9 into main Nov 12, 2026
116 of 117 checks passed
@devantler
devantler deleted the claude/ci-module-download-retry-8053 branch November 12, 2026 22:40
@github-project-automation github-project-automation Bot moved this from 🫴 Ready to ✅ Done in 🌊 Project Board Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant