feat(server): validate presence according to google.api.field_behavior annotations#870
feat(server): validate presence according to google.api.field_behavior annotations#870
google.api.field_behavior annotations#870Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the robustness of the server by introducing automatic validation of incoming request parameters. By leveraging Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a robust validation mechanism for incoming Protobuf messages based on google.api.field_behavior annotations. The changes correctly propagate detailed validation errors through both gRPC and JSON-RPC transport layers, providing more informative feedback to clients. The addition of the validate_request_params decorator centralizes this validation logic, ensuring consistency across request handlers. The accompanying tests adequately cover the new validation functionality, including edge cases like missing required fields and nested message validation. Overall, this is a significant improvement for API robustness and developer experience.
51f99ae to
b891f34
Compare
773a7c9 to
a5f48cb
Compare
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/client/transports/grpc.py | 89.23% | 90.14% | 🟢 +0.91% |
| src/a2a/client/transports/jsonrpc.py | 86.71% | 86.81% | 🟢 +0.09% |
| src/a2a/client/transports/rest.py | 91.52% | 92.73% | 🟢 +1.21% |
| src/a2a/server/request_handlers/default_request_handler.py | 96.89% | 96.99% | 🟢 +0.10% |
| src/a2a/server/request_handlers/grpc_handler.py | 94.48% | 94.89% | 🟢 +0.41% |
| src/a2a/server/request_handlers/request_handler.py | 100.00% | 90.48% | 🔴 -9.52% |
| src/a2a/server/request_handlers/rest_handler.py | 93.75% | 94.12% | 🟢 +0.37% |
| src/a2a/utils/proto_utils.py | 91.23% | 90.36% | 🔴 -0.87% |
| Total | 91.45% | 91.49% | 🟢 +0.04% |
Generated by coverage-comment.yml
Fixes #845