Skip to content

chore: remove the shadow GAMMA export encoder and superseded SPIRE TLS helpers; deprecate the --readiness-check shims (#772) - #775

Merged
bpalermo merged 3 commits into
mainfrom
chore/772-d-dead-code
Sep 15, 2026
Merged

bpalermo merged 3 commits into
mainfrom
chore/772-d-dead-code

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Phase D (D1 + D2) of #772.

chore(agent,test): delete the shadow GammaRoute encoder and two dead helpers (#772)

Phase D1 of the 2026-09-15 review. Three removals, all unreachable from
production, plus a deprecation warning on the two compat probe flags.

agent/internal/xds/proxy/projection.go: delete ToConfigProjection,
gammaRouteToProto and headerMutationToProto — a SECOND Go-struct -> proto
encoder for GammaRoute shadowing common/gammaproject. The real exporter
(registrar/internal/configexport/controller.go:151,169,210) builds
*registryv1.GammaRoute via gammaproject.ProjectHTTPRule/ProjectGRPCRule and
constructs the ServiceConfigProjection inline; it never called this. Its only
caller was projection_test.go, whose round-trip read like a proposal-026
wire-format guard but exercised a path nobody takes: a field added to the
projector would diverge from the importer's decoder with the test still green.

projection_test.go is rewritten against the path that actually runs — the real
gammaproject projector's proto, stamped into a ServiceConfigProjection the way
applyDesired does, decoded by FromConfigProjection (what
agent/internal/configimport/importer.go:139 calls), then materialised through
BuildOutboundServiceVirtualHost so the decoded rules are asserted as Envoy
routes. Adds a GRPCRoute case (ProjectGRPCRule) the old test had no equivalent
of. FromConfigProjection/GammaRouteFromProto are unchanged and still the only
decoder.

agent/internal/edge/gatewayapi/attachment/refs.go: delete firstBackendService
(U1000 with -tests=false; its production caller is gone, all 4 call sites were
in attachment_test.go) with TestFirstBackendService and the now-unused backend()
helper it was the last user of.

test/envoy_validate/builders.go: delete externalHTTPSPort, the only
staticcheck -checks U1000 finding in the module.

Http1ProtocolOptions, meshdns.NewServer and meshdns.WithInstanceID are
deliberately left alone (report: keep / needs-check).

The two --readiness-check compat flags stay functional (a chart predating
#673/#683 probes with them) but are now cobra MarkDeprecated, so using one
prints a warning naming the replacement prober. charts/ never sets either flag
(grep: one comment in mesh-dns-daemonset.yaml, no --readiness-check argument),
so no chart bump is needed and no warning can appear in production logs.
docs/configuration.md records the new warning + help-hiding.

Verification: bazel test //agent/internal/xds/proxy:proxy_test
//agent/internal/edge/gatewayapi/attachment:attachment_test //agent/internal/cmd/...
//agent/cmd/mesh-dns/... //test/envoy_validate/... -> 6/6 pass;
bazel run //:gazelle (BUILD deps updated); bazel run //:format.check clean.
Full-tree verification runs on the final commit.

chore(spire): delete the pre-#740 source constructor and server TLS helper (#772)

Phase D2 of the 2026-09-15 review — the identity path, kept in its own commit.

common/spire/tls.go:

Verified first that nothing references them: no Go call sites (including
common/spire/spiretest and every _test.go), no docs, no charts. The four
remaining mentions were doc comments describing "the code this replaces" —
agent/internal/cmd/root.go:344, plus the #740 regression tests in
agent/internal/cmd/edge_identity_test.go, registrar/internal/cmd and
controller/internal/cmd/spire_identity_test.go — rewritten to describe the old
bounded blocking wait without naming symbols that no longer exist. The
NewSourceWithTimeout doc absorbed what NewSource's said (socketPath forms) and
now explains why a non-positive timeout is the live caller's choice.

No behaviour change: nothing executed any of this. ClientTLSConfig and the
shared authorizer() (the RootCATrustDomain sentinel path) are untouched.

Verification (full bar, whole tree): bazel build //... //test/e2e:e2e_test OK;
bazel test //... --test_output=errors -> 98/98 pass (incl. //common/spire:spire_test);
bazel run //:format.check clean; bazel build --config=lint
--@aspect_rules_lint//lint:fail_on_violation //... OK; bazel run //:gazelle and
bazel mod tidy produce no churn; scripts/go-deps-audit.sh exit 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 3 commits September 15, 2026 19:19
…helpers (#772)

Phase D1 of the 2026-09-15 review. Three removals, all unreachable from
production, plus a deprecation warning on the two compat probe flags.

agent/internal/xds/proxy/projection.go: delete ToConfigProjection,
gammaRouteToProto and headerMutationToProto — a SECOND Go-struct -> proto
encoder for GammaRoute shadowing common/gammaproject. The real exporter
(registrar/internal/configexport/controller.go:151,169,210) builds
*registryv1.GammaRoute via gammaproject.ProjectHTTPRule/ProjectGRPCRule and
constructs the ServiceConfigProjection inline; it never called this. Its only
caller was projection_test.go, whose round-trip read like a proposal-026
wire-format guard but exercised a path nobody takes: a field added to the
projector would diverge from the importer's decoder with the test still green.

projection_test.go is rewritten against the path that actually runs — the real
gammaproject projector's proto, stamped into a ServiceConfigProjection the way
applyDesired does, decoded by FromConfigProjection (what
agent/internal/configimport/importer.go:139 calls), then materialised through
BuildOutboundServiceVirtualHost so the decoded rules are asserted as Envoy
routes. Adds a GRPCRoute case (ProjectGRPCRule) the old test had no equivalent
of. FromConfigProjection/GammaRouteFromProto are unchanged and still the only
decoder.

agent/internal/edge/gatewayapi/attachment/refs.go: delete firstBackendService
(U1000 with -tests=false; its production caller is gone, all 4 call sites were
in attachment_test.go) with TestFirstBackendService and the now-unused backend()
helper it was the last user of.

test/envoy_validate/builders.go: delete externalHTTPSPort, the only
`staticcheck -checks U1000` finding in the module.

Http1ProtocolOptions, meshdns.NewServer and meshdns.WithInstanceID are
deliberately left alone (report: keep / needs-check).

The two `--readiness-check` compat flags stay functional (a chart predating
#673/#683 probes with them) but are now cobra MarkDeprecated, so using one
prints a warning naming the replacement prober. charts/ never sets either flag
(grep: one comment in mesh-dns-daemonset.yaml, no --readiness-check argument),
so no chart bump is needed and no warning can appear in production logs.
docs/configuration.md records the new warning + help-hiding.

Verification: bazel test //agent/internal/xds/proxy:proxy_test
//agent/internal/edge/gatewayapi/attachment:attachment_test //agent/internal/cmd/...
//agent/cmd/mesh-dns/... //test/envoy_validate/... -> 6/6 pass;
bazel run //:gazelle (BUILD deps updated); bazel run //:format.check clean.
Full-tree verification runs on the final commit.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…elper (#772)

Phase D2 of the 2026-09-15 review — the identity path, kept in its own commit.

common/spire/tls.go:

- NewSource: unreachable even from tests (`deadcode` with and without -test).
  Since #740 every binary builds its identity source through WaitingSource,
  which calls NewSourceWithTimeout(ctx, socket, 0) — an unbounded wait off the
  startup path — so the 25s-bounded blocking constructor has no caller left.
- SourceTimeout: its only reader was NewSource. The 25s deadline existed to
  keep the blocking startup wait below the chart's liveness budget (#662); with
  the wait no longer on the startup path there is nothing left to bound.
- ServerTLSConfig: superseded by ServerTLSConfigForOwnTrustDomain (#740), which
  resolves the peer trust domain at handshake time instead of at construction
  so a source that has no SVID yet can still build a server config. `grep -w
  ServerTLSConfig` found only its own declaration and doc comment.

Verified first that nothing references them: no Go call sites (including
common/spire/spiretest and every _test.go), no docs, no charts. The four
remaining mentions were doc comments describing "the code this replaces" —
agent/internal/cmd/root.go:344, plus the #740 regression tests in
agent/internal/cmd/edge_identity_test.go, registrar/internal/cmd and
controller/internal/cmd/spire_identity_test.go — rewritten to describe the old
bounded blocking wait without naming symbols that no longer exist. The
NewSourceWithTimeout doc absorbed what NewSource's said (socketPath forms) and
now explains why a non-positive timeout is the live caller's choice.

No behaviour change: nothing executed any of this. ClientTLSConfig and the
shared authorizer() (the RootCATrustDomain sentinel path) are untouched.

Verification (full bar, whole tree): bazel build //... //test/e2e:e2e_test OK;
bazel test //... --test_output=errors -> 98/98 pass (incl. //common/spire:spire_test);
bazel run //:format.check clean; bazel build --config=lint
--@aspect_rules_lint//lint:fail_on_violation //... OK; bazel run //:gazelle and
bazel mod tidy produce no churn; scripts/go-deps-audit.sh exit 0.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit b83bbc5 into main Sep 15, 2026
19 checks passed
@bpalermo
bpalermo deleted the chore/772-d-dead-code branch September 15, 2026 22:30
bpalermo added a commit that referenced this pull request Sep 30, 2026
…lias, supervisor and mesh-dns --readiness-check (#1080)

- Drop the `agent proxy-supervisor` alias (#772/#790) and the /proxy-ready
  layer on the agent image that only it read; the chart stages proxy-ready
  from the proxy-supervisor image. The agent image test now asserts
  /proxy-ready is absent, and a test pins the subcommand as retired.
- Drop the supervisor's deprecated --readiness-check (#673/#775); replace
  TestDeprecatedFlagsStayRegistered with TestRetiredFlagsGone.
- Drop mesh-dns's deprecated --readiness-check (#683), with a matching
  TestRetiredFlagsGone, and fix the stale meshdns.WithReadyMarker comment.
- Update docs/configuration.md, CLAUDE.md, AGENTS.md and common/readymarker
  comments accordingly. charts/ is intentionally untouched.


Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

1 participant