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

Updated go version to fix 3 CVEs #559

Merged
merged 8 commits into from
Mar 12, 2024
Merged

Conversation

dianadevasia
Copy link
Contributor

@dianadevasia dianadevasia commented Mar 11, 2024

Resolves issue

Will create a release after this PR is merged

References for updating golangci version and depguard changes:
go-critic/go-critic#1359
golangci/golangci-lint#3877
atc0005/go-ci#1024

@dianadevasia dianadevasia force-pushed the update-go-minor-version branch from d177571 to 9de4395 Compare March 11, 2024 23:48
@dianadevasia dianadevasia force-pushed the update-go-minor-version branch from 26ba3e4 to b7eaa2c Compare March 12, 2024 14:30
@@ -23,7 +23,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc
with:
version: v1.52.2
version: v1.56.2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the golangci-lint needed to be updated as depguard import rule was enabled and fails without a configuration file - atc0005/go-ci#1024

@@ -21,7 +21,7 @@ func (t *LatencyToxic) delay() time.Duration {
delay := t.Latency
jitter := t.Jitter
if jitter > 0 {
//#nosec
// #nosec G404 -- was ignored before too
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding the comment in the standard way as mentioned in the documentation.

if t.SizeVariation > 0 {
mid += rand.Intn(t.SizeVariation*2) - t.SizeVariation
mid += rand.Intn(t.SizeVariation*2) - t.SizeVariation // #nosec G404 -- was ignored before too
Copy link
Contributor Author

Choose a reason for hiding this comment

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

golangci-lint was failing so had to add the comment on the same line

@@ -81,8 +81,8 @@ func NewToxicStub(input <-chan *stream.StreamChunk, output chan<- *stream.Stream
func (s *ToxicStub) Run(toxic *ToxicWrapper) {
s.running = make(chan struct{})
defer close(s.running)
//#nosec
if rand.Float32() < toxic.Toxicity {
randomToxicity := rand.Float32() // #nosec G404 -- was ignored before too
Copy link
Contributor Author

Choose a reason for hiding this comment

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

golangci-lint was failing so had to add the comment on the same line

@dianadevasia dianadevasia self-assigned this Mar 12, 2024
@dianadevasia dianadevasia requested a review from a team March 12, 2024 14:41
Copy link
Member

@abecevello abecevello left a comment

Choose a reason for hiding this comment

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

Changes look good. I notice the .golangci.yml file appears to be referencing an older version of go. It might be good to update that as well so everything is consistent.

Also don't forget to update the changelog.

@dianadevasia dianadevasia force-pushed the update-go-minor-version branch from e19a764 to 6ea89cc Compare March 12, 2024 17:31
@dianadevasia dianadevasia force-pushed the update-go-minor-version branch from 6ea89cc to 54f1c83 Compare March 12, 2024 17:48
@dianadevasia dianadevasia merged commit c2fedde into main Mar 12, 2024
6 checks passed
@dianadevasia dianadevasia deleted the update-go-minor-version branch March 12, 2024 18:20
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