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

ci(lint): bump golangci-lint to v1.50.1 #4195

Merged
merged 1 commit into from
Jan 30, 2023
Merged

ci(lint): bump golangci-lint to v1.50.1 #4195

merged 1 commit into from
Jan 30, 2023

Conversation

mmorel-35
Copy link
Contributor

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>
@mmorel-35 mmorel-35 requested a review from a team as a code owner January 30, 2023 22:14
@@ -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)
Copy link
Member

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.

Copy link
Contributor Author

@mmorel-35 mmorel-35 Jan 30, 2023

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 or r.Context instead (contextcheck)

Copy link
Member

Choose a reason for hiding this comment

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

I see the problem:

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
Copy link

codecov bot commented Jan 30, 2023

Codecov Report

Base: 97.12% // Head: 97.09% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (29fc6d0) compared to base (74d6a12).
Patch coverage: 100.00% of modified lines in pull request are covered.

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     
Flag Coverage Δ
unittests 97.09% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/collector/app/zipkin/http_handler.go 97.58% <100.00%> (ø)
model/converter/thrift/zipkin/deserialize.go 100.00% <100.00%> (ø)
plugin/storage/kafka/unmarshaller.go 100.00% <100.00%> (ø)
plugin/storage/badger/spanstore/reader.go 95.49% <0.00%> (-0.72%) ⬇️
plugin/storage/integration/integration.go 75.95% <0.00%> (-0.39%) ⬇️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yurishkuro yurishkuro merged commit 0ab8f2f into jaegertracing:main Jan 30, 2023
@mmorel-35 mmorel-35 deleted the golangci-lint/v1.50.1 branch February 1, 2023 18:04
shubbham1215 pushed a commit to shubbham1215/jaeger that referenced this pull request Feb 22, 2023
## 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>
shubbham1215 pushed a commit to shubbham1215/jaeger that referenced this pull request Mar 5, 2023
## 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>
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.

2 participants