Skip to content

go.mod: use go 1.23 #1048

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

Merged
merged 11 commits into from
Jun 12, 2025
Merged

go.mod: use go 1.23 #1048

merged 11 commits into from
Jun 12, 2025

Conversation

braydonk
Copy link
Contributor

@braydonk braydonk commented Jun 3, 2025

We don't want our packages to force a Go version bump downstream. This PR changes our modules to just use go 1.23 with no patch version.

We don't want our packages to force a Go version bump upstream. This PR
changes our modules to just use `go 1.23` with no patch version.
@braydonk braydonk requested a review from a team as a code owner June 3, 2025 14:36
@braydonk
Copy link
Contributor Author

braydonk commented Jun 3, 2025

Copy link
Contributor

@psx95 psx95 left a comment

Choose a reason for hiding this comment

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

Shouldn't the CI be updated as well to match this ?

Or are we still ok to run tests explicitly against 1.23.8 ?

@braydonk
Copy link
Contributor Author

braydonk commented Jun 3, 2025

Or are we still ok to run tests explicitly against 1.23.8 ?

Yes that's fine. Our modules are just declaring a compatibility, not saying that is has to be used only with this exact version of Go.

@dashpole
Copy link
Contributor

dashpole commented Jun 3, 2025

We should run tests explicitly against a patch version to satisfy the go vuln checker

go 1.23.8
go 1.23.0

toolchain go1.24.2
Copy link
Contributor

@psx95 psx95 Jun 3, 2025

Choose a reason for hiding this comment

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

Would this mean that at least go1.24.2 is required to build and compile this project? I'm ok with this, but is this intentional ?

Edit: Saw the failing lint - was this added to address the failed lint check ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

toolchain is something that Go adds automatically now when you run go mod tidy. go1.24.2 was the local toolchain I was using. I've tried setting an env var in CI to ignore it.

@dashpole
Copy link
Contributor

@braydonk can you fix the lint so we can get this merged? This is impacting other projects, so we should get a patch release out with this soon

@braydonk
Copy link
Contributor Author

I am unsure how to fix the lint step.

@dashpole
Copy link
Contributor

Error: can't load config: the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.24.2)

You probably need to update golangci-lint here:

github.com/golangci/golangci-lint v1.63.4

@braydonk
Copy link
Contributor Author

I've solved the lint problem. I'm not sure how to handle that final e2e test failure.

@dashpole
Copy link
Contributor

From the logs, I see

Step #1 - "run-tests-gae-standard": �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mError waiting to create StandardAppVersion: Error waiting for Creating StandardAppVersion: Error code 9, message: Cloud build fe7c997b-926f-4140-868e-23630c6ede85 status: FAILURE

Following the link to the build logs, I see:

Step #2 - "build": ===> BUILDING
Step #2 - "build": target distro name/version labels not found, reading /etc/os-release file
Step #2 - "build": === Go - Appengine Gomod ([email protected]) ===
Step #2 - "build": === Go - Runtime ([email protected]) ===
Step #2 - "build": Using runtime version from GOOGLE_RUNTIME_VERSION: 1.23.8
Step #2 - "build": ***** CACHE MISS: "go"
Step #2 - "build": Installing Go v1.23.8.
Step #2 - "build": 2025/06/11 17:04:44 [DEBUG] GET https://dl.google.com/go/go1.23.8.linux-amd64.tar.gz
Step #2 - "build": === Go - Gomod ([email protected]) ===
Step #2 - "build": ***** CACHE MISS: "gopath"
Step #2 - "build": Not downloading modules because there's a `vendor` directory
Step #2 - "build": === Go - Build ([email protected]) ===
Step #2 - "build": --------------------------------------------------------------------------------
Step #2 - "build": Running "go build -o /layers/google.go.build/bin/main . (GOCACHE=/layers/google.go.build/gocache)"
Step #2 - "build": go: downloading go1.24.2 (linux/amd64)
Step #2 - "build": go: download go1.24.2 for linux/amd64: toolchain not available
Step #2 - "build": Done "go build -o /layers/google.go.build/bin/main . (GOCACHE=/lay..." (6.413085ms)
Step #2 - "build": --------------------------------------------------------------------------------
Step #2 - "build": failed to build: (error ID: 721b15b4):
Step #2 - "build": go: downloading go1.24.2 (linux/amd64)
Step #2 - "build": go: download go1.24.2 for linux/amd64: toolchain not available
Step #2 - "build": ERROR: failed to build: exit status 1

If you want to update the toolchain version, you probably need to bump this go version here, otherwise GAE won't build:

I'm surprised this doesn't also need an update, but the GAE flex is passing:

@braydonk
Copy link
Contributor Author

Since the toolchain directive is giving such immense grief, I've removed that line and added something to the Makefile to stop it from being added.

@dashpole dashpole merged commit 6658b3a into GoogleCloudPlatform:main Jun 12, 2025
27 checks passed
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (4caace7) to head (9afc788).
Report is 134 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #1048       +/-   ##
==========================================
- Coverage   61.03%       0   -61.04%     
==========================================
  Files          56       0       -56     
  Lines        5903       0     -5903     
==========================================
- Hits         3603       0     -3603     
+ Misses       2143       0     -2143     
+ Partials      157       0      -157     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants