Skip to content

chore(volumes): guard the statement verification keys in release builds - #230

Merged
emmmile merged 5 commits into
mainfrom
feat/volumes-release-keys
Dec 1, 2026
Merged

emmmile merged 5 commits into
mainfrom
feat/volumes-release-keys

Conversation

@emmmile

@emmmile emmmile commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Release builds already never read RUNWARE_VOLUMES_STATEMENT_KEY: the override is compiled in only with the volumesdevkeys tag, and the only binaries built with it are the local ones from make build and make run. This PR adds the guards that keep it that way and pins who can change the trusted keys.

The key table and the production host move from keys.go into verificationkeys.go, and CODEOWNERS now names internal/volumes/keypair/, so a change to the keys, the dev-key switch or the tests that guard the release build keeps a maintainer's review even if the default owner changes. A directory rule also survives a file rename.

New tests fail if .goreleaser.yaml (builds, overrides, flags, env), the release workflow or make install/make build-all would build with the development tag or set GOFLAGS. They read the GoReleaser config as YAML, the release workflow as plain text for the tag and GOFLAGS, and the Makefile through its expanded make -n output, without parsing shell, so git's --tags and similar edits do not trip them. CI runs them, and the release job runs them before GoReleaser.

The production key set stays empty until that key is published. A release check would block every CLI release until then, so instead TestVisibleVolumesNeedProductionKeys fails as soon as the volumes commands are unhidden while the set is empty, and a release without keys refuses every statement at runtime. The follow-up adds the key in verificationkeys.go after checking the upload host rule its comment points to.

Written with Claude Code (Claude Opus 5.5).

…n file

The key table and the production host decide what a released CLI
trusts, so they get a file of their own that a code-owner rule can
cover without also covering the verification logic in keys.go.
The statement verification keys, the build switch for the development
key override and the checks that guard them decide which keys a
released CLI trusts. Name their package in CODEOWNERS so it keeps a
maintainer's review even if the default owner changes; a directory
rule also survives a file rename.
…y tag

Only a build with the volumesdevkeys tag reads the statement key
override, and nothing stopped a later change from adding the tag to
GoReleaser, the release workflow or make install and build-all. Check
all three, so go test, which CI and the release job run before
GoReleaser, fails first.
A release with no production verification keys refuses every
statement from the production API, so the volumes commands must stay
hidden until a release ships those keys. The production key set is
empty until its key is published; this test makes unhiding the
commands before then fail in CI and in the release job.
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include coderabbit-review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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: 21196096-6759-451d-a657-9018fd4e1888

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

Copilot AI 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.

🟡 Changes recommended

The release guard misses target-specific GOFLAGS exports and bare export directives, allowing development keys into release binaries without detection; both forms need detection and regression coverage.

1 open issue
What changed in this PR

Adds safeguards around Shared Volumes statement verification to keep development-key overrides out of distributed CLI builds and protect changes to trusted keys.

Changes:

  • Moves the production host and key table into a dedicated file, retaining the empty production key set.
  • Adds release-build checks and a test requiring production keys before volumes commands become visible.
  • Adds explicit maintainer ownership for the keypair package.
File Description
internal/​volumes/​keypair/​verificationkeys.go Houses the production host and trusted-key table.
internal/​volumes/​keypair/​releasebuild_test.go Checks GoReleaser, release workflow, and Makefile build settings.
internal/​volumes/​keypair/​release_test.go Requires production keys before volumes commands become visible.
internal/​volumes/​keypair/​keys.go Removes definitions relocated to verificationkeys.go.
internal/​volumes/​keypair/​export_test.go Exposes the production key count to external-package tests.
internal/​cmd/​serverless/​volumes.go Updates a comment to reference the visibility guard.
.github/​CODEOWNERS Assigns explicit maintainer ownership to the keypair directory.

Review effort: Balanced

A recipe that reads GOFLAGS from its environment hides a tags flag from
make -n. The Makefile check only saw a top-level export of GOFLAGS, so a
target-specific export (install: export GOFLAGS = ...), an override
export or a bare export, which exports every variable, passed it.
@emmmile
emmmile marked this pull request as ready for review November 30, 2026 19:10

@leszko leszko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM ✅

@danmrichards danmrichards left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

From Dan Richards's agent (Claude), not Dan Richards.

Added a few non-blocking comments. LGTM ✅

@emmmile
emmmile merged commit 22d9140 into main Dec 1, 2026
5 checks passed
@emmmile
emmmile deleted the feat/volumes-release-keys branch December 1, 2026 11:06
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.

4 participants