-
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
[patch] bugfix gateway & internal/net/grpc #569
Conversation
Best reviewed: commit by commit
Optimal code review plan
|
[WARNING:INTCFG] Changes in |
[CHATOPS:HELP] ChatOps commands.
|
internal/net/grpc/option.go
Outdated
@@ -80,6 +81,13 @@ func WithConnectionPoolRebalanceDuration(dur string) Option { | |||
} | |||
} | |||
|
|||
|
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.
[golangci] reported by reviewdog 🐶
File is not goimports
-ed (goimports)
internal/net/grpc/option.go
Outdated
@@ -80,6 +81,13 @@ func WithConnectionPoolRebalanceDuration(dur string) Option { | |||
} | |||
} | |||
|
|||
|
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.
[golangci] reported by reviewdog 🐶
File is not gofmt
-ed with -s
(gofmt)
Codecov Report
@@ Coverage Diff @@
## master #569 +/- ##
==========================================
+ Coverage 7.84% 10.28% +2.44%
==========================================
Files 388 403 +15
Lines 19945 20935 +990
==========================================
+ Hits 1565 2154 +589
- Misses 18156 18517 +361
- Partials 224 264 +40
Continue to review full report at Codecov.
|
77ef0b6
to
5023e7d
Compare
if nn.Pods == nil { | ||
nodeByName[nodeName].Pods = new(payload.Info_Pods) | ||
} | ||
if nn.Pods.Pods == nil { |
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.
if nn.Pods == nil { | |
nodeByName[nodeName].Pods = new(payload.Info_Pods) | |
} | |
if nn.Pods.Pods == nil { | |
if nn.Pods == nil { | |
nodeByName[nodeName].Pods = new(payload.Info_Pods) | |
} else if nn.Pods.Pods == nil { |
log.Errorf("error at SearchByID\t%v", err) | ||
if span != nil { | ||
span.SetStatus(trace.StatusCodeNotFound(err.Error())) | ||
} | ||
return nil, status.WrapWithNotFound(fmt.Sprintf("SearchByID API meta %s's uuid not found", metaID), err, req, info.Get()) | ||
return nil, status.WrapWithNotFound(fmt.Sprintf("SearchByID API meta %s's uuid not found", req.GetId()), err, req, info.Get()) |
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.
[golangci] reported by reviewdog 🐶
line is 128 characters (lll)
if span != nil { | ||
span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) | ||
} | ||
return nil, status.WrapWithInvalidArgument(fmt.Sprintf("Insert API meta datas %v's vector invalid", vec.GetId()), err, info.Get()) |
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.
[golangci] reported by reviewdog 🐶
line is 132 characters (lll)
if span != nil { | ||
span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) | ||
} | ||
return nil, status.WrapWithInvalidArgument(fmt.Sprintf("MultiInsert API meta datas %v's vector invalid", vec.GetId()), err, info.Get()) |
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.
[golangci] reported by reviewdog 🐶
line is 138 characters (lll)
if span != nil { | ||
span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) | ||
} | ||
return nil, status.WrapWithInvalidArgument(fmt.Sprintf("Update API meta datas %v's vector invalid", vec.GetId()), err, info.Get()) |
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.
[golangci] reported by reviewdog 🐶
line is 132 characters (lll)
if span != nil { | ||
span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) | ||
} | ||
return nil, status.WrapWithInvalidArgument(fmt.Sprintf("MultiUpdate API meta datas %v's vector invalid", vec.GetId()), err, info.Get()) |
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.
[golangci] reported by reviewdog 🐶
line is 138 characters (lll)
if span != nil { | ||
span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) | ||
} | ||
return nil, status.WrapWithInvalidArgument(fmt.Sprintf("Upsert API meta datas %v's vector invalid", vec.GetId()), err, info.Get()) |
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.
[golangci] reported by reviewdog 🐶
line is 132 characters (lll)
@@ -290,6 +294,13 @@ func (s *server) Insert(ctx context.Context, vec *payload.Object_Vector) (ce *pa | |||
span.End() | |||
} | |||
}() | |||
if len(vec.GetVector()) < 2 { | |||
err = errors.ErrInvalidDimensionSize(len(vec.GetVector()), 0) | |||
if span != nil { |
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.
[golangci] reported by reviewdog 🐶
if statements should only be cuddled with assignments used in the if statement itself (wsl)
@@ -389,6 +400,13 @@ func (s *server) MultiInsert(ctx context.Context, vecs *payload.Object_Vectors) | |||
metaMap := make(map[string]string) | |||
metas := make([]string, 0, len(vecs.GetVectors())) | |||
for i, vec := range vecs.GetVectors() { | |||
if len(vec.GetVector()) < 2 { | |||
err = errors.ErrInvalidDimensionSize(len(vec.GetVector()), 0) | |||
if span != nil { |
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.
[golangci] reported by reviewdog 🐶
if statements should only be cuddled with assignments used in the if statement itself (wsl)
@@ -389,6 +400,13 @@ func (s *server) MultiInsert(ctx context.Context, vecs *payload.Object_Vectors) | |||
metaMap := make(map[string]string) | |||
metas := make([]string, 0, len(vecs.GetVectors())) | |||
for i, vec := range vecs.GetVectors() { | |||
if len(vec.GetVector()) < 2 { |
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.
[golangci] reported by reviewdog 🐶
mnd: Magic number: 2, in detected (gomnd)
@@ -550,6 +575,13 @@ func (s *server) MultiUpdate(ctx context.Context, vecs *payload.Object_Vectors) | |||
}() | |||
ids := make([]string, 0, len(vecs.GetVectors())) | |||
for _, vec := range vecs.GetVectors() { | |||
if len(vec.GetVector()) < 2 { |
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.
[golangci] reported by reviewdog 🐶
mnd: Magic number: 2, in detected (gomnd)
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.
LGTM
5023e7d
to
22cf425
Compare
22cf425
to
9dcd4ef
Compare
9dcd4ef
to
8c8fcb3
Compare
/rebase |
[REBASE] Rebase triggered by kpango for branch: bugfix/gateway-internal-grpc/bugfixes |
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
8c8fcb3
to
6931f99
Compare
Signed-off-by: kpango i.can.feel.gravity@gmail.com
Description:
in this PR I fixed 4 bugs and added 1 feature
bugs
feature
Related Issue:
How Has This Been Tested?:
Environment:
Types of changes:
Changes to Core Features:
Checklist: