Skip to content

chore/go 124 upgrade #1951

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 8 commits into from
May 20, 2025
Merged

chore/go 124 upgrade #1951

merged 8 commits into from
May 20, 2025

Conversation

motatoes
Copy link
Contributor

@motatoes motatoes commented May 19, 2025

  • update go version
  • update go versions

Summary by CodeRabbit

  • Chores
    • Updated the Go version requirement to 1.24.0 across multiple components, workflows, and Docker build environments for improved compatibility and support.
    • Simplified error formatting and logging calls for clearer internal error handling without affecting user-facing behavior.

Copy link
Contributor

coderabbitai bot commented May 19, 2025

Walkthrough

The Go version specified in multiple go.mod files across various project directories was updated to Go 1.24.0. Additionally, all GitHub Actions workflows that set up Go environments were updated to use Go 1.24.0. The base images in Dockerfiles for builder stages were also updated to use Go 1.24.0. In cli/pkg/digger/digger.go, cli/pkg/drift/slack.go, and libs/locking/locking.go, error formatting calls were changed to use fmt.Errorf("%s", msg) instead of fmt.Errorf(msg). In cli/cmd/digger/default.go and ee/cli/cmd/digger/default.go, logging calls were simplified by removing unnecessary fmt.Sprintf. No other modifications were made to dependencies, module requirements, or public entity declarations.

Changes

Files/Paths Change Summary
backend/go.mod, cli/go.mod, libs/go.mod Updated Go version from 1.21.6 to 1.24.0
cli_e2e/go.mod, ee/drift/dbgen/go.mod Updated Go version from 1.22.0 to 1.24.0
dgctl/go.mod, ee/backend/go.mod, ee/cli/go.mod, ee/drift/go.mod, next/dbgen/go.mod, next/go.mod, go.mod Updated Go version from 1.22.4 to 1.24.0
ee/cli/go.mod, ee/drift/go.mod Updated Go version from 1.22.4 to 1.24.0
.github/workflows/backend_release.yml, backend_test.yml, cli_release.yml, cli_release_multiarch.yml, cli_test.yml, cli_test_e2e.yml, dgctl_release.yml, ee_backend_test.yml, ee_cli_release.yml, ee_cli_release_multiarch.yml, ee_cli_test.yml, libs_test.yml, next_test.yml, tasks_run_test.yml Updated Go version in GitHub Actions workflows from 1.21.1 or 1.22.0 to 1.24.0; removed gotestfmt usage in test steps
Dockerfile_backend, Dockerfile_backend_ee, Dockerfile_drift, Dockerfile_next Updated builder stage base image from Go 1.22 or 1.22.4 to 1.24.0
cli/pkg/digger/digger.go Changed error formatting from fmt.Errorf(msg) to fmt.Errorf("%s", msg)
cli/pkg/drift/slack.go Changed error formatting from fmt.Errorf(msg) to fmt.Errorf("%s", msg)
libs/locking/locking.go Changed error formatting from fmt.Errorf(msg) to fmt.Errorf("%s", msg) in two error returns
cli/cmd/digger/default.go, ee/cli/cmd/digger/default.go Simplified logging calls by removing unnecessary fmt.Sprintf around string concatenation

Poem

Hopping through the fields of code,
Go 1.24 is now bestowed!
Each module shines, fresh and bright,
With modern tools for every byte.
The garden grows, the future’s near—
A rabbit’s cheer for updates here!
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between efdcbb4 and b28fc31.

📒 Files selected for processing (3)
  • ee/cli/cmd/digger/default.go (1 hunks)
  • libs/execution/execution.go (1 hunks)
  • libs/locking/locking.go (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • ee/cli/cmd/digger/default.go
  • libs/locking/locking.go
  • libs/execution/execution.go
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Build
  • GitHub Check: Build
  • GitHub Check: Build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch chore/go-124-upgrade
  • Post Copyable Unit Tests in Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR updates the Go version from 1.22.4/1.21.6 to 1.24.0 across all go.mod files in the repository. This is a significant version upgrade that requires careful consideration.

  • Go 1.24.0 is a very recent release (February 2024) and some dependencies may not be fully tested with it yet
  • The upgrade skips Go 1.23 (not a public release) and jumps directly to 1.24.0
  • Several modules have older indirect dependencies (e.g. golang.org/x/sys v0.7.0) that should be updated for Go 1.24.0 compatibility
  • Consider adding compatibility tests and validation steps since this affects multiple modules

13 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
.github/workflows/libs_test.yml (1)

63-65: Simplify redundant conditional and remove trailing spaces
Both branches of the if statement execute the exact same go test ./... command, and lines 63 & 65 contain trailing spaces (YAML lint errors). To improve readability and eliminate duplication, replace the entire if block with a single invocation:

 run: |
-  if [ "${{ steps.pr_check.outputs.is_external }}" = "true" ]; then
-    go test ./...
-  else
-    go test ./...
-  fi
+  go test ./...
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 63-63: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bae9170 and addbabb.

📒 Files selected for processing (4)
  • .github/workflows/backend_test.yml (2 hunks)
  • .github/workflows/cli_test.yml (2 hunks)
  • .github/workflows/libs_test.yml (2 hunks)
  • cli/pkg/digger/digger.go (16 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/backend_test.yml
  • .github/workflows/cli_test.yml
🧰 Additional context used
🪛 golangci-lint (1.64.8)
cli/pkg/digger/digger.go

385-385: Error return value of prService.SetStatus is not checked

(errcheck)

🪛 YAMLlint (1.37.1)
.github/workflows/libs_test.yml

[error] 63-63: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build
  • GitHub Check: Build
🔇 Additional comments (2)
.github/workflows/libs_test.yml (1)

29-29: Bump Go version to 1.24.0
Updating go-version to 1.24.0 aligns this workflow with the project-wide Go upgrade.

cli/pkg/digger/digger.go (1)

282-282: Clean upgrade to safer error formatting

The changes to fmt.Errorf(msg)fmt.Errorf("%s", msg) improve security by ensuring that any format specifiers within error messages are treated as literal text rather than formatting directives. This prevents potential format string vulnerabilities when error messages contain user input.

This change is consistent with best practices for Go 1.24 and provides more predictable error message handling.

Also applies to: 292-292, 295-295, 303-303, 332-332, 346-346, 367-367, 373-373, 380-380, 387-387, 398-398, 405-405, 417-417, 434-434, 437-437, 442-442, 478-478, 495-495, 500-500, 663-663, 674-674, 683-683, 704-704, 745-745, 757-757

Comment on lines 384 to 386
comment := reportApplyMergeabilityError(reporter)
prService.SetStatus(*job.PullRequestNumber, "failure", job.ProjectName+"/apply")

Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Missing error check when setting status

The return value from prService.SetStatus() is being ignored here, unlike other similar calls in the file which do check for errors.

Consider adding error handling similar to other status calls in the file:

-			prService.SetStatus(*job.PullRequestNumber, "failure", job.ProjectName+"/apply")
+			err := prService.SetStatus(*job.PullRequestNumber, "failure", job.ProjectName+"/apply")
+			if err != nil {
+				slog.Error("Failed to set PR status", "error", err)
+			}

🏁 Script executed:

#!/bin/bash
# Check how error handling is done for SetStatus calls elsewhere in the file
rg -A 3 "prService.SetStatus" | grep -A 2 "err :="

Length of output: 1480


Ensure PR status errors are handled

In cli/pkg/digger/digger.go around lines 384–386, the call to set a failure status on apply ignores any error, whereas all other prService.SetStatus calls in this file check and handle errors. Please update this block to match the existing pattern. For example:

-   comment := reportApplyMergeabilityError(reporter)
-   prService.SetStatus(*job.PullRequestNumber, "failure", job.ProjectName+"/apply")
+   comment := reportApplyMergeabilityError(reporter)
+   if err := prService.SetStatus(*job.PullRequestNumber, "failure", job.ProjectName+"/apply"); err != nil {
+       slog.Error("Failed to set PR status", "error", err)
+   }

This keeps status updates consistent and surfaces any failures when setting the PR status.

📝 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.

Suggested change
comment := reportApplyMergeabilityError(reporter)
prService.SetStatus(*job.PullRequestNumber, "failure", job.ProjectName+"/apply")
comment := reportApplyMergeabilityError(reporter)
if err := prService.SetStatus(*job.PullRequestNumber, "failure", job.ProjectName+"/apply"); err != nil {
slog.Error("Failed to set PR status", "error", err)
}
🧰 Tools
🪛 golangci-lint (1.64.8)

385-385: Error return value of prService.SetStatus is not checked

(errcheck)

🤖 Prompt for AI Agents
In cli/pkg/digger/digger.go around lines 384 to 386, the call to
prService.SetStatus does not check for or handle any returned error, unlike
other similar calls in the file. Modify this code to capture the error returned
by SetStatus, check if it is non-nil, and handle it appropriately (e.g., logging
or returning the error) following the existing error handling pattern used
elsewhere in the file for SetStatus calls.

@motatoes motatoes merged commit 20cefd9 into develop May 20, 2025
12 checks passed
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.

1 participant