Skip to content

Conversation

@doringeman
Copy link
Contributor

Fixes/split from #508.

  • Improves the script which automatically syncs Go version across repository files when Dependabot bumps go.mod.
    • Now it works for workflow files as well.
  • Some dependencies fixes.

dependabot bot and others added 4 commits December 24, 2025 00:02
… updates

Bumps the go-modules-root group with 2 updates in the / directory: [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) and [github.com/jaypipes/ghw](https://github.com/jaypipes/ghw).


Updates `github.com/containerd/containerd/v2` from 2.1.5 to 2.2.0
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](containerd/containerd@v2.1.5...v2.2.0)

Updates `github.com/containerd/platforms` from 1.0.0-rc.1 to 1.0.0-rc.2
- [Release notes](https://github.com/containerd/platforms/releases)
- [Commits](containerd/platforms@v1.0.0-rc.1...v1.0.0-rc.2)

Updates `github.com/jaypipes/ghw` from 0.19.1 to 0.21.1
- [Release notes](https://github.com/jaypipes/ghw/releases)
- [Commits](jaypipes/ghw@v0.19.1...v0.21.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-modules-root
- dependency-name: github.com/containerd/platforms
  dependency-version: 1.0.0-rc.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules-root
- dependency-name: github.com/jaypipes/ghw
  dependency-version: 0.21.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-modules-root
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Dorin Geman <dorin.geman@docker.com>
Signed-off-by: Dorin Geman <dorin.geman@docker.com>
Signed-off-by: Dorin Geman <dorin.geman@docker.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @doringeman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on maintaining the project's dependencies and build environment by updating the Go language version to 1.24.3 and refreshing numerous Go module dependencies. A significant improvement is also made to the automated script responsible for synchronizing the Go version across various project files, now extending its coverage to include GitHub Actions workflow configurations.

Highlights

  • Go Version Update: The Go version used across the repository has been updated from 1.24.0 to 1.24.3 in the Makefile, go.mod, and cmd/cli/go.mod files.
  • Dependency Updates: Several Go module dependencies have been updated to their latest versions, including containerd, containerd/platforms, jaypipes/ghw, klauspost/compress, modern-go/reflect2, and various golang.org/x packages, along with Google's gRPC and genproto libraries.
  • Improved Go Version Sync Script: The scripts/sync-go-version.sh script has been enhanced to automatically sync the Go version not only in Go module files and Dockerfiles but also in GitHub Actions workflow files, ensuring better consistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/ci.yml
    • .github/workflows/integration-test.yml
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@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 1 issue, and left some high level feedback:

  • The sync-go-version.sh workflow handling assumes simple go-version: <version> lines; if you ever use matrix or list syntax for go-version, the current grep/sed patterns will either miss them or rewrite them incorrectly, so consider making the match/update logic robust to those common patterns.
  • In sync-go-version.sh, the grep ... | head -1 | xargs pipeline in check_file will collapse internal whitespace and strip leading/trailing spaces from the matched line, which can make the reported have: line differ from the actual file content; if you care about preserving formatting in the output, drop xargs or replace it with a less aggressive trimmer.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `sync-go-version.sh` workflow handling assumes simple `go-version: <version>` lines; if you ever use `matrix` or list syntax for `go-version`, the current `grep`/`sed` patterns will either miss them or rewrite them incorrectly, so consider making the match/update logic robust to those common patterns.
- In `sync-go-version.sh`, the `grep ... | head -1 | xargs` pipeline in `check_file` will collapse internal whitespace and strip leading/trailing spaces from the matched line, which can make the reported `have:` line differ from the actual file content; if you care about preserving formatting in the output, drop `xargs` or replace it with a less aggressive trimmer.

## Individual Comments

### Comment 1
<location> `scripts/sync-go-version.sh:71` </location>
<code_context>
     if ! grep -q "$expected_pattern" "$file"; then
         local current
-        current=$(grep "$search_pattern" "$file" 2>/dev/null | head -1 || echo "(not found)")
+        current=$(grep "$search_pattern" "$file" 2>/dev/null | head -1 | xargs || echo "(not found)")
         echo "Mismatch: $(realpath "$file")"
         echo "  have: $current"
</code_context>

<issue_to_address>
**issue (bug_risk):** The new pipeline for `current` never yields "(not found)" when the pattern is missing.

Because `head` and `xargs` both exit 0 even with no input, the `|| echo "(not found)"` fallback is never triggered in this new pipeline. As a result, `current` becomes an empty string instead of "(not found)", which changes the previous behavior and can make the mismatch output ambiguous.

To keep the original semantics while still trimming whitespace, you could, for example:

```bash
current=$(grep "$search_pattern" "$file" 2>/dev/null | head -1 || echo "(not found)")
current=$(echo "$current" | xargs)
```

or:

```bash
current=$(grep "$search_pattern" "$file" 2>/dev/null | head -1)
current=${current:-"(not found)"}
current=$(echo "$current" | xargs)
```
</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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request primarily bumps the Go version and several dependencies across the repository. The included improvements to the sync-go-version.sh script, which now also handles GitHub workflow files, are a welcome addition for maintaining consistency. The changes are generally well-implemented, but I've identified a minor issue in the script's new logic that could be improved for better robustness.

Signed-off-by: Dorin Geman <dorin.geman@docker.com>
Signed-off-by: Dorin Geman <dorin.geman@docker.com>
@doringeman doringeman force-pushed the dependabot/go_modules/go-modules-root-1a8b41dca1 branch from c3278f6 to 2b9bd52 Compare December 23, 2025 22:36
@ericcurtin ericcurtin merged commit 754e0ed into main Dec 24, 2025
13 checks passed
@ericcurtin ericcurtin deleted the dependabot/go_modules/go-modules-root-1a8b41dca1 branch December 24, 2025 10:15
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