ROX-35006: Update Go 1.26 by janisz · Pull Request #20750 · stackrox/stackrox · GitHub
Skip to content

ROX-35006: Update Go 1.26#20750

Merged
janisz merged 23 commits into
masterfrom
wip_bump_to_go_1.26
Jun 16, 2026
Merged

ROX-35006: Update Go 1.26#20750
janisz merged 23 commits into
masterfrom
wip_bump_to_go_1.26

Conversation

@janisz

@janisz janisz commented May 21, 2026

Copy link
Copy Markdown
Contributor

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

  • go.mod: 1.25.8 → 1.26.3
  • All tools//go.mod and operator/tools//go.mod: aligned to 1.26.3
  • scanner/hack/quay/go.mod: 1.24 → 1.26.3 (removed stale toolchain go1.23.2)
  • Konflux builder image: openshift-golang-builder:rhel_9_golang_1.25 → rhel_9_golang_1.26 (brew buildID 4026077)
  • .golangci.yml: Go version 1.25 → 1.26

Fixes required for Go 1.26 compatibility

  • URL parser behavioral change (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".
  • IPv6 validation strictness (pkg/tlscheck/tlscheck.go): Go 1.26's url.Parse() now requires IPv6 addresses to be bracketed per RFC 2732. StackRox accepts unbracketed IPv6 including ambiguous IPv6:port formats. Fixed by routing IPv6 addresses through netutil.ParseEndpoint() instead of url.Parse(), and adding explicit whitespace validation.
  • govet printf format checks (pkg/env/integersetting.go): Changed %q to %v for []int%q is 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.
  • Goroutine scheduling timing (central/processindicator/datastore/datastore_impl_test.go): Increased WaitWithTimeout from 3*prunePeriod (300ms) to 5*prunePeriod (500ms) on the prune path that includes a DB delete — the slowest path that's sensitive to Go 1.26's scheduling changes.
  • Linter configuration: Disabled the modernize linter (TODO ROX-35007) as it suggests Go 1.26 idioms across ~373 instances — deferred to a follow-up PR.

@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

@janisz janisz force-pushed the wip_bump_to_go_1.26 branch 2 times, most recently from fc2686e to 1ec1982 Compare May 26, 2026 14:44
@janisz

janisz commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@janisz janisz changed the title WIP: Go 1.26 ROX-34147: Update Go 1.26 May 29, 2026
@janisz janisz closed this May 29, 2026
@janisz janisz reopened this Jun 10, 2026
@janisz janisz force-pushed the wip_bump_to_go_1.26 branch from e15aafa to 1504624 Compare June 10, 2026 10:17
@janisz janisz requested review from a team and rhacs-bot as code owners June 10, 2026 10:17
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 85b79307-ea51-4463-8f4c-95563f062867

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wip_bump_to_go_1.26

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added area/operator konflux-build Run Konflux in PR. Push commit to trigger it. labels Jun 10, 2026
@janisz janisz changed the title ROX-34147: Update Go 1.26 ROX-35006: Update Go 1.26 Jun 10, 2026
@janisz janisz added the auto-retest PRs with this label will be automatically retested if prow checks fails label Jun 10, 2026
janisz and others added 16 commits June 11, 2026 17:14
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>
@janisz janisz force-pushed the wip_bump_to_go_1.26 branch from acd2588 to 4beb9b6 Compare June 11, 2026 15:14
@rhacs-bot

Copy link
Copy Markdown
Contributor

/retest

@github-actions

Copy link
Copy Markdown
Contributor

/konflux-retest operator-bundle-on-push

@rhacs-bot

Copy link
Copy Markdown
Contributor

/retest

@github-actions

Copy link
Copy Markdown
Contributor

/konflux-retest operator-index-on-push

@janisz

janisz commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

/konflux-retest operator-bundle-on-push

1 similar comment
@janisz

janisz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/konflux-retest operator-bundle-on-push

@janisz

janisz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/konflux-retest operator-index-on-push

@janisz

janisz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@janisz janisz merged commit ca6005f into master Jun 16, 2026
122 of 123 checks passed
@janisz janisz deleted the wip_bump_to_go_1.26 branch June 16, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review area/central area/ci area/helm area/operator area/scanner auto-retest PRs with this label will be automatically retested if prow checks fails coderabbit-review konflux-build Run Konflux in PR. Push commit to trigger it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants