Skip to content

Add gRPC server reflection to the Rust reference implementation#14

Open
aleksUIX wants to merge 2 commits into
IABTechLab:mainfrom
aleksUIX:rust-grpc-reflection
Open

Add gRPC server reflection to the Rust reference implementation#14
aleksUIX wants to merge 2 commits into
IABTechLab:mainfrom
aleksUIX:rust-grpc-reflection

Conversation

@aleksUIX

@aleksUIX aleksUIX commented Jul 6, 2026

Copy link
Copy Markdown

Summary

Registers the gRPC v1 server reflection service on the Rust reference implementation, using the file descriptor set emitted by build.rs.

The Go server already registers reflection (cmd/agent/main.go), but the Rust server did not, so grpcurl and other reflection-based clients needed local proto files to introspect or call it. This brings the two implementations to parity.

Verification

Against a local build:

$ grpcurl -plaintext localhost:50051 list
com.iabtechlab.bidstream.mutation.services.v1.RTBExtensionPoint
grpc.reflection.v1.ServerReflection

$ grpcurl -plaintext localhost:50051 describe com.iabtechlab.bidstream.mutation.services.v1.RTBExtensionPoint
service RTBExtensionPoint {
  rpc GetMutations ( .com.iabtechlab.bidstream.mutation.v1.RTBRequest ) returns ( .com.iabtechlab.bidstream.mutation.v1.RTBResponse );
}

GetMutations invoked with samples/banner-basic.json over reflection returns the expected segment and deal mutations.

Note

Stacked on #13 (it introduced the descriptor set emission in build.rs that reflection reuses). The first commit in the diff belongs to that PR and will drop out once it merges; the reflection change itself is the single top commit.

aleksUIX added 2 commits July 5, 2026 18:38
…outing

The new tests decode every samples/*.json through the proto schema
(via a descriptor set emitted at build time) and run them through the
demo evaluator. Writing them surfaced two existing bugs, fixed here:

- The evaluator matched auction ids (auction-123, auction-456, ...)
  against the top-level RTBRequest envelope id, so no bundled sample
  ever produced mutations. It now routes on bid_request.id and echoes
  the envelope id in the response, matching the Go implementation's
  use of the enclosed BidRequest. The dead app-123 arm now matches
  native-ad.json's auction-native-123.
- multi-impression.json and native-ad.json encoded proto bool fields
  (device.js, regs.coppa, regs.gdpr, source.fd) as 0/1, which the
  proto JSON mapping rejects. This is bug 4 of IABTechLab#11 (expecting boolean,
  instead got 1); both samples now decode cleanly.

Test coverage added:
- mutation/builder.rs: payload shapes for segments, deals, bid shade
- bidder/evaluator.rs: routing table, envelope id echo, fallbacks
- sample_tests.rs: schema-validates all five samples and asserts each
  drives its documented demo mutations end to end

cargo test: 13 passed. No changes to the generated proto code.
The Go server registers reflection (cmd/agent/main.go) but the Rust
server did not, so grpcurl and other reflection-based clients needed
local proto files to introspect or call it. Registers the v1 reflection
service using the file descriptor set emitted by build.rs.

Verified with grpcurl against a local build: list and describe resolve
the RTBExtensionPoint service, and GetMutations invoked with
samples/banner-basic.json returns the expected mutations.
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