-
Notifications
You must be signed in to change notification settings - Fork 10
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
Migrate to Go 1.24 and new tools #490
Conversation
WalkthroughThe pull request updates multiple CI workflows, Dockerfiles, and developer scripts to streamline the build and tooling processes. Changes include the removal of certain installation steps in GitHub Actions workflows, updating the Go version from 1.23 to 1.24 in Dockerfiles and the go.mod file, and modifying various command invocations to use the Go toolchain (prefixed with Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Migrate as Migration Script (dev/gen-migration)
participant Protos as Protobuf Script (dev/gen-protos)
participant CodeGen as Code Generation Script (dev/generate)
participant Linter as Lint Script (dev/lint-golines)
participant GoTool as Go Toolchain
Dev->>Migrate: Run migration creation
Migrate->>GoTool: Execute "go tool migrate create ..."
GoTool-->>Migrate: Migration files generated
Dev->>Protos: Run proto generation
Protos->>GoTool: Execute "go tool buf generate"
GoTool-->>Protos: Protobuf code generated
Dev->>CodeGen: Run code generation
CodeGen->>GoTool: Execute "go tool sqlc generate"
GoTool-->>CodeGen: SQL code generated
CodeGen->>GoTool: Execute "go tool mockery"
GoTool-->>CodeGen: Mocks generated
Dev->>Linter: Run code formatting
Linter->>GoTool: Execute "go tool golines -w ..."
GoTool-->>Linter: Code formatted
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
go.mod (1)
429-436
: Introduce Dedicated Tool Section
A newtool
block has been added listing tool dependencies such as Buf, abigen, migrate, golines, sqlc, and mockery. This is a good practice for managing tool versions reproducibly; however, make sure that these tools are not redundantly listed in the require section to avoid potential conflicts.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
go.sum
is excluded by!**/*.sum
📒 Files selected for processing (14)
.github/workflows/lint-go.yml
(0 hunks).github/workflows/nightly.yml
(0 hunks)dev/baked/Dockerfile
(1 hunks)dev/docker/Dockerfile
(1 hunks)dev/docker/Dockerfile-cli
(1 hunks)dev/gen-migration
(1 hunks)dev/gen-protos
(1 hunks)dev/generate
(1 hunks)dev/lint-golines
(1 hunks)dev/up
(0 hunks)dev/update-tools
(0 hunks)go.mod
(12 hunks)pkg/mocks/metadata_api/mock_MetadataApiClient.go
(1 hunks)tools.go
(0 hunks)
💤 Files with no reviewable changes (5)
- tools.go
- .github/workflows/lint-go.yml
- dev/up
- .github/workflows/nightly.yml
- dev/update-tools
✅ Files skipped from review due to trivial changes (2)
- pkg/mocks/metadata_api/mock_MetadataApiClient.go
- dev/lint-golines
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd)
- GitHub Check: Test (Node)
- GitHub Check: Lint-Go
🔇 Additional comments (12)
dev/gen-migration (1)
4-4
: LGTM! Command updated to use Go toolchain.The change to use
go tool migrate create
aligns with the PR objectives of migrating to new tools. The functionality remains unchanged as all parameters are preserved.dev/generate (1)
6-6
: LGTM! Commands updated to use Go toolchain.The changes to use
go tool sqlc generate
andgo tool mockery
align with the PR objectives of migrating to new tools. The functionality remains unchanged.Also applies to: 10-10
dev/gen-protos (1)
4-4
: LGTM! Command updated to use Go toolchain.The change to use
go tool buf generate
aligns with the PR objectives of migrating to new tools. The functionality remains unchanged, and proper error handling is maintained.dev/docker/Dockerfile-cli (1)
2-2
:✅ Verification successful
Verify Go 1.24 compatibility.
The Go version update aligns with the PR objectives. Let's verify the compatibility and latest version.
🌐 Web query:
What is the latest version of Go and when was Go 1.24 released?
💡 Result:
The latest version of Go is 1.24, which was officially released on February 11, 2025[2][5][9]. This release includes significant updates such as full support for generic type aliases[2][5], performance improvements with a new
map
implementation[2], enhanced WebAssembly support[5], and tools for FIPS 140-3 compliance[5].Key highlights of Go 1.24:
- Language changes: Generic type aliases allow parameterized type definitions[2][5].
- Toolchain improvements: New
go get -tool
command for managing tool dependencies[2].- Runtime optimizations: Reduced CPU overhead by ~2–3% through memory allocation and mutex enhancements[2][5].
- Security: Added FIPS 140-3 compliant cryptographic modules[5].
For context, prior versions like Go 1.23.6 (released February 4, 2025) included security fixes for
crypto/elliptic
[1], while Go 1.25 is still in development and slated for August 2025[4].Citations:
- 1: https://go.dev/doc/devel/release
- 2: https://go.dev/blog/go1.24
- 3: https://dev.to/leapcell/go-124-released-massive-optimizations-key-upgrades-1mbn
- 4: https://tip.golang.org/doc/go1.25
- 5: https://tip.golang.org/doc/go1.24
- 6: https://www.bytesizego.com/go-124
- 7: https://dev.to/empiree/why-you-should-learn-go-in-2025-308l/comments
- 8: https://golangnugget.com/p/what-to-expect-from-go-1-24-part-1
- 9: https://groups.google.com/g/golang-dev/c/ronuo6q16Sc
- 10: https://bitfieldconsulting.com/posts/rust-vs-go
Verified: Go 1.24 is current and compatible.
The Dockerfile update to
ARG GO_VERSION=1.24
aligns with the PR’s objectives. Based on the latest release information, Go 1.24—released on February 11, 2025—is the current stable version with the expected performance and feature improvements. No compatibility issues were found.dev/docker/Dockerfile (1)
2-2
: Update Go Version to 1.24
TheARG GO_VERSION
change ensures the builder now uses Go 1.24. This is in line with the overall migration objective. Please verify that your code (and any associated tooling) is compatible with Go 1.24.dev/baked/Dockerfile (1)
2-2
: Update Go Version to 1.24
The Dockerfile now usesARG GO_VERSION=1.24
, harmonizing it with the rest of the project. Given that this Dockerfile relies on a Debian-based image (using Bookworm) and apt-get for package management, ensure that any tooling or scripts invoked (e.g. Foundry installation) work as expected with the newer Go version.go.mod (6)
3-3
: Update Go Language Version in Module
The module now specifiesgo 1.24
, reflecting the migration target. Confirm that no breaking language changes affect the project's codebase.
6-7
: Bump Core Dependency Versions
The versions forgithub.com/ethereum/go-ethereum
andgithub.com/golang-migrate/migrate/v4
have been incremented tov1.15.1
andv4.18.2
respectively. Although these are minor updates, please verify that any API changes (if any) do not impact the project functionality.
40-48
: Update Cloud Google Dependencies
The indirect dependencies for variouscloud.google.com/go/...
packages have been updated to newer versions. Ensure that these updates align with your integration requirements and review their release notes for any non-obvious changes.
171-171
: Bump Miscellaneous Dependency Versions
Several indirect dependencies have been updated:
•github.com/fsnotify/fsnotify
is now atv1.8.0
•github.com/google/s2a-go
is now atv0.1.8
•github.com/googleapis/enterprise-certificate-proxy
is bumped tov0.3.4
•github.com/googleapis/gax-go/v2
is updated tov2.14.1
•github.com/segmentio/golines
is now atv0.12.2
•github.com/vektra/mockery/v2
is updated tov2.51.1
Please double-check that these minor version bumps do not affect dependent code or introduce unexpected behavior.Also applies to: 198-198, 200-201, 327-327, 352-352
389-392
: Update golang.org/x Modules
Severalgolang.org/x/...
modules have been updated (e.g.,crypto
,exp
,mod
,net
,sync
,sys
,term
,text
,time
, andtools
). Verify that these updated versions are compatible with your code especially if you rely on any behavior from these modules.Also applies to: 394-399
401-402
: Update Google API Modules
The versions forgoogle.golang.org/api
andgoogle.golang.org/genproto
have been updated. Ensure these are in line with your integration with Google services and that no breaking changes have been introduced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is getting close. Feel free to re-ping me when we have the issues with the pre-baked images resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I'm missing two details:
abigen
can also be removed fromdev/up
- Probably we want to keep the tools dependencies separated from the production
go.mod
- avoids clashing, bloating production with non related deps, etc.
What about having a<root>/tools/go.mod
,<root>/tools/<tool>/go.mod
?
30dcf60
to
ee8ef2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
go.mod (1)
429-436
: Introduce tool dependencies section.
A newtool
section has been added listing explicit tool dependencies (buf, abigen, migrate, golines, sqlc, and mockery). Note that while the AI summary mentioned the removal ofgithub.com/segmentio/golines
andgithub.com/vektra/mockery/v2
as dependencies, they are still listed here. Please confirm if they are intended to be maintained as tool dependencies or removed entirely.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
go.sum
is excluded by!**/*.sum
📒 Files selected for processing (15)
.github/workflows/lint-go.yml
(0 hunks).github/workflows/nightly.yml
(0 hunks)README.md
(1 hunks)dev/baked/Dockerfile
(1 hunks)dev/docker/Dockerfile
(1 hunks)dev/docker/Dockerfile-cli
(1 hunks)dev/gen-migration
(1 hunks)dev/gen-protos
(1 hunks)dev/generate
(1 hunks)dev/lint-golines
(1 hunks)dev/up
(0 hunks)dev/update-tools
(0 hunks)go.mod
(12 hunks)pkg/mocks/metadata_api/mock_MetadataApiClient.go
(1 hunks)tools.go
(0 hunks)
💤 Files with no reviewable changes (5)
- .github/workflows/lint-go.yml
- .github/workflows/nightly.yml
- tools.go
- dev/update-tools
- dev/up
🚧 Files skipped from review as they are similar to previous changes (9)
- dev/baked/Dockerfile
- dev/gen-protos
- README.md
- pkg/mocks/metadata_api/mock_MetadataApiClient.go
- dev/lint-golines
- dev/docker/Dockerfile-cli
- dev/docker/Dockerfile
- dev/gen-migration
- dev/generate
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd-cli)
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd)
- GitHub Check: Test (Node)
- GitHub Check: Build pre-baked anvil-xmtpd
🔇 Additional comments (17)
go.mod (17)
3-3
: Update Go version to 1.24.
The module now specifies Go 1.24, which enables the latest language improvements. Please ensure that all build tools and CI configurations are compatible with Go 1.24.
6-7
: Upgrade key dependencies for Ethereum and Migration.
The versions forgithub.com/ethereum/go-ethereum
(v1.15.1) andgithub.com/golang-migrate/migrate/v4
(v4.18.2) have been updated to their latest releases. Verify that these versions work well with your existing code and infrastructure.
40-48
: Upgrade Cloud Google Dependencies.
The Cloud Google packages (e.g.cloud.google.com/go
,cloud.google.com/go/auth
, etc.) have been updated to newer versions. Please double-check that any API calls or behaviors tied to these libraries remain compatible.
109-109
: Update bufbuild dependency version.
The dependencygithub.com/bufbuild/buf
has been bumped to v1.50.0. Ensure that any related code generation or tooling integrations continue to function as expected with this version update.
171-171
: Upgrade fsnotify to v1.8.0.
The fsnotify library has been updated to v1.8.0, which should improve file system event handling. Confirm that any file-watching functionality behaves correctly after this upgrade.
198-198
: Update github.com/google/s2a-go dependency version.
The version has been updated to v0.1.8. Please verify that any API interactions with this package remain unaffected by the change.
200-200
: Upgrade enterprise-certificate-proxy dependency.
The dependencygithub.com/googleapis/enterprise-certificate-proxy
is updated to v0.3.4. It is advisable to test all certificate-related logic to ensure compatibility.
201-201
: Upgrade gax-go dependency version.
Thegithub.com/googleapis/gax-go/v2
package has been updated to v2.14.1. Verify that any client calls or configurations using this library continue to operate as expected.
327-327
: Update golines version in indirect dependencies.
Thegithub.com/segmentio/golines
dependency now appears at v0.12.2. Since the AI summary mentioned its removal, please double-check that its relocation (or continued inclusion) is intentional and does not conflict with tooling expectations.
334-334
: Upgrade sourcegraph/conc dependency.
The update togithub.com/sourcegraph/conc
(v0.3.0) should bring improvements to concurrency support. Confirm that any usage of concurrency primitives from this package is still working correctly.
335-335
: Update spf13/afero dependency version.
The afero library has been updated to v1.12.0. At this version bump, please ensure that all file manipulation and abstraction layers are tested thoroughly.
336-336
: Upgrade spf13/cast dependency.
The dependencygithub.com/spf13/cast
is now at v1.7.1. This minor upgrade should not affect functionality but it is advisable to verify type conversions and related tests.
338-338
: Update spf13/pflag dependency version.
Thegithub.com/spf13/pflag
library has been upgraded to v1.0.6. Confirm that command-line flag parsing remains robust after this update.
339-339
: Upgrade spf13/viper dependency.
The viper dependency is updated to v1.19.0. Please ensure that all configuration loading and parsing functions have been verified against the new version.
340-340
: Update sqlc dependency version.
The update togithub.com/sqlc-dev/sqlc
(v1.28.0) in the indirect dependencies should streamline code generation. It is recommended to re-run your schema-to-code generation steps and tests after this change.
343-343
: Upgrade subosito/gotenv dependency.
The GOTENV library now uses v1.6.0, which may include bug fixes and enhancements for environment variable loading. Make sure your environment configuration tests pass.
344-344
: Update supranational/blst dependency version.
Thegithub.com/supranational/blst
package has been updated to v0.3.14. Please review any cryptographic functions that depend on this library to ensure they continue to operate securely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
tools/go.mod (2)
1-3
: Module Declaration and Go Version UpdateThe module declaration and Go version update are declared correctly. However, note that the conventional format in many projects is to specify the Go version as
go 1.24
(without the patch version) unless you have a specific need for1.24.0
.Suggested diff (if you decide to standardize the version format):
- go 1.24.0 + go 1.24
5-12
: Tool Dependencies BlockThe addition of the
tool
block clearly lists all the required development tools such as Buf, Abigen, Migrate, Golines, SQLC, and Mockery. This approach improves reproducibility by explicitly declaring tool dependencies.
Consider whether you might want to pin their versions here (or in the require block) to ensure consistency across development environments.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sum
is excluded by!**/*.sum
tools/go.sum
is excluded by!**/*.sum
📒 Files selected for processing (6)
dev/gen-migration
(1 hunks)dev/gen-protos
(1 hunks)dev/generate
(1 hunks)dev/lint-golines
(1 hunks)go.mod
(2 hunks)tools/go.mod
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- dev/gen-protos
- dev/gen-migration
- dev/generate
- dev/lint-golines
- go.mod
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Test (Node)
- GitHub Check: Lint-Go
- GitHub Check: Build pre-baked anvil-xmtpd
🔇 Additional comments (1)
tools/go.mod (1)
14-382
: Extensive Dependencies in the Require BlockThe
require
block includes a comprehensive list of dependencies, each with explicit version details marked as indirect. This level of detail is beneficial for reproducible builds and clarity on which versions are used.
A couple of points to consider:
- Ensure that all listed dependencies are necessary for the
xmtpd-tools
module and not residual from older or unused imports.- If possible, review the ordering of dependencies to confirm they follow the standard lexicographical order for easier navigation, though many tools auto-generate this list.
Overall, the block looks correctly formatted and achieves the goal of pinning specific versions for robust dependency management.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
contracts/dev/generate
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: abis
- GitHub Check: Test (Node)
- GitHub Check: Build pre-baked anvil-xmtpd
@@ -37,7 +37,7 @@ function generate_bindings() { | |||
fi | |||
|
|||
# Generate Go bindings | |||
if ! abigen --abi "${build_artifact}.abi.json" \ | |||
if ! go tool --modfile=../tools/go.mod abigen --abi "${build_artifact}.abi.json" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Fix the command structure and verify the module file path.
The current command structure has two issues:
- The
--modfile
flag is incorrectly placed. It should be passed toabigen
, not togo tool
. - The module file path might be incorrect when executed from the repository root.
Apply this diff to fix the command structure:
- if ! go tool --modfile=../tools/go.mod abigen --abi "${build_artifact}.abi.json" \
+ if ! go tool abigen --modfile=tools/go.mod --abi "${build_artifact}.abi.json" \
Let's verify the module file exists at the expected location:
🏁 Script executed:
#!/bin/bash
# Description: Verify the existence and location of the go.mod file for tools
# Test 1: Check if tools/go.mod exists
if [ -f "tools/go.mod" ]; then
echo "✓ tools/go.mod exists"
# Show the module name and Go version
head -n 5 tools/go.mod
else
echo "✗ tools/go.mod not found"
# Try to find it elsewhere
find . -name "go.mod" -type f -exec sh -c 'echo "Found go.mod at: {}"; head -n 5 {}' \;
fi
Length of output: 173
Review Update: Adjust Command Structure and Validate go.mod File Location
- The command should pass the
--modfile
flag directly toabigen
(i.e. aftergo tool abigen
). - Our verification indicates that the expected module file at
tools/go.mod
was not found in the repository. Please confirm whether the path should be different or if the file needs to be added.
Apply this diff as a starting point, ensuring you update the module file path if needed:
- if ! go tool --modfile=../tools/go.mod abigen --abi "${build_artifact}.abi.json" \
+ if ! go tool abigen --modfile=tools/go.mod --abi "${build_artifact}.abi.json" \
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if ! go tool --modfile=../tools/go.mod abigen --abi "${build_artifact}.abi.json" \ | |
if ! go tool abigen --modfile=tools/go.mod --abi "${build_artifact}.abi.json" \ |
Fixes #462
I love red diffs!
Summary by CodeRabbit
Summary by CodeRabbit