-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
ci(lint): bump golangci-lint to v1.50.1 #4195
ci(lint): bump golangci-lint to v1.50.1 #4195
Conversation
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@@ -92,7 +92,7 @@ func (aH *APIHandler) saveSpans(w http.ResponseWriter, r *http.Request) { | |||
var tSpans []*zipkincore.Span | |||
switch contentType { | |||
case "application/x-thrift": | |||
tSpans, err = zipkin.DeserializeThrift(bodyBytes) | |||
tSpans, err = zipkin.DeserializeThrift(r.Context(), bodyBytes) |
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.
what's the point of passing context here? DeserializeThrift is not an IO-bound function.
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.
First there was
Function
DeserializeThrift
should pass the context parameter (contextcheck)
If I just use
zipkin.DeserializeThrift(context.Background(), bodyBytes)
I get
Non-inherited new context, use function like
context.WithXXX
orr.Context
instead (contextcheck)
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.
I see the problem:
jaeger/model/converter/thrift/zipkin/deserialize.go
Lines 40 to 41 in 74d6a12
func DeserializeThrift(b []byte) ([]*zipkincore.Span, error) { | |
ctx := context.Background() |
That's why it's flagging this specific function vs. other functions. It's a false positive because all serialization happens in-memory, without IO, but the way Thrift APIs are defined it looks like there is an IO and requires a context.
Codecov ReportBase: 97.12% // Head: 97.09% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #4195 +/- ##
==========================================
- Coverage 97.12% 97.09% -0.03%
==========================================
Files 301 301
Lines 17674 17672 -2
==========================================
- Hits 17165 17159 -6
- Misses 410 413 +3
- Partials 99 100 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
## Which problem is this PR solving? - bump golangci-lint to v1.50.1 ## Short description of the changes - fixes contextlint - disable gosec g114 Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com> Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
## Which problem is this PR solving? - bump golangci-lint to v1.50.1 ## Short description of the changes - fixes contextlint - disable gosec g114 Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com> Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com> Signed-off-by: shubbham1215 <sawaikershubham@gmail.com>
Which problem is this PR solving?
Short description of the changes
Signed-off-by: Matthieu MOREL matthieu.morel35@gmail.com