telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

Linter: gosec, Rule: G602 - Slice access out of bounds. Should we enable it?

Open zak-pawel opened this issue 1 year ago • 3 comments

Use Case

This issue starts discussion about enabling:

Added here: https://github.com/securego/gosec/pull/973

Expected behavior

Decision if rule should be enabled or not.

Actual behavior

For this rule no findings were found in current code.

Additional info

For this rule no additional configuration can be provided.

zak-pawel avatar Jan 29 '24 11:01 zak-pawel

Hi,

I have very mixed feelings about enabling even more linters :) Yes, I absolutely want to do this.

However, we need to put a pause on this until we can consistently get the linter jobs to run. It is not fair to our contributors or ourselves, to constantly have flaky tests that are failing due to resource issues because the linters are currently so heavy.

Even last night the windows linter test failed due to memory issues, even with GOGC=1 set. It was not a timeout on golangci-lint is 30mins and the CircleCI no output timeout is 30mins.

Rather than enabling more and more linters, I would appreciate some time put into figuring out how we can ensure these jobs pass consistently.

powersj avatar Jan 29 '24 13:01 powersj

Seconding the comment of @powersj, I absolutely would want this linter enabled but having nightly OOM'ing often is not a good thing...

srebhan avatar Feb 08 '24 15:02 srebhan

@srebhan I've reviewed the jobs from the past week, and I have a feeling that after this PR: https://github.com/influxdata/telegraf/pull/14639, all linter jobs (which used the code introduced by the mentioned PR) had no issues with OOM or timing out. If they failed, it was because they encountered a problem in the code ;)

zak-pawel avatar Feb 08 '24 15:02 zak-pawel