-
Notifications
You must be signed in to change notification settings - Fork 0
handler: support grpc protocol #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1149d68
to
2be0c01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the gRPC protocol along with updated streaming response handling (including trailers), refactors various protocol and handler components, and adjusts related configuration and client examples to accommodate the new features.
- Added gRPC (and grpc-web) support and enabled trailers in the streaming response implementation.
- Refactored handler and protocol modules to use instance methods instead of external implementation functions.
- Updated dependency configurations and example clients to reflect these protocol changes.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/connect/streaming_response.py | Introduces a streaming response class with trailer support. |
src/connect/protocol.py | Adds GRPC protocol constants and adjusts protocol header exclusions. |
src/connect/handler.py | Refactors handler implementation to use instance methods and removes typeguard checks. |
src/connect/error.py | Adds a helper to return error details as Any messages. |
src/connect/envelope.py | Introduces EnvelopeWriter/Reader classes and related envelope functions. |
src/connect/connect.py | Refactors message receiving functions and stream validation methods. |
pyproject.toml | Adds googleapis-common-protos dependency. |
examples/pyproject.toml | Adjusts example dependencies. |
examples/cmd/examples-go/client/main.go | Updates Go client to use an HTTP/2 transport with gRPC configuration. |
conformance/server_config.yaml | Enables GRPC protocol and trailer support. |
conformance/run-testcase.txt | Updates test cases for gRPC support. |
conformance/pyproject.toml | Updates dependency sources for conformance tests. |
Comments suppressed due to low confidence (1)
src/connect/envelope.py:228
- The error message contains a typo: 'send_mas_bytes' should be 'send_max_bytes' to accurately reflect the variable name.
raise ConnectError(f"compressed message size {len(data)} exceeds send_mas_bytes {self.send_max_bytes}",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for the gRPC protocol alongside Connect with several refactoring updates to improve streaming responses (including trailer support) and protocol handler implementations. Key changes include:
- Introducing gRPC constants and updating protocol header exclusion in the protocol module.
- Refactoring Handler classes to replace function pointer checks with a stream type property.
- Updating configuration files and client examples to support gRPC protocol and HTTP/2 trailers.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/connect/streaming_response.py | New streaming response class with trailer support; potential initialization bug in media_type. |
src/connect/protocol.py | Added new gRPC constants and adjusted header exclusion logic (duplicate header entry). |
src/connect/handler.py | Refactored request handling to use stream_type and unified implementation method. |
src/connect/error.py | Added helper method details_any for error details. |
src/connect/envelope.py | Introduced EnvelopeWriter/Reader; minor typo in error message. |
src/connect/connect.py | Updated async stream handling and removed redundant connection protocols. |
pyproject.toml | Added googleapis-common-protos dependency. |
examples/pyproject.toml | Removed grpcio dependency to align with gRPC support through Connect. |
examples/cmd/examples-go/client/main.go | Updated client transport configuration to support gRPC over HTTP/2. |
conformance/server_config.yaml | Updated protocol list and trailer support configuration. |
conformance/run-testcase.txt | Updated test cases to reflect gRPC request handling changes. |
conformance/pyproject.toml | Updated hypercorn dependency to pull from Git. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the gRPC protocol alongside the existing Connect protocol while updating various components to handle streaming and unary messages more robustly. Key changes include:
- Introduction of gRPC protocol constants and configuration updates.
- Refactoring of handler and connection implementations to streamline stream and unary request processing.
- Enhancements in envelope marshaling/unmarshaling and dependency updates.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/connect/streaming_response.py | New StreamingResponse supporting trailers with minor header issues. |
src/connect/protocol.py | Added gRPC-related constants and updated protocol handler interfaces. |
src/connect/handler.py | Refactored handler implementation and streamlined timeout parsing. |
src/connect/envelope.py | Added EnvelopeWriter/Reader enhancements; updated data size checks. |
src/connect/connect.py | Updated connection abstractions and unary/stream message receiving. |
pyproject.toml, examples/pyproject.toml | Updated dependencies for gRPC support. |
examples/cmd/examples-go/client/main.go | Modified Go client for HTTP/2 and gRPC support. |
conformance/* | Updated config and test cases to reflect gRPC support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for the GRPC protocol across the project while enhancing and refactoring various connection and handler components.
- Added new GRPC-related constants and updated protocol mappings.
- Refactored handler implementations to use an async implementation method and removed legacy type‐checks.
- Updated envelope writing/reading logic and example client configurations to incorporate GRPC support.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/connect/streaming_response.py | Introduces streaming responses with trailer support and adjusts header initialization. |
src/connect/protocol.py | Adds GRPC and GRPC-Web protocol constants, and removes unused type definitions. |
src/connect/handler.py | Refactors handler classes by removing legacy type-check methods and integrating GRPC support via async implementation. |
src/connect/error.py | Adds a helper method for retrieving error details. |
src/connect/envelope.py | Implements envelope writer/reader functionality with compression support. |
src/connect/connect.py | Refactors connection interfaces and async message receiving functions. |
pyproject.toml | Adds dependency on googleapis-common-protos. |
examples/pyproject.toml | Updates dependencies for examples. |
examples/cmd/examples-go/client/main.go | Updates the client example to use an HTTP/2 transport with GRPC support. |
conformance/* | Modifies configurations and test cases to enable GRPC and trailer support. |
Comments suppressed due to low confidence (1)
src/connect/handler.py:44
- [nitpick] There appears to be a naming inconsistency: 'ProtocolGPRC' should probably be renamed to 'ProtocolGRPC' to align with the GRPC protocol naming used elsewhere.
from connect.protocol_grpc import ProtocolGPRC
conformance result:
conformance server config: