Fix: Update go mod tidy compatibility from 1.21 to 1.25#370
Fix: Update go mod tidy compatibility from 1.21 to 1.25#370cooktheryan merged 2 commits intomainfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the GitHub Actions Docker/image build workflow to run File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
7054152 to
3d1879b
Compare
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/workflows/docker-image.yml:96` </location>
<code_context>
- name: Build the image
- run: go mod tidy -compat=1.21 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest
+ run: go mod tidy -compat=1.25 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest
- name: Export image
</code_context>
<issue_to_address>
**suggestion (review_instructions):** Using `-compat=1.25` may be ahead of the Go toolchain version used in your images/runners, which can cause portability or build issues if 1.25 isn’t available or the module’s `go` directive is lower.
It might be safer to align `-compat` with the actual Go version used in your Dockerfile/CI runners and the `go` directive in `go.mod`. If your toolchain or `go` directive is still on an earlier version (e.g., 1.21/1.22), setting `-compat=1.25` could introduce subtle incompatibilities or rely on a version that isn’t yet supported in all environments. Consider updating the Go toolchain and `go` directive in tandem, or keeping `-compat` at the supported version for now.
<details>
<summary>Review instructions:</summary>
**Path patterns:** `*`
**Instructions:**
Include suggestions that improve code portability or correctness, especially when specific language features are used.
</details>
</issue_to_address>
### Comment 2
<location> `.github/workflows/docker-image.yml:96` </location>
<code_context>
- name: Build the image
- run: go mod tidy -compat=1.21 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest
+ run: go mod tidy -compat=1.25 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest
- name: Export image
</code_context>
<issue_to_address>
**issue (review_instructions):** Bumping `-compat` to 1.25 in CI without confirming the actual Go toolchain and deployment targets may cause module resolution differences or failures compared to local/prod builds.
Using `go mod tidy -compat=1.25` changes how module requirements are resolved and the minimum go version recorded in `go.mod`. If your actual Go toolchain in CI (or in production) is still <1.25, this can lead to `go mod tidy` failures or subtle differences in resolved dependencies between CI and other environments.
Actionable suggestion: either (a) also bump the Go toolchain version used in this workflow to 1.25 and ensure production uses the same, or (b) keep `-compat` aligned with the lowest Go version you actively support and run in production (e.g., leave it at 1.21 if that’s still the target), so dependency resolution is consistent across environments.
<details>
<summary>Review instructions:</summary>
**Path patterns:** `*`
**Instructions:**
Identify potential bugs or risks in the code and provide a clear explanation of the issue.
</details>
</issue_to_address>
### Comment 3
<location> `.github/workflows/docker-image.yml:96` </location>
<code_context>
- name: Build the image
- run: go mod tidy -compat=1.21 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest
+ run: go mod tidy -compat=1.25 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest
- name: Export image
</code_context>
<issue_to_address>
**issue (review_instructions):** Using `go mod tidy -compat=1.25` is likely a bug, since Go 1.25 does not exist yet and will cause this workflow step to fail.
`go mod tidy`’s `-compat` flag must reference a Go version that the toolchain actually understands. As of now, Go releases only go up to 1.22, so `-compat=1.25` will cause `go mod tidy` to fail with an "unknown go version" error, breaking every job that runs this command.
Suggested fix: change `-compat=1.25` to a supported version (for example, `-compat=1.21` as before, or whatever version your `go` toolchain and `go` directive in `go.mod` actually target), and do the same for the other updated steps in this workflow.
<details>
<summary>Review instructions:</summary>
**Path patterns:** `*`
**Instructions:**
Identify and highlight potential bugs or risks in the code, such as missing syntax elements that could lead to unintended behavior.
</details>
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| - name: Build the image | ||
| run: go mod tidy -compat=1.21 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest | ||
| run: go mod tidy -compat=1.25 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest |
There was a problem hiding this comment.
suggestion (review_instructions): Using -compat=1.25 may be ahead of the Go toolchain version used in your images/runners, which can cause portability or build issues if 1.25 isn’t available or the module’s go directive is lower.
It might be safer to align -compat with the actual Go version used in your Dockerfile/CI runners and the go directive in go.mod. If your toolchain or go directive is still on an earlier version (e.g., 1.21/1.22), setting -compat=1.25 could introduce subtle incompatibilities or rely on a version that isn’t yet supported in all environments. Consider updating the Go toolchain and go directive in tandem, or keeping -compat at the supported version for now.
Review instructions:
Path patterns: *
Instructions:
Include suggestions that improve code portability or correctness, especially when specific language features are used.
|
|
||
| - name: Build the image | ||
| run: go mod tidy -compat=1.21 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest | ||
| run: go mod tidy -compat=1.25 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest |
There was a problem hiding this comment.
issue (review_instructions): Bumping -compat to 1.25 in CI without confirming the actual Go toolchain and deployment targets may cause module resolution differences or failures compared to local/prod builds.
Using go mod tidy -compat=1.25 changes how module requirements are resolved and the minimum go version recorded in go.mod. If your actual Go toolchain in CI (or in production) is still <1.25, this can lead to go mod tidy failures or subtle differences in resolved dependencies between CI and other environments.
Actionable suggestion: either (a) also bump the Go toolchain version used in this workflow to 1.25 and ensure production uses the same, or (b) keep -compat aligned with the lowest Go version you actively support and run in production (e.g., leave it at 1.21 if that’s still the target), so dependency resolution is consistent across environments.
Review instructions:
Path patterns: *
Instructions:
Identify potential bugs or risks in the code and provide a clear explanation of the issue.
|
|
||
| - name: Build the image | ||
| run: go mod tidy -compat=1.21 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest | ||
| run: go mod tidy -compat=1.25 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest |
There was a problem hiding this comment.
issue (review_instructions): Using go mod tidy -compat=1.25 is likely a bug, since Go 1.25 does not exist yet and will cause this workflow step to fail.
go mod tidy’s -compat flag must reference a Go version that the toolchain actually understands. As of now, Go releases only go up to 1.22, so -compat=1.25 will cause go mod tidy to fail with an "unknown go version" error, breaking every job that runs this command.
Suggested fix: change -compat=1.25 to a supported version (for example, -compat=1.21 as before, or whatever version your go toolchain and go directive in go.mod actually target), and do the same for the other updated steps in this workflow.
Review instructions:
Path patterns: *
Instructions:
Identify and highlight potential bugs or risks in the code, such as missing syntax elements that could lead to unintended behavior.
The selinux v1.13.0 update requires Go 1.25 as it dropped support for Go 1.23 and below. This resolves the build failures in GitHub Actions. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Ryan Cook <rcook@redhat.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Ryan Cook <rcook@redhat.com>
2c5f8ab to
c2b751d
Compare
The selinux v1.13.0 update requires Go 1.25 as it dropped support for Go 1.23 and below. This resolves the build failures in GitHub Actions.
Summary by Sourcery
CI: