Add gRPC server reflection to the Rust reference implementation#14
Open
aleksUIX wants to merge 2 commits into
Open
Add gRPC server reflection to the Rust reference implementation#14aleksUIX wants to merge 2 commits into
aleksUIX wants to merge 2 commits into
Conversation
…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.
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.
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, sogrpcurland 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:
GetMutationsinvoked withsamples/banner-basic.jsonover reflection returns the expected segment and deal mutations.Note
Stacked on #13 (it introduced the descriptor set emission in
build.rsthat 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.