Repository navigation
test(envoy-validate): validate against the chart-pinned proxy image, not stock Envoy (#709) - #716
Merged
Merged
Conversation
…not stock Envoy (#709) `//test/envoy_validate` ran `envoy --mode validate` with the stock Envoy v1.39.0 release asset while the deployed proxy is a custom build of a 1.40.0-dev snapshot (`//proxy` workspace) that compiles most upstream extensions out and `aether_stats` in. Stock Envoy is strictly more permissive than what we ship, so the gate passed configs the real proxy would NACK, and the two pins had already drifted twice (a stale 1.38.0 comment, a 1.39.0 pin, a 1.40.0-dev proxy). There is no stock release asset for an Envoy `main` snapshot, so the only binary always in sync with the data plane is the proxy itself. The new `//bazel/proxy_pin` module extension reads `charts/aether/values.yaml` (MODULE.bazel cannot `load()` a .bzl, but an extension can `mctx.read` a source file), pulls the aether-proxy image by the digest the chart pins, and lifts `/usr/local/bin/envoy` out of the topmost layer that carries it — one repo per arch, selected by the existing `envoy_bin` alias. The chart pin is now the single source of truth: `proxy-release`'s `bump-chart` job needs no extra sed, and the `KNOWN SKEW` block is gone. The parse is deliberately strict and fails the build with a message naming what was expected rather than silently validating against the wrong binary: a `repository:` whose last path segment is `aether-proxy`, then a `digest: sha256:<64 hex>` inside the same mapping. `ghcr.io/bpalermo/aether/aether-proxy` is public — an anonymous GHCR bearer token suffices, so no `docker login` locally and no `docker/login-action` step in CI. Tests stay local on the runner (`--strategy=TestRunner=local`). Verified: `bazel test //test/envoy_validate/...` passes (0.5 s, 6/6 bootstraps) against `51ba1297.../1.40.0-dev/Clean/RELEASE/BoringSSL`; `bazel build //...`, `make gazelle`, `make format-check`, `bazel mod tidy` and `--config=lint` all clean. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #709.
Problem
//test/envoy_validateranenvoy --mode validateover aether-generated bootstraps using the stock Envoy v1.39.0 release asset (@envoy_binary_linux_{amd64,arm64}), while the deployed proxy is a custom build of a 1.40.0-dev snapshot (//proxyworkspace) with most upstream extensions compiled out (_DROPPEDinproxy/bazel/build_config/extensions_build_config.bzl) andaether_statscompiled in.Stock Envoy is strictly more permissive than what we ship, so the gate could pass a config the real proxy NACKs. The two had already drifted twice — a stale
1.38.0comment in the BUILD file, a1.39.0pin inMODULE.bazel, a1.40.0-devproxy — and theKNOWN SKEWblock said so. There is no stock release asset for an Envoymainsnapshot, so "re-pin the stock binary to match" cannot work while the proxy tracks main.Mechanism
The only binary always exactly in sync with the data plane is the proxy. New module extension
//bazel/proxy_pin:extensions.bzl:load()a.bzl, but a module extension canmctx.read(Label("//charts/aether:values.yaml"), watch = "yes").charts/aether/values.yamlis therefore the single source of truth —proxy-release'sbump-chartjob already rewritestag:+digest:there, and needs no third sed: the extension follows the chart, so there is no second pin to move.sha256=) → thelinux/amd64orlinux/arm64manifest → layers walked topmost-first, each blob digest-verified, extracted untilusr/local/bin/envoyappears. The result is a plainFile,exports_files'd as@pinned_envoy_linux_{amd64,arm64}//:envoy.//test/envoy_validate:envoy_binstillselect()s on@platforms//cpu:x86_64/aarch64, andgo_teststill carriesdata = [":envoy_bin"]. The only change invalidate_test.gois the repo name it resolves through_repo_mappingand the path inside the repo (<repo>/envoyinstead of<repo>/file/envoy); the runfiles/repo-mapping lookup itself is untouched.Rejected
rules_img'spull: it is a shallow pull that materializes blobs keyed by digest with no per-platform layer view, so picking "the amd64 layer that holds/usr/local/bin/envoy" would still need bespoke logic on top — andrules_ociwould mean a newbazel_depfor the same. A ~200-line repository rule that produces exactly theFilewe want, with every blob hash-verified, is smaller than either.Parsing contract
Deliberately strict — it fails the build naming what it expected, rather than silently validating against the wrong binary:
repository: <ref>whose<ref>'s last path segment is exactlyaether-proxy.repository:key's; blank and comment-only lines do not end the block) fordigest: "sha256:<64 hex>".repository:/ nodigest:in its block / malformed digest →fail().All three failure paths were exercised locally (renamed repository, deleted digest,
sha256:nothex) and each produced its intended message. Editingvalues.yamlre-triggers the extension, confirming thewatch.Auth case: public — no credentials needed
ghcr.io/bpalermo/aether/aether-proxyis publicly readable, so nodocker login ghcr.iolocally and nodocker/login-action@v3step in CI —.github/workflows/ci.yamlis unchanged. Tests stay local on the runner (--strategy=TestRunner=localin.bazelrc); only the repo fetch touches the network, which already happens locally. If the package is ever made private, the_fetch_manifestfailure path prints both remedies (docker login ghcr.io, or adocker/login-action@v3step withpermissions: packages: readbefore the bazel step in thetestjob).Also removed
@envoy_binary_linux_{amd64,arm64}, theKNOWN SKEWcomment block, and the stale1.38.0comment intest/envoy_validate/BUILD.bazelandvalidate_test.go.http_fileis now declared next to its only remaining user (mermaid_js). Nobazel_depadded, soMODULE.bazel.lockis untouched (the extension isreproducible = True, so a chart-pin bump produces no lockfile churn either).Validation
bazel test --repo_env=GOPROXY=… //test/envoy_validate/...envoy --version51ba12979d545bcde021d81ef9151355db7c6a07/1.40.0-dev/Clean/RELEASE/BoringSSL— the chart'stag:verbatimbazel build --repo_env=GOPROXY=… //...make gazellebazel mod tidymake format-checkbazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //....bzl)The verbose run shows the real proxy's own log lines (
external/envoy+/source/common/protobuf/...), confirming it is the custom binary and not a release asset.No changes under
proxy/; no chart changes (so noChart.yamlbump needed).🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr