Skip to content

chore(vendor): pin and verify pre-built gvproxy switch binary - #503

Merged
norrietaylor merged 2 commits into
mainfrom
chore/vendor-gvproxy-unblock-495
Jun 20, 2026
Merged

chore(vendor): pin and verify pre-built gvproxy switch binary#503
norrietaylor merged 2 commits into
mainfrom
chore/vendor-gvproxy-unblock-495

Conversation

@norrietaylor

@norrietaylor norrietaylor commented Jun 20, 2026

Copy link
Copy Markdown
Member

Unblocks #495. Does not close it — the SDD execute agent resumes the Rust NetworkMode refactor once this merges and needs-human is cleared.

Root cause

#495 bundled agent-doable Rust work with two human-only prerequisites the SDD execute sandbox cannot perform: editing .github/workflows/ (protected path), and obtaining gvproxy (Go module-proxy egress / external download is outside the sandbox allow-list).

Approach: pinned pre-built binary (maintainer decision)

Switched from build-from-source to a pinned pre-built gvproxy release, fetched and SHA-256-verified. Avoids a Go toolchain + module-proxy egress in CI. Supersedes the spec's source-build preference; the spec lists a SHA-256-verified pre-built binary as the accepted alternative.

Change (net −109 lines)

  • vendor/gvproxy/gvproxy.lock — pinned v0.8.9 + upstream-published SHA-256 digests (linux-amd64, linux-arm64, darwin)
  • scripts/fetch-gvproxy.sh — download the host-platform asset, verify SHA-256, fail closed on mismatch
  • .github/workflows/ci-gvproxy.yml — fetch + verify + publish artifact (no build); scoped to vendor/gvproxy/** + the script
  • docs/specs/03-spec-networking/architecture.md — amend the gvproxy-source-build assumption to the pinned pre-built decision

Verified locally

  • positive: downloads gvproxy-darwin v0.8.9, digest matches upstream sha256sums
  • negative: a tampered digest is rejected (fail closed)

Acceptance

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Updated gvproxy distribution approach to use pre-built release binaries instead of building from source, with automated verification against SHA-256 digests for security and consistency.
  • Documentation

    • Updated architecture specifications to reflect the new pre-built binary distribution method for gvproxy.

Add vendor/gvproxy/ as a pinned build module for the gvproxy
(gvisor-tap-vsock) userspace switch minimald spawns per host, plus a
CI job that builds it from source and publishes the binary SHA-256.
The dependency graph is pinned and cryptographically verified via the
checked-in go.sum (architecture assumption gvproxy-source-build) — the
binary is built from pinned source, never a pre-built download.

Unblocks the human-only half of #495: editing .github/workflows/ is a
protected path and Go module-proxy egress is outside the SDD execute
agent's sandbox allow-list. After merge, clearing needs-human on #495
lets the agent implement the Rust NetworkMode refactor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ss8WXtUUr9PBHuJcJMseBj
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds scripts/fetch-gvproxy.sh, which downloads a pinned pre-built gvproxy binary from GitHub releases and verifies it against a SHA-256 digest in vendor/gvproxy/gvproxy.lock. A new CI gvproxy GitHub Actions workflow runs this script and uploads the binary as an artifact. The architecture doc assumption for gvproxy is updated from source-build to pre-built binary fetch.

Changes

gvproxy pre-built binary fetch

Layer / File(s) Summary
fetch-gvproxy.sh: lockfile-driven download and verification
scripts/fetch-gvproxy.sh
Adds a strict-mode Bash script that reads the pinned version and per-platform SHA-256 digest from vendor/gvproxy/gvproxy.lock, maps the host platform to the correct release asset name, downloads it via curl, verifies the digest, and marks the binary executable. Fails with a nonzero exit on unsupported platforms or digest mismatches.
CI workflow and architecture doc update
.github/workflows/ci-gvproxy.yml, docs/specs/03-spec-networking/architecture.md
Adds the CI gvproxy workflow triggered on path-filtered pull_request, push, and workflow_dispatch events; it runs fetch-gvproxy.sh, appends the pinned version and binary SHA-256 to the step summary, and uploads gvproxy-linux-amd64 with if-no-files-found: error. Updates the gvproxy-source-build assumption in the architecture doc to reference the pre-built binary fetch mechanism.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 No more building from source today,
A pinned binary hops right our way!
The lockfile holds the hash so tight,
fetch-gvproxy.sh checks it right.
SHA-256 verified with glee —
The rabbit ships it artifact-free! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: pinning and verifying a pre-built gvproxy binary, which aligns with the PR's core objective of configuring gvproxy as a pre-built release binary verified against SHA-256 digests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/ci-gvproxy.yml (1)

34-41: ⚡ Quick win

Strengthen dependency-lock enforcement in the verify/build sequence.

At Line 36, go mod verify runs before any explicit module fetch/build in this job. On a fresh runner, this can reduce the practical value of that verification step. Consider downloading first, then verifying, and building with -mod=readonly so the pinned graph cannot drift during build.

Suggested fix
-      - name: Verify pinned dependency graph (go.sum)
+      - name: Download pinned module graph
         working-directory: vendor/gvproxy
-        run: go mod verify
+        run: go mod download
+      - name: Verify pinned dependency graph (go.sum)
+        working-directory: vendor/gvproxy
+        run: go mod verify
       - name: Build gvproxy from pinned source
         working-directory: vendor/gvproxy
         run: |
-          go build -trimpath -o "${RUNNER_TEMP}/gvproxy" \
+          go build -mod=readonly -trimpath -o "${RUNNER_TEMP}/gvproxy" \
             github.com/containers/gvisor-tap-vsock/cmd/gvproxy
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-gvproxy.yml around lines 34 - 41, The go mod verify
step in the workflow currently runs before modules are explicitly downloaded,
which reduces its effectiveness on a fresh runner. Add a new step before the
"Verify pinned dependency graph (go.sum)" step to run go mod download in the
vendor/gvproxy working directory. Additionally, modify the build command in the
"Build gvproxy from pinned source" step by adding the -mod=readonly flag to the
go build command so the module graph cannot drift during the build process,
ensuring strict adherence to the pinned dependencies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci-gvproxy.yml:
- Around line 37-41: The go build command for gvproxy does not explicitly set
GOOS and GOARCH environment variables, but the artifact name referenced later in
the workflow explicitly includes "linux-amd64" in its naming convention. Add
GOOS=linux and GOARCH=amd64 environment variables to the go build command at the
"Build gvproxy from pinned source" step to make the build contract explicit and
maintainable, ensuring the build target platform aligns with the artifact naming
convention.

---

Nitpick comments:
In @.github/workflows/ci-gvproxy.yml:
- Around line 34-41: The go mod verify step in the workflow currently runs
before modules are explicitly downloaded, which reduces its effectiveness on a
fresh runner. Add a new step before the "Verify pinned dependency graph
(go.sum)" step to run go mod download in the vendor/gvproxy working directory.
Additionally, modify the build command in the "Build gvproxy from pinned source"
step by adding the -mod=readonly flag to the go build command so the module
graph cannot drift during the build process, ensuring strict adherence to the
pinned dependencies.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 55aa82ec-2222-4820-b360-006f6b1167e2

📥 Commits

Reviewing files that changed from the base of the PR and between e64daba and 16ec3a9.

⛔ Files ignored due to path filters (1)
  • vendor/gvproxy/go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • .github/workflows/ci-gvproxy.yml
  • vendor/gvproxy/go.mod
  • vendor/gvproxy/tools.go

Comment thread .github/workflows/ci-gvproxy.yml Outdated
Replace the build-from-source module with a pinned pre-built gvproxy
(gvisor-tap-vsock v0.8.9) release binary, fetched and verified against
checked-in SHA-256 digests. Removes the Go toolchain / module-proxy
dependency from CI.

- vendor/gvproxy/gvproxy.lock: pinned version + upstream sha256 digests
  (linux-amd64, linux-arm64, darwin)
- scripts/fetch-gvproxy.sh: download the host-platform asset, verify its
  SHA-256, fail closed on mismatch
- ci-gvproxy.yml: fetch + verify + publish (no Go build)
- architecture.md: amend the gvproxy-source-build assumption to the
  pinned pre-built decision (supply-chain risk mitigated by pinned digests)

Unblocks the human-only half of #495.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ss8WXtUUr9PBHuJcJMseBj
@norrietaylor norrietaylor changed the title chore(vendor): pin and build gvproxy switch from source chore(vendor): pin and verify pre-built gvproxy switch binary Jun 20, 2026

@bryan-minimal bryan-minimal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants