Fix proto compilation errors and gRPC reflection failures - #20
Open
KshitijKaushik123 wants to merge 1 commit into
Open
Fix proto compilation errors and gRPC reflection failures#20KshitijKaushik123 wants to merge 1 commit into
KshitijKaushik123 wants to merge 1 commit into
Conversation
- Fix wrong nested type reference: BidRequest.Metric -> BidRequest.Imp.Metric in agenticrtbframework.proto (Metric is nested inside Imp, not BidRequest) - Fix import path mismatch: openrtb proto lives at v2/, not v2.6/ - Add go_package option to both proto files so protoc-gen-go can regenerate - Update generate.sh to process the services proto and emit gRPC stubs - Fix Makefile bindings target: correct proto paths, drop --experimental_editions - Regenerate pkg/pb/ with current protoc to match updated proto sources - Remove stale agenticrtbframework_grpc.pb.go (services now in separate proto) - Fix sample JSON payloads: use true/false for bool-typed OpenRTB fields instead of 1/0 which breaks the strict protobuf-JSON marshaler via gRPC Closes IABTechLab#11
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
While trying to build and test the gRPC interface locally, I ran into a chain of issues that all trace back to a partial proto refactor (services split into a separate file + migration to
edition = "2023") where the generated code and sample payloads weren't updated to match.Here's what I found and fixed:
1. Wrong nested type reference in proto
agenticrtbframework.proto:198referencedBidRequest.Metric, butMetricis actually nested insideImpin the OpenRTB v2 proto. The generated Go code already had the correct path (BidRequest_Imp_Metric), but the proto source couldn't be regenerated because of this mismatch.2. Import path mismatch
The proto imported from
com/iabtechlab/openrtb/v2.6/openrtb.proto, but the actual file sits atv2/openrtb.proto. This caused thedescribereflection failure — the registered FileDescriptors didn't match what the stubs declared.3. Generated code out of sync
The committed
.pb.gofiles were generated with an older protoc from before the services were split intoagenticrtbframeworkservices.proto. Neither proto file hadgo_packageoptions,generate.shonly processed the main proto (not the services file), and the Makefilebindingstarget referenced a non-existent root-levelopenrtb.protowith the now-unnecessary--experimental_editionsflag.Fixed by:
go_packageoptions in both proto filesgenerate.shto also process the services proto and emit gRPC stubsbindingstarget with correct proto pathspkg/pb/files with current protocagenticrtbframework_grpc.pb.go(services now generate their own grpc file)4. Sample payloads use integers for bool fields
multi-impression.jsonandnative-ad.jsonused0/1for fields that the OpenRTB proto declares asbool(device.js,regs.coppa,regs.gdpr,source.fd). The web UI path is lenient about this, but the gRPC path fails withexpecting boolean ; instead got 1due to the strict protobuf-JSON marshaler.Testing
After applying all fixes:
go build ./...passes cleango vet ./...passes cleanscripts/generate.shruns without errors and produces consistent output on re-runTested against the reproduction steps from #11 — proto compilation, reflection, and sample payload issues are all resolved.
Closes #11