-
Notifications
You must be signed in to change notification settings - Fork 78
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 not found error for gateway handler #2726
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request focus on enhancing error handling and logging within the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
[CHATOPS:HELP] ChatOps commands.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2726 +/- ##
==========================================
- Coverage 23.95% 23.93% -0.02%
==========================================
Files 545 545
Lines 54324 54322 -2
==========================================
- Hits 13011 13001 -10
- Misses 40538 40544 +6
- Partials 775 777 +2 ☔ View full report in Codecov by Sentry. |
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- pkg/gateway/lb/handler/grpc/handler.go (2 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
pkg/gateway/lb/handler/grpc/handler.go
[warning] 1907-1907: pkg/gateway/lb/handler/grpc/handler.go#L1907
Added line #L1907 was not covered by tests
[warning] 1909-1909: pkg/gateway/lb/handler/grpc/handler.go#L1909
Added line #L1909 was not covered by tests
[warning] 1911-1911: pkg/gateway/lb/handler/grpc/handler.go#L1911
Added line #L1911 was not covered by tests
[warning] 2737-2737: pkg/gateway/lb/handler/grpc/handler.go#L2737
Added line #L2737 was not covered by tests
[warning] 2739-2739: pkg/gateway/lb/handler/grpc/handler.go#L2739
Added line #L2739 was not covered by tests
[warning] 2741-2741: pkg/gateway/lb/handler/grpc/handler.go#L2741
Added line #L2741 was not covered by tests
🔇 Additional comments (1)
pkg/gateway/lb/handler/grpc/handler.go (1)
2737-2741
: 🛠️ Refactor suggestion
Add test coverage and consider refactoring error handling.
The error handling logic is correct but lacks test coverage. Additionally, there's an opportunity to reduce code duplication:
- Add test cases for error scenarios in MultiRemove
- Consider extracting the common error handling pattern with span recording into a helper function, as this pattern is repeated in both MultiUpdate and MultiRemove methods.
Example helper function:
func (s *server) recordErrorSpan(span trace.Span, err error) {
if st, _ := status.FromError(err); st != nil && span != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
}
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 2737-2737: pkg/gateway/lb/handler/grpc/handler.go#L2737
Added line #L2737 was not covered by tests
[warning] 2739-2739: pkg/gateway/lb/handler/grpc/handler.go#L2739
Added line #L2739 was not covered by tests
[warning] 2741-2741: pkg/gateway/lb/handler/grpc/handler.go#L2741
Added line #L2741 was not covered by tests
Description
SSIA
Related Issue
Versions
Checklist
Special notes for your reviewer
Summary by CodeRabbit
Bug Fixes
Refactor