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

Bump Go to 1.23.2 #6718

Merged
merged 4 commits into from
Nov 8, 2024
Merged

Bump Go to 1.23.2 #6718

merged 4 commits into from
Nov 8, 2024

Conversation

tsaarni
Copy link
Member

@tsaarni tsaarni commented Oct 19, 2024

This pull request includes following changes

@tsaarni tsaarni requested a review from a team as a code owner October 19, 2024 09:32
@tsaarni tsaarni requested review from skriss and sunjayBhatia and removed request for a team October 19, 2024 09:32
@sunjayBhatia sunjayBhatia requested review from a team, izturn and clayton-gonsalves and removed request for a team October 19, 2024 09:32
@tsaarni tsaarni added the release-note/small A small change that needs one line of explanation in the release notes. label Oct 19, 2024
@tsaarni tsaarni marked this pull request as draft October 19, 2024 10:10
@tsaarni
Copy link
Member Author

tsaarni commented Oct 19, 2024

Marking as draft for now. There are gosec "G115: integer overflow conversion" errors, as well as some other lint errors that should be easier to fix.

Signed-off-by: Tero Saarni <[email protected]>
Signed-off-by: Tero Saarni <[email protected]>
@tsaarni tsaarni marked this pull request as ready for review November 4, 2024 14:59
@sunjayBhatia sunjayBhatia requested a review from a team November 4, 2024 14:59
@tsaarni
Copy link
Member Author

tsaarni commented Nov 4, 2024

I've fixed the simpler issues, but the remaining errors are gosec G115 integer overflow warnings. See details here.

In some respect, the errors seem valid and could be viewed as bugs. Some come from inconsistencies between CRD API types and Envoy API types. Changing the API types now could break backward compatibility. While it could be theoretically possible to add bounds checks and consider how to propagate errors to handle these edge cases, I’m unsure if it is practical.

There is also at least one interesting case where fixing the issue would require avoiding "range", since range index is int:

for index  := range values {
    // then process int index in uint32 context
    // will cause error: G115: integer overflow conversion int -> uint32
}

Gosec seems only accept this if adding check for both index > math.MaxUint32 and index < 0 on every iteration, even though I don't think range could generate negative index.

I have some doubts there are meaningful ways to escalate thee errors so one option is to keep the G115 on, but disable it for each remaining error with //nolint:gosec // disable G115.

What do you think?

@izturn
Copy link
Member

izturn commented Nov 5, 2024

in our product, we use the same way:

I have some doubts there are meaningful ways to escalate thee errors so one option is to keep the G115 on, but disable it for each remaining error with //nolint:gosec // disable G115.

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 84.44444% with 7 lines in your changes missing coverage. Please review.

Project coverage is 81.03%. Comparing base (0be3efa) to head (dbc69de).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/annotation/annotations.go 0.00% 2 Missing and 1 partial ⚠️
internal/featuretests/v3/featuretests.go 0.00% 2 Missing ⚠️
cmd/contour/contour.go 0.00% 1 Missing ⚠️
internal/dag/gatewayapi_processor.go 87.50% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6718      +/-   ##
==========================================
- Coverage   81.04%   81.03%   -0.02%     
==========================================
  Files         133      133              
  Lines       20001    20006       +5     
==========================================
+ Hits        16210    16212       +2     
- Misses       3498     3500       +2     
- Partials      293      294       +1     
Files with missing lines Coverage Δ
internal/dag/dag.go 98.78% <ø> (ø)
internal/dag/httpproxy_processor.go 90.97% <100.00%> (ø)
internal/dag/policy.go 95.68% <100.00%> (+<0.01%) ⬆️
internal/envoy/v3/endpoint.go 100.00% <100.00%> (ø)
internal/envoy/v3/listener.go 98.49% <100.00%> (+<0.01%) ⬆️
internal/envoy/v3/ratelimit.go 100.00% <100.00%> (ø)
internal/envoy/v3/route.go 80.67% <100.00%> (ø)
internal/featuretests/v3/envoy.go 99.13% <100.00%> (ø)
internal/gatewayapi/helpers.go 88.02% <100.00%> (ø)
internal/provisioner/model/model.go 100.00% <100.00%> (ø)
... and 9 more

@tsaarni
Copy link
Member Author

tsaarni commented Nov 7, 2024

Thanks @izturn. I took this approach, except for couple of places, where I could fix the errors with small effort.

Copy link
Member

@izturn izturn left a comment

Choose a reason for hiding this comment

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

/lgtm

@tsaarni tsaarni merged commit 2659222 into projectcontour:main Nov 8, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/small A small change that needs one line of explanation in the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants