Skip to content

Fix: Update go mod tidy compatibility from 1.21 to 1.25#370

Merged
cooktheryan merged 2 commits intomainfrom
fix/update-go-compat-version
Jan 13, 2026
Merged

Fix: Update go mod tidy compatibility from 1.21 to 1.25#370
cooktheryan merged 2 commits intomainfrom
fix/update-go-compat-version

Conversation

@cooktheryan
Copy link
Collaborator

@cooktheryan cooktheryan commented Jan 13, 2026

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:

  • Bump go mod tidy -compat flag from 1.21 to 1.25 in all GitHub Actions jobs that build Docker/Podman images to restore compatibility with updated Go dependencies.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 13, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the GitHub Actions Docker/image build workflow to run go mod tidy with Go module compatibility 1.25 instead of 1.21 across all build jobs, aligning with the selinux v1.13.0 requirement and fixing CI build failures.

File-Level Changes

Change Details Files
Increase Go modules tidy compatibility version used in CI builds from 1.21 to 1.25 to match updated dependency requirements.
  • Update go mod tidy -compat flag to 1.25 in Docker image build job.
  • Update go mod tidy -compat flag to 1.25 in amd64 Ansible build job.
  • Update go mod tidy -compat flag to 1.25 in arm64 Ansible build job.
  • Update go mod tidy -compat flag to 1.25 in amd64 systemd build job.
  • Update go mod tidy -compat flag to 1.25 in arm64 systemd build job.
  • Update go mod tidy -compat flag to 1.25 in containerized arm64 build job.
.github/workflows/docker-image.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@cooktheryan cooktheryan force-pushed the fix/update-go-compat-version branch from 7054152 to 3d1879b Compare January 13, 2026 19:19
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
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
Copy link

Choose a reason for hiding this comment

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

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
Copy link

Choose a reason for hiding this comment

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

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
Copy link

Choose a reason for hiding this comment

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

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.

cooktheryan and others added 2 commits January 13, 2026 14:40
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>
@cooktheryan cooktheryan force-pushed the fix/update-go-compat-version branch from 2c5f8ab to c2b751d Compare January 13, 2026 19:40
@cooktheryan cooktheryan merged commit 0662629 into main Jan 13, 2026
6 of 7 checks passed
@cooktheryan cooktheryan deleted the fix/update-go-compat-version branch January 13, 2026 19:40
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