Skip to content

Read the e2e Go version from go.mod and apply the safe go fix modernizers - #4677

Merged
nikola-jokic merged 6 commits into
actions:masterfrom
Okabe-Junya:Okabe-Junya/chore/go-1-27-1
Oct 2, 2026
Merged

nikola-jokic merged 6 commits into
actions:masterfrom
Okabe-Junya:Okabe-Junya/chore/go-1-27-1

Conversation

@Okabe-Junya

@Okabe-Junya Okabe-Junya commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Make the e2e workflow read the runner-side Go version from go.mod (toolchain line first, then the go line) instead of a hard-coded string
  • Apply the go fix modernizers that are mechanical and self-contained, one family per commit: range-over-int, maps.Copy / slices.Contains, strings.SplitSeq, interface{} → any, reflect.Type.Fields

@Okabe-Junya
Okabe-Junya force-pushed the Okabe-Junya/chore/go-1-27-1 branch from e60d1ef to a137f54 Compare September 22, 2026 08:08
@nikola-jokic

Copy link
Copy Markdown
Collaborator

Hey @Okabe-Junya , I'm currently bumping all dependencies, just so you know

@Okabe-Junya
Okabe-Junya force-pushed the Okabe-Junya/chore/go-1-27-1 branch 2 times, most recently from dd39794 to e499087 Compare September 22, 2026 19:17
@Okabe-Junya

Copy link
Copy Markdown
Contributor Author

@nikola-jokic

Thank you for sharing and happy to hear that!! If so, I could leave this work to you. Could you handle instead?
What I want to do in this PR are

  • Use go toolchain directive instead of go directive to manage go version
  • Execute go fix with the latest go version and applied some fixes

WDYT about these? and could you include these in your PRs? (Or I could handle these stuffs instead :) )

@Okabe-Junya
Okabe-Junya force-pushed the Okabe-Junya/chore/go-1-27-1 branch from e499087 to be89226 Compare October 1, 2026 17:02
@Okabe-Junya Okabe-Junya changed the title [WIP] bump go 1.27 and apply go fix Read the e2e Go version from go.mod and apply the safe go fix modernizers Oct 1, 2026
@Okabe-Junya
Okabe-Junya marked this pull request as ready for review October 1, 2026 17:10
Copilot AI balanced review requested due to automatic review settings October 1, 2026 17:10
@Okabe-Junya

Copy link
Copy Markdown
Contributor Author

Hi Nikola, thank you for all your work to release 0.15.0!!
As you mentioned, Go version in master is already 1.27.x, so I dropped go version bump and just keep some minor improvements (suggested by fresh go fix).

Could you have a look when you have time? Thank you!!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Kubernetes-container e2e jobs retain a hard-coded Go image version and can drift from go.mod.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates e2e Go-version selection and applies mechanical Go modernizations.

Changes:

  • Parses go.mod to configure setup-go, preferring toolchain.
  • Promotes golang.org/x/mod to a direct dependency.
  • Uses modern range, maps, slices, strings, reflection, and any APIs.
File Description
testing/​runtime/​runtime.go Replaces interface{} with any.
testing/​kubectl.go Uses strings.SplitSeq.
test/​e2e/​e2e_test.go Reads the e2e setup-go version from go.mod.
logging/​transport.go Replaces interface{} with any.
logging/​logger.go Uses slices.Contains.
hash/​hash.go Modernizes generic parameters to any.
hash/​fnv.go Modernizes variadic parameters to any.
go.mod Makes golang.org/x/mod direct.
controllers/​actions.github.com/​predicates_test.go Uses reflect.Type.Fields.
controllers/​actions.github.com/​ephemeralrunnerset_controller_test.go Uses range-over-int.
charts/​gha-runner-scale-set/​tests/​template_test.go Uses maps.Copy.
charts/​gha-runner-scale-set-controller/​tests/​metrics_test.go Uses strings.SplitSeq.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/e2e/e2e_test.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The central toolchain-precedence behavior lacks focused automated coverage.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread test/e2e/e2e_test.go
Comment on lines +1321 to +1322
if f.Toolchain != nil {
return strings.TrimPrefix(f.Toolchain.Name, "go")

@nikola-jokic nikola-jokic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me!

@nikola-jokic
nikola-jokic merged commit 5aed393 into actions:master Oct 2, 2026
29 checks passed
@Okabe-Junya
Okabe-Junya deleted the Okabe-Junya/chore/go-1-27-1 branch October 2, 2026 12:36
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.

4 participants