ROX-35006: Update Go 1.26#20750
Conversation
87f1fa0 to
58db776
Compare
fc2686e to
1ec1982
Compare
|
/retest |
e15aafa to
1504624
Compare
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Documents the complete process for upgrading Go versions in the StackRox project, including: - Files to update (go.mod, workflows, tool modules) - Expected test failures and how to fix them - CI infrastructure considerations (setup-go action, cache invalidation) - Konflux builder requirements - Common issues and solutions This guide captures lessons learned from the Go 1.26.2 upgrade, particularly the need for setup-go action when container has older Go version and the Konflux go-builder dependency. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Refactored the guide to be general documentation about Go upgrades rather than specific to 1.26.2: - Removed hardcoded version numbers, replaced with placeholders - Organized around principles and patterns rather than specific steps - Added comprehensive sections on: - Understanding test failure categories - CI infrastructure challenges and solutions - External build system dependencies - Best practices and security considerations - Expanded troubleshooting with root cause explanations - Made it clear what's StackRox-specific vs general Go concepts The guide now serves as evergreen documentation that applies to any future Go upgrade, with lessons learned from past upgrades informing the approach. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Go 1.26.2 changed the URL parser to validate port syntax before checking URL escapes. Updated error message expectation to match new behavior. Fixes WebSocket test failures in: - TestAuthenticatedHTTPTransport_WebSocket/invalid_wss - TestAuthenticatedHTTPTransport_WebSocket/invalid_ws Partially AI-generated
Go 1.26.3 is the latest patch release with the compiler and security fixes we need. The brew builder image (buildID 4026077) ships Go 1.26.3. Partially generated by AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Align all tools/*/go.mod with the main module Go version. Partially generated by AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update openshift-golang-builder from rhel_9_golang_1.25 to rhel_9_golang_1.26 (brew buildID 4026077, Go 1.26.3). Partially generated by AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Align all operator/tools/*/go.mod with the target Go version. Partially generated by AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Was at go 1.24 with a stale toolchain directive. Partially generated by AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The guide duplicates information that belongs in commit messages and PR descriptions rather than a standalone document. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Five Konflux Dockerfiles still referenced rhel_9_golang_1.25. Updated to rhel_9_golang_1.26 (brew buildID 4026077) to match the builder already used in .konflux/ and .tekton/. Partially generated by AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enable the modernize linter (previously disabled with TODO ROX-35007) and add newexpr to the disabled checks list alongside existing ones. Partially generated by AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Go 1.26 url.Parse rejects unbracketed IPv6 addresses. Instead of working around this, accept the stricter validation and require bracketed format (e.g. [2001:db8::1]:443). No real Docker registry endpoint uses unbracketed IPv6. Partially generated by AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Tomasz Janiszewski <janiszt@gmail.com>
acd2588 to
4beb9b6
Compare
|
/retest |
|
/konflux-retest operator-bundle-on-push |
|
/retest |
|
/konflux-retest operator-index-on-push |
|
/konflux-retest operator-bundle-on-push |
1 similar comment
|
/konflux-retest operator-bundle-on-push |
|
/konflux-retest operator-index-on-push |

Upgrade Go from 1.25.8 to 1.26.3 across the entire codebase, including all tool modules, operator tool modules, Konflux/Tekton builder images, and scanner/hack/quay.
Changes
Version bumps
Fixes required for Go 1.26 compatibility
pkg/clientconn/client_test.go): Go 1.26 validates port syntax before checking URL escapes, changing the error priority. Updated test expectation from"invalid URL escape"to"invalid port after host".pkg/tlscheck/tlscheck.go): Go 1.26'surl.Parse()now requires IPv6 addresses to be bracketed per RFC 2732. StackRox accepts unbracketed IPv6 including ambiguousIPv6:portformats. Fixed by routing IPv6 addresses throughnetutil.ParseEndpoint()instead ofurl.Parse(), and adding explicit whitespace validation.pkg/env/integersetting.go): Changed%qto%vfor[]int—%qis for strings and Go 1.26's stricter govet catches the mismatch. (pkg/grpc/testutils.go): Added...when forwarding variadic arguments to prevent treating a slice as a single argument.central/processindicator/datastore/datastore_impl_test.go): IncreasedWaitWithTimeoutfrom3*prunePeriod(300ms) to5*prunePeriod(500ms) on the prune path that includes a DB delete — the slowest path that's sensitive to Go 1.26's scheduling changes.