-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix(stf): fix router.InvokeTyped reflection usage #20741
Conversation
WalkthroughWalkthroughThe recent changes to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@kocubinski your pull request is missing a changelog! |
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- server/v2/stf/stf_router.go (1 hunks)
Additional context used
Path-based instructions (1)
server/v2/stf/stf_router.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (1)
server/v2/stf/stf_router.go (1)
168-168
: The change in parameter order in themerge
function appears to align with the intended functionality. Ensure this change is consistent across all usages.Verification successful
The
merge
function inserver/v2/stf/stf_router.go
is called once at line 168. We need to ensure this call aligns with the new parameter order. Let's inspect the relevant lines instf_router.go
to confirm this.
The
merge
function is defined as follows:func merge(src, dst protoiface.MessageV1) { reflect.Indirect(reflect.ValueOf(src)).Set(reflect.Indirect(reflect.ValueOf(dst))) }And it is called in the
InvokeTyped
method:func (r Router) InvokeTyped(ctx context.Context, req, resp protoiface.MessageV1) error { handlerResp, err := r.InvokeUntyped(ctx, req) if err != nil { return err } merge(resp, handlerResp) return nil }The
merge
function is called withresp
as the first argument andhandlerResp
as the second argument. This aligns with the new parameter order wheresrc
is the first argument anddst
is the second argument. Therefore, the change in themerge
function's parameter order is consistent with its usage in theInvokeTyped
method.
server/v2/stf/stf_router.go:168
:merge(resp, handlerResp)
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `merge` function's new parameter order does not introduce side effects. # Test: Search for all usages of the `merge` function. Expect: Consistent usage reflecting the new parameter order. rg --type go $'merge'Length of output: 4731
Script:
#!/bin/bash # Description: Verify the implementation and usage of the `merge` function in `server/v2/stf/stf_router.go`. # Extract the relevant lines from the file to inspect the `merge` function and its usage. rg -A 10 -B 10 'merge\(resp, handlerResp\)' server/v2/stf/stf_router.goLength of output: 672
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- server/v2/stf/stf_router.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- server/v2/stf/stf_router.go
Description
Minor fix from #20724.
simapp/v2 test passes again, which is now required!
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...
!
in the type prefix if API or client breaking changeCHANGELOG.md
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.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit