Skip to content
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

feat(grpcrouter): add hybrid query handler #17921

Merged
merged 10 commits into from
Oct 11, 2023
Merged

Conversation

testinginprod
Copy link
Contributor

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

return nil, fmt.Errorf("invalid request type %T, method %s does not accept gogoproto messages", request, prefMethod.FullName())
}
resp, err := method.Handler(handler, ctx, func(msg any) error {
proto2.Merge(msg.(proto2.Message), protov2Request)
Copy link
Member

Choose a reason for hiding this comment

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

Why are we merging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what other alternative we have besides doing reflect.Set, which I'm not really happy doing post app initialization.

@testinginprod testinginprod marked this pull request as ready for review October 6, 2023 10:53
@testinginprod testinginprod requested a review from a team as a code owner October 6, 2023 10:53
import (
"context"
"fmt"
"reflect"

Check notice

Code scanning / CodeQL

Sensitive package import Note

Certain system packages contain functions which may be a possible source of non-determinism
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2023

@testinginprod your pull request is missing a changelog!

protov2Type = reflect.TypeOf((*proto2.Message)(nil)).Elem()
)

type Handler = func(ctx context.Context, message protoiface.MessageV1) (protoiface.MessageV1, error)
Copy link
Member

@aaronc aaronc Oct 6, 2023

Choose a reason for hiding this comment

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

Suggested change
type Handler = func(ctx context.Context, message protoiface.MessageV1) (protoiface.MessageV1, error)
type Handler = func(ctx context.Context, request, response protoiface.MessageV1) error

We discussed changing to this signature in our last call. Strongly recommend this because it matches the signature of ClientConnInterface.Invoke. The signature that this PR has can be a wrapper that looks up the response type, but generally there should be no need to look up the response type because Invoke will provide it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we follow this API we'd need to merge on the resp also

baseapp/grpcrouter.go Outdated Show resolved Hide resolved
@testinginprod testinginprod added this pull request to the merge queue Oct 11, 2023
Merged via the queue into main with commit ecf14b7 Oct 11, 2023
48 of 49 checks passed
@testinginprod testinginprod deleted the tip/grpcrouter/extend branch October 11, 2023 08:02
@testinginprod
Copy link
Contributor Author

@Mergifyio backport release/v0.50.x

Copy link
Contributor

mergify bot commented Nov 2, 2023

backport release/v0.50.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 2, 2023
Co-authored-by: unknown unknown <unknown@unknown>
(cherry picked from commit ecf14b7)
testinginprod added a commit that referenced this pull request Nov 2, 2023
Co-authored-by: testinginprod <98415576+testinginprod@users.noreply.github.com>
@testinginprod testinginprod mentioned this pull request Dec 19, 2023
44 tasks
@faddat faddat mentioned this pull request Nov 8, 2024
12 tasks
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.

4 participants