Skip to content

fix(sandbox): let substrate runs download newer Go toolchains - #172

Open
adityathebe wants to merge 1 commit into
mainfrom
fix/substrate-go-toolchain-egress
Open

adityathebe wants to merge 1 commit into
mainfrom
fix/substrate-go-toolchain-egress

Conversation

@adityathebe

@adityathebe adityathebe commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Hosted test runs fail before running any tests when a repo's go.mod requires a newer Go than the runner image has. This lets the sandbox download that toolchain. Fixes #171.

Opus 5.5 Medium

Trigger: a Test run on flanksource/duty main (5d890c4, go 1.26.10) failed in all 30 packages within a second, on substrate run cab9726a-7cbe-4bde-9051-c5c0ffd211d7.

Root cause: the runner image ships Go 1.26.9, so GOTOOLCHAIN=auto downloads go1.26.10. proxy.golang.org redirects toolchain downloads to storage.googleapis.com, which isn't in DefaultSubstrateEgress, so the sandbox's DNS returned no such host.

Fix: add storage.googleapis.com to DefaultSubstrateEgress, with a comment explaining why it's there. Egress is TLS passthrough, so this allows all of Google Cloud Storage, not only Go's toolchains; the comment says so.

Verification: the existing TestSubstrateBackendIsCaptainsSubstrateSandboxOptions expectation is updated; left to CI.

Summary by CodeRabbit

  • New Features
    • Added access to storage.googleapis.com on port 443 in the default egress host list.

A hosted Test run on flanksource/duty (go.mod: go 1.26.10) failed in every package before any test ran. The runner image has an older Go, so go fetched go1.26.10, and proxy.golang.org redirects toolchain downloads to storage.googleapis.com, which the sandbox's DNS and egress allowlist refused.

Add storage.googleapis.com to DefaultSubstrateEgress. Passthrough admits all of Google Cloud Storage, which the comment next to the host notes.

Fixes #171
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The default substrate egress list now includes storage.googleapis.com. The corresponding test expectation includes storage.googleapis.com:443.

Changes

Substrate egress

Layer / File(s) Summary
Add Google Cloud Storage to default egress
sandbox/substrate.go, sandbox/substrate_test.go
DefaultSubstrateEgress now includes storage.googleapis.com. The test’s expected host list includes storage.googleapis.com:443.

Suggested reviewers: yashmehrotra

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 1e895

Hosted sandbox runs can now reach Google Cloud Storage, which Go toolchain downloads need when go.mod requires a newer Go version than the runner image provides. The change is a small, easily reverted allowlist addition. It also permits access to all of Google Cloud Storage, as the PR notes. Confirming the Go 1.26.10 run end to end after merge would be prudent, but nothing in the code blocks merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: adding storage.googleapis.com to DefaultSubstrateEgress so substrate sandbox runs can download newer Go toolchains. The change set is a 4-line addition in sandbox/subs…
Linked Issues check Passed Issue #171 requires hosted Go test runs to download a newer Go toolchain when go.mod requires it, instead of failing on DNS lookup of storage.googleapis.com. At the reviewed head, sandbox/substrate.go…
Out of Scope Changes check Passed The changes are the single egress host addition in sandbox/substrate.go, with its explanatory comment, and the matching expectation update in TestSubstrateBackendIsCaptainsSubstrateSandboxOptions. The…
Full details: Title check

Explanation

The title names the main change: adding storage.googleapis.com to DefaultSubstrateEgress so substrate sandbox runs can download newer Go toolchains. The change set is a 4-line addition in sandbox/substrate.go and a 1-line test expectation update, which matches the title's scope.

Full details: Linked Issues check

Explanation

Issue #171 requires hosted Go test runs to download a newer Go toolchain when go.mod requires it, instead of failing on DNS lookup of storage.googleapis.com. At the reviewed head, sandbox/substrate.go lists "storage.googleapis.com" in DefaultSubstrateEgress, with a comment tying it to Go toolchain downloads redirected from proxy.golang.org. SubstrateBackend turns this list into egress entries on port 443, so the sandbox permits that host. The requirement is a coding change in this file and is implemented. The test expectation update in sandbox/substrate_test.go is described in the PR and the summary, but its diff could not be read, so the test change is not independently verified. No tests are required by #171 beyond this change, so this does not alter the verdict. The PR does not report a CI result.

Full details: Out of Scope Changes check

Explanation

The changes are the single egress host addition in sandbox/substrate.go, with its explanatory comment, and the matching expectation update in TestSubstrateBackendIsCaptainsSubstrateSandboxOptions. The host addition is the fix #171 asks for. The comment states that TLS passthrough admits all of Google Cloud Storage, not only Go toolchains. This broader reach follows from the chosen fix and is disclosed in the code and PR description; it is not an unrelated change. The test diff could not be read, but a test expectation update for the new default host supports this change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a01f8132-035e-4961-a0a4-932e856681ae
Commits

Reviewing files that changed from the base of the PR and between 309b76d and 1e89543.

Files selected for processing: 2

  • sandbox/substrate.go
  • sandbox/substrate_test.go

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

@github-actions

Copy link
Copy Markdown
Contributor

Gavel summary

Source Pass Fail Skip Duration
./pr/ui 1514 0 1 2m34s
./site 23 0 0 2.5s
./testrunner/ui 116 0 0 16.1s
ai 2 0 0 702.63µs
archtest 15 0 0 1m21s
azuredevops 68 0 0 58ms
baseline 18 0 0 341.195µs
betterleaks 3 0 0 98ms
branchmerge 25 0 0 3.2s
browser 19 0 2 33.1s
bulk 13 0 0 991.845µs
cache 8 0 0 1.6s
changegraph 8 0 0 241ms
changeset 27 0 0 3.9s
commands 11 0 0 1.0s
commit 179 0 0 2.7s
create 34 0 0 2.8s
database 19 0 0 21.8s
entity 41 0 0 7ms
fixturebenchtest 2 0 0 1ms
fixtures 239 0 5 16.8s
gavel 188 0 0 1m32s
ginkgoscope 3 0 0 162ms
git 258 0 3 19.3s
github 24 0 0 2.6s
github.com/flanksource/gavel 1 0 0 2.2s
github.com/flanksource/gavel/ai 14 0 0 160ms
github.com/flanksource/gavel/ai/aifix 13 0 0 20ms
github.com/flanksource/gavel/ai/prfix 17 0 0 1.9s
github.com/flanksource/gavel/api 94 0 0 35.0s
github.com/flanksource/gavel/blob 38 0 2 -
github.com/flanksource/gavel/chart 16 0 0 8.2s
github.com/flanksource/gavel/claudehistory 16 0 0 -
github.com/flanksource/gavel/cmd/gavel 383 0 1 2m50s
github.com/flanksource/gavel/cmd/gavel/choose 18 0 0 -
github.com/flanksource/gavel/commit 291 0 0 14.5s
github.com/flanksource/gavel/context 3 0 0 -
github.com/flanksource/gavel/examples/sample-app 2 0 0 -
github.com/flanksource/gavel/fixtures 202 0 0 7.7s
github.com/flanksource/gavel/fixtures/types 30 0 0 80ms
github.com/flanksource/gavel/git 68 0 0 530ms
github.com/flanksource/gavel/github 210 0 2 3.3s
github.com/flanksource/gavel/github/activity 8 0 0 10ms
github.com/flanksource/gavel/github/cache 87 0 6 6.2s
github.com/flanksource/gavel/github/installations 5 0 0 13.7s
github.com/flanksource/gavel/internal/cache 2 0 0 4.2s
github.com/flanksource/gavel/internal/database 45 0 0 1m8s
github.com/flanksource/gavel/internal/logtest 2 0 0 -
github.com/flanksource/gavel/internal/retention 5 0 0 7.3s
github.com/flanksource/gavel/internal/streamtee 6 0 0 -
github.com/flanksource/gavel/internal/taskhistory 1 0 0 690ms
github.com/flanksource/gavel/internal/ttyrender 16 0 0 -
github.com/flanksource/gavel/lint 52 0 0 610ms
github.com/flanksource/gavel/linters 67 0 0 130ms
github.com/flanksource/gavel/linters/betterleaks 14 0 0 50ms
github.com/flanksource/gavel/linters/golangci 2 0 0 -
github.com/flanksource/gavel/linters/jscpd 23 0 0 -
github.com/flanksource/gavel/linters/oxlint 15 0 0 -
github.com/flanksource/gavel/linters/reactdoctor 18 0 0 -
github.com/flanksource/gavel/linters/tsc 12 0 0 80ms
github.com/flanksource/gavel/missioncontrol 10 0 2 -
github.com/flanksource/gavel/modelkeys 9 0 0 6.6s
github.com/flanksource/gavel/models 1 0 0 -
github.com/flanksource/gavel/platform 7 0 0 5.6s
github.com/flanksource/gavel/pr/ui 446 0 4 1m43s
github.com/flanksource/gavel/procfile 7 0 0 -
github.com/flanksource/gavel/prompts/registry 9 0 0 540ms
github.com/flanksource/gavel/prwatch 117 0 0 -
github.com/flanksource/gavel/report 8 0 0 -
github.com/flanksource/gavel/sandbox 67 0 6 33.4s
github.com/flanksource/gavel/sandbox/credentialprovider 9 0 0 220ms
github.com/flanksource/gavel/sandbox/runclient 6 0 0 -
github.com/flanksource/gavel/service 46 0 0 4.5s
github.com/flanksource/gavel/snapshots 29 0 0 3.3s
github.com/flanksource/gavel/sshkeys 2 0 0 1.4s
github.com/flanksource/gavel/status 60 0 0 2.0s
github.com/flanksource/gavel/tenant 3 0 0 -
github.com/flanksource/gavel/testrunner 158 0 0 18.6s
github.com/flanksource/gavel/testrunner/bench 12 0 0 -
github.com/flanksource/gavel/testrunner/history 7 0 0 -
github.com/flanksource/gavel/testrunner/parsers 111 0 0 230ms
github.com/flanksource/gavel/testrunner/runners 76 0 0 300ms
github.com/flanksource/gavel/testrunner/ui 51 0 0 130ms
github.com/flanksource/gavel/testrunner/uirexport 21 0 0 2.9s
github.com/flanksource/gavel/testrunner/uirplan 3 0 0 10ms
github.com/flanksource/gavel/todos 59 0 0 40ms
github.com/flanksource/gavel/todos/bulk 17 0 0 -
github.com/flanksource/gavel/todos/content 1 0 0 -
github.com/flanksource/gavel/todos/entity 16 0 0 -
github.com/flanksource/gavel/todos/labels 70 0 0 -
github.com/flanksource/gavel/todos/native 86 0 0 15.6s
github.com/flanksource/gavel/todos/ops 15 0 0 -
github.com/flanksource/gavel/todos/portable 7 0 0 990ms
github.com/flanksource/gavel/todos/prompt 52 0 0 250ms
github.com/flanksource/gavel/todos/query 31 0 0 -
github.com/flanksource/gavel/todos/remote 3 0 0 3.4s
github.com/flanksource/gavel/todos/runtime 52 0 0 10.3s
github.com/flanksource/gavel/todos/types 97 0 0 -
github.com/flanksource/gavel/todosync 3 0 0 -
github.com/flanksource/gavel/utils 51 0 0 -
github.com/flanksource/gavel/verify 116 0 0 190ms
githubpush 35 0 0 925.662µs
gitstate 59 0 0 1m45s
jira 8 0 0 682.4µs
jsonb 8 0 0 519.078µs
kubernetes 43 0 0 10ms
labels 32 0 0 2ms
land 14 0 0 11.9s
library 16 0 0 255ms
lifecycle 303 0 0 3.4s
lint 18 0 0 2.1s
linters 9 0 0 2ms
merge 31 0 0 106ms
native 75 0 0 24.1s
ops 17 0 0 704.531µs
outline 56 0 0 113ms
parsers 38 0 0 45ms
processruntime 9 0 0 334.162µs
procfile 67 0 0 34.9s
prompt 55 0 0 254ms
provider 13 0 0 643ms
prwatch 54 0 0 9ms
query 13 0 0 318.258µs
registry 11 0 0 19ms
run 33 0 0 26ms
runcache 11 0 0 753ms
runners 11 0 0 8.2s
runtime 106 0 0 14.1s
safefs 3 0 0 801.844µs
serve 45 0 0 3.6s
service 4 0 0 362.103µs
services 44 0 1 43.8s
shims 37 0 0 12ms
snapshots 2 0 0 2ms
status 3 0 0 127ms
taskhistory 7 0 0 720ms
testrunner 48 0 0 1m1s
todo 24 0 0 39ms
todoprojection 20 0 0 4.5s
todos 59 0 0 2.3s
tools 14 0 0 1.3s
traces 13 0 0 2.6s
types 72 0 0 466ms
ui 562 0 0 2m7s
utils 118 0 0 384ms
verifier 34 0 0 205ms
verify 91 0 0 213ms
vitedev 4 0 0 8ms
workspace 8 0 0 1ms

Totals: 8961 passed · 0 failed · 35 skipped · 24m28s

View full results

@github-actions

Copy link
Copy Markdown
Contributor

Gavel summary

Source Pass Fail Skip Duration
lint: react-doctor 2 1 0 17.5s
lint: betterleaks 0 0 1 -
lint: golangci-lint 1 0 0 3m16s
lint: oxlint 1 0 0 559ms
lint: tsc 0 0 1 -

Totals: 4 passed · 1 failed · 2 skipped · 3m34s

Failing linters

react-doctor — 22 violation(s)

  • src/components/platform/BudgetsPanel.tsx:87 — Array index used as a key: Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "i". Use a stable id from the ... (react-doctor)
  • src/components/platform/CaptainHistoryPanel.tsx:129 — Array index used as a key: Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "i". Use a stable id from the ... (react-doctor)
  • src/components/platform/InfrastructurePanel.tsx:130 — Array index used as a key: Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "i". Use a stable id from the ... (react-doctor)
  • src/components/platform/ModelUsagePanel.tsx:5 — Heavy library loaded eagerly: "recharts" ships extra code to your users up front & slows page load. Load it on demand with React.lazy() or next/dynamic. Load it only when needed: `const Component =... (react-doctor)
  • src/components/platform/ModelUsagePanel.tsx:97 — Array index used as a key: Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "i". Use a stable id from the ... (react-doctor)
  • ... and 17 more violations

View full results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hosted Go tests fail when repo needs newer Go

1 participant