-
Notifications
You must be signed in to change notification settings - Fork 2
feat: ability to set connect-rpc protocol #285
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
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.
Summary of Changes
Hello @strantalis, 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 enhances the SDK's flexibility by introducing the ability for users to explicitly configure the network protocol used for communication with platform services. It adds a new enum to define supported protocols and integrates this configuration option into the SDK builder, defaulting to the Connect protocol.
Highlights
- New ProtocolType Enum: Introduced a new
ProtocolType
enum (CONNECT
,GRPC
,GRPC_WEB
) to provide a clear, SDK-specific abstraction for the underlying Connect-RPCNetworkProtocol
values. This centralizes protocol definitions and improves readability. - Configurable Connect-RPC Protocol: The
SDKBuilder
now includes aprotocol(ProtocolType protocolType)
method, allowing users to explicitly set the desired network protocol for communication with platform services. The default protocol isCONNECT
. - Dynamic Protocol Client Configuration: The internal
getProtocolClient
method inSDKBuilder
has been updated to use the dynamically configuredProtocolType
when creating theProtocolClientConfig
, replacing the previously hardcodedNetworkProtocol.GRPC
. - Protocol Configuration Tests: Added new test cases in
SDKBuilderTest
to verify that theprotocol()
method correctly configures the SDK forCONNECT
,GRPC
, andGRPC_WEB
protocols, and confirms the defaultCONNECT
behavior.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
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 .gemini/
folder in the base of the repository. Detailed instructions can be found here.
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 or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request introduces the capability to configure the connect-rpc
protocol for the SDK, defaulting to CONNECT
. The changes are well-structured, including a new ProtocolType
enum, modifications to the SDKBuilder
, and corresponding test updates. I've identified a potential NullPointerException
in the SDKBuilder
and a critical issue in a new test case that will cause it to fail.
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.
Summary of Changes
Hello @strantalis, 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!
I've implemented a new feature that allows users to specify the network protocol for the SDK's communication with platform services. This provides flexibility to choose between Connect, gRPC, and gRPC-Web protocols, with Connect being the default.
Highlights
- ProtocolType Enum: Introduced a new ProtocolType enum to abstract the underlying Connect-RPC NetworkProtocol types (CONNECT, GRPC, GRPC_WEB).
- Configurable SDKBuilder: Enhanced the SDKBuilder with a protocol() method, enabling users to explicitly set the desired communication protocol for the SDK.
- Dynamic Protocol Selection: Updated the internal getProtocolClient method in SDKBuilder to dynamically use the chosen ProtocolType, moving away from a hardcoded gRPC protocol.
- Comprehensive Testing: Added new test cases in SDKBuilderTest to ensure the correct functionality and default behavior of the protocol configuration across all supported types.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
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 .gemini/
folder in the base of the repository. Detailed instructions can be found here.
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 or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request introduces the ability to configure the connect-rpc protocol for the SDK, defaulting to CONNECT
. The implementation looks good, adding a ProtocolType
enum and integrating it into the SDKBuilder
. I've identified a potential issue with using GRPC_WEB
in plaintext mode and a flaw in the new test case. My detailed comments provide suggestions to address these points.
@gemini-code-assist /review |
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.
Code Review
This pull request introduces the ability to configure the Connect-RPC protocol used by the SDK. A new ProtocolType
enum is added, and the SDKBuilder
is updated with a protocol()
method to select between CONNECT
, GRPC
, and GRPC_WEB
. The default is set to CONNECT
. The changes include necessary validation for protocol compatibility (e.g., gRPC-Web with plaintext connections) and updates to tests to accommodate the new feature and default. My review includes one suggestion to improve test coverage for the new protocol configuration logic.
|
🤖 I have created a release *beep* *boop* --- <details><summary>0.10.0</summary> ## [0.10.0](v0.9.0...v0.10.0) (2025-09-02) ### ⚠ BREAKING CHANGES * **sdk:** add base key and support for key grants in ZTDF ([#271](#271)) ### Features * ability to set connect-rpc protocol ([#285](#285)) ([47041c5](47041c5)) * add system metadata assertion ([#270](#270)) ([d235f13](d235f13)) * expose AuthorizationService v2 ([#287](#287)) ([d1fd106](d1fd106)) * introduce the base key for nano flows ([#273](#273)) ([d337704](d337704)) * **sdk:** add base key and support for key grants in ZTDF ([#271](#271)) ([c3b79db](c3b79db)) ### Bug Fixes * **ci:** Update codeql.yaml to run on all pull requests ([#283](#283)) ([9e318bb](9e318bb)) * create AES-256 keys of the correct length with all curves ([#282](#282)) ([95c20b3](95c20b3)) * **sdk:** add methods to examine Manifest and Policy ([#278](#278)) ([03d5d41](03d5d41)) * **sdk:** parse the component sizes ([#286](#286)) ([3b1bb69](3b1bb69)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: opentdf-automation[bot] <149537512+opentdf-automation[bot]@users.noreply.github.com>
No description provided.