Skip to content

Conversation

@pitabwire
Copy link
Owner

No description provided.

@pitabwire pitabwire merged commit 75a2a34 into main Nov 19, 2025
3 of 4 checks passed
@pitabwire pitabwire deleted the feat/pbvalidation-struct-validation branch November 19, 2025 19:09
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @pitabwire, 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 focuses on enhancing code clarity and maintainability by renaming the generic Interceptor type to ValidationInterceptor within the security/interceptors/connect package. This change provides a more precise description of the interceptor's role in handling validation logic. All related code, including the constructor, methods, and internal references, have been updated to reflect this new naming, along with corresponding test cases and documentation.

Highlights

  • Interceptor Renaming: The primary Interceptor type in pbvalidation.go has been renamed to ValidationInterceptor to more accurately reflect its purpose.
  • Codebase Consistency: All associated functions, methods, and internal references that previously used Interceptor now correctly refer to ValidationInterceptor, ensuring consistency across the codebase.
  • Test Updates: Unit tests in pbvalidation_test.go have been updated to utilize the new NewValidationInterceptor constructor and reflect the type renaming.
  • Documentation Alignment: A comment in authentication.go was updated to align with the new naming convention, specifically for AuthInterceptor.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 appropriately renames Interceptor to ValidationInterceptor for better clarity, along with related functions and types. This improves the descriptiveness of the validation logic. My review focuses on some side effects of what appears to be a broad search-and-replace, which has led to some incorrect comments. I've also suggested renaming test functions for consistency and pointed out a few minor typos. Additionally, please note the typo in the pull request title ('appripriately' should be 'appropriately').

)

// AuthInterceptor implements connect.Interceptor for JWT authentication.
// AuthInterceptor implements connect.ValidationInterceptor for JWT authentication.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This comment is incorrect. AuthInterceptor implements the connect.Interceptor interface. ValidationInterceptor is a different struct in this package that also implements connect.Interceptor. This change appears to be an artifact of a search-and-replace operation and should be reverted to refer to connect.Interceptor to avoid confusion.

Suggested change
// AuthInterceptor implements connect.ValidationInterceptor for JWT authentication.
// AuthInterceptor implements connect.Interceptor for JWT authentication.


// WrapUnary implements connect.Interceptor.
func (i *Interceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
// WrapUnary implements connect.ValidationInterceptor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This comment is misleading. WrapUnary is a method that helps ValidationInterceptor satisfy the connect.Interceptor interface. It does not implement connect.ValidationInterceptor. This seems to be an error from a search-and-replace. Please revert it to refer to connect.Interceptor.

Suggested change
// WrapUnary implements connect.ValidationInterceptor.
// WrapUnary implements connect.Interceptor.


// WrapStreamingClient implements connect.Interceptor.
func (i *Interceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
// WrapStreamingClient implements connect.ValidationInterceptor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This comment is misleading. WrapStreamingClient is a method that helps ValidationInterceptor satisfy the connect.Interceptor interface. It does not implement connect.ValidationInterceptor. This seems to be an error from a search-and-replace. Please revert it to refer to connect.Interceptor.

Suggested change
// WrapStreamingClient implements connect.ValidationInterceptor.
// WrapStreamingClient implements connect.Interceptor.


// WrapStreamingHandler implements connect.Interceptor.
func (i *Interceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
// WrapStreamingHandler implements connect.ValidationInterceptor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This comment is misleading. WrapStreamingHandler is a method that helps ValidationInterceptor satisfy the connect.Interceptor interface. It does not implement connect.ValidationInterceptor. This seems to be an error from a search-and-replace. Please revert it to refer to connect.Interceptor.

Suggested change
// WrapStreamingHandler implements connect.ValidationInterceptor.
// WrapStreamingHandler implements connect.Interceptor.

)

// An Option configures an [Interceptor].
// An Option configures an [ValidationInterceptor].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a grammatical error here. The article should be "a" instead of "an" before "ValidationInterceptor".

Suggested change
// An Option configures an [ValidationInterceptor].
// An Option configures a [ValidationInterceptor].

}

// WithValidateResponses configures the [Interceptor] to also validate reponses
// WithValidateResponses configures the [ValidationInterceptor] to also validate reponses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a typo in "reponses". It should be "responses".

Suggested change
// WithValidateResponses configures the [ValidationInterceptor] to also validate reponses
// WithValidateResponses configures the [ValidationInterceptor] to also validate responses

}

// NewInterceptor builds an Interceptor. The default configuration is
// NewValidationInterceptor builds an ValidationInterceptor. The default configuration is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a grammatical error here. The article should be "a" instead of "an" before "ValidationInterceptor".

Suggested change
// NewValidationInterceptor builds an ValidationInterceptor. The default configuration is
// NewValidationInterceptor builds a ValidationInterceptor. The default configuration is

@@ -18,31 +18,31 @@ import (

func TestNewInterceptor(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the function being tested (NewValidationInterceptor), this test function should be renamed to TestNewValidationInterceptor.

Suggested change
func TestNewInterceptor(t *testing.T) {
func TestNewValidationInterceptor(t *testing.T) {

@@ -378,7 +378,7 @@ func BenchmarkValidateAllStructs(b *testing.B) {
}

func BenchmarkInterceptorWrapUnary(b *testing.B) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the renaming of Interceptor to ValidationInterceptor, this benchmark function should be renamed to BenchmarkValidationInterceptorWrapUnary.

Suggested change
func BenchmarkInterceptorWrapUnary(b *testing.B) {
func BenchmarkValidationInterceptorWrapUnary(b *testing.B) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant