Skip to content

Conversation

@kooksee
Copy link
Contributor

@kooksee kooksee commented Jan 29, 2026

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @kooksee, 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 primarily focuses on a significant upgrade of the project's underlying Go version and its core funk dependency to version 2. This upgrade involved a comprehensive refactoring to align with the new funk/v2 APIs, impacting error handling, utility functions, and import paths throughout the codebase. Additionally, a new upgrade command has been integrated into the CLI, and several other dependencies have been updated to ensure compatibility and leverage the latest features.

Highlights

  • Go Version Upgrade: The project's Go version has been upgraded from 1.24.6 to 1.25, reflecting a move to a newer language standard.
  • Major Dependency Upgrade (funk v1 to v2): The core github.com/pubgo/funk library has been upgraded from v0.x.x to v2.x.x, necessitating widespread import path changes (e.g., github.com/pubgo/funk/assert to github.com/pubgo/funk/v2/assert) and API adaptations across the codebase.
  • API Adaptations for funk/v2: Several API changes from funk/v2 have been integrated, including errors.NewFmt to errors.New, errors.Format to errors.Errorf, errors.WrapTag to errors.WrapTags, result.Must() to result.Unwrap(), and generic.Ptr to lo.ToPtr.
  • New 'upgrade' Command: A new upgrade command has been introduced to the protobuild CLI, leveraging funk/v2/cmds/upgradecmd for potential self-update capabilities.
  • Enhanced Error Handling with assert.Must: Error handling in various parts of the application, particularly within the web server routes, has been streamlined by wrapping potentially error-returning calls with assert.Must or assert.Must1, indicating a shift towards panic-on-error for unrecoverable situations.
  • CLI Command Refinements: The main CLI command's Use and Short descriptions have been updated, and the handleStdinPlugin logic has been revised to use redant.DefaultHelpFn() for terminal or empty input, removing the shutil.IsHelp() check.
  • Dependency Version Bumps: Multiple other Go dependencies, including github.com/samber/lo, golang.org/x/mod, golang.org/x/term, and various google.golang.org protobuf-related packages, have been updated to their latest versions.

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

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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the Go toolchain/dependencies and migrates the codebase to github.com/pubgo/funk/v2, while also adding repository-level code review guidance/configuration.

Changes:

  • Migrate imports/usages from github.com/pubgo/funk to github.com/pubgo/funk/v2 (assert/errors/pathutil/etc) and update related call sites.
  • Update Go module/tooling versions (go.mod/go.sum) and adjust CLI entrypoints/version wiring.
  • Add code review documentation and configuration files (Copilot/Gemini + PR template).

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
main.go Switch to funk/v2 assert + set build version via buildinfo/version.
internal/shutil/shell.go Update funk imports to v2.
internal/protoutil/gen.go Update assert import to v2.
internal/modutil/util_test.go Update pretty import to v2; change result unwrap call.
internal/modutil/util.go Update assert/pathutil to v2; change result unwrap call.
internal/depresolver/manager.go Update pathutil import to v2.
internal/depresolver/gomod.go Update pathutil import to v2.
internal/config/yaml_types.go Update errors import to v2; switch to errors.Errorf.
internal/config/loader.go Use octal literal 0o644 for file permissions.
go.mod Bump Go directive and upgrade dependencies (notably funk/v2).
go.sum Dependency checksum updates corresponding to go.mod upgrades.
docs/codereview/CODE_REVIEW_GUIDE_CN.md Add comprehensive Chinese code review guide.
cmd/webcmd/server.go Convert many call sites to assert.Must and any maps.
cmd/webcmd/cmd.go Minor import grouping change.
cmd/protobuild/yaml_types.go Update funk imports to v2; switch to errors.Errorf.
cmd/protobuild/vendor_service.go Update funk imports to v2; update error wrapping API.
cmd/protobuild/util.go Update funk imports to v2; simplify error construction.
cmd/protobuild/protoc_builder.go Update assert/log/pathutil imports to v2.
cmd/protobuild/proto_walker.go Update assert/pathutil imports to v2.
cmd/protobuild/commands.go Update pathutil/recovery imports to v2.
cmd/protobuild/cmd_init.go Update recovery import to v2.
cmd/protobuild/cmd_doctor.go Update recovery import to v2.
cmd/protobuild/cmd.go Change root CLI command signature/name; add upgrade command; update running/generic pointer usage.
cmd/formatcmd/cmd.go Update errors import to v2.
cmd/format/format.go Update assert import to v2.
.github/gemini.json Add Gemini Code Assist configuration.
.github/gemini-instructions.md Add Gemini review instruction document.
.github/copilot-instructions.md Add Copilot review instruction document.
.github/copilot-code-review.yml Add Copilot code review configuration.
.github/PULL_REQUEST_TEMPLATE.md Add PR template with review checklist and links.
Comments suppressed due to low confidence (1)

cmd/webcmd/server.go:273

  • assert.Must(err) will abort/panic when the executed command fails (err != nil), which makes the subsequent CommandResult{Success: err == nil, ...} logic unreachable and prevents returning the error response to the client. Handle err normally (populate result.Error / HTTP status) instead of asserting.
	output, err := cmd.CombinedOutput()
	assert.Must(err)
	result := CommandResult{
		Success: err == nil,
		Output:  string(output),
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@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 focuses on upgrading the github.com/pubgo/funk dependency to v2. This involves updating import paths across the codebase and adapting to API changes in the new version, such as changes in the errors, running, and result packages.

The changes are mostly straightforward and improve the code by adopting new idioms, like using any instead of interface{} and using the modern octal literal syntax (0o644). The introduction of assert.Must for error handling in cmd/webcmd/server.go is a good step towards more robust code in many places.

However, I've found one critical issue where a panic is introduced in a web handler instead of gracefully reporting an error. This should be addressed. Otherwise, the upgrade seems well-executed.

kooksee and others added 2 commits January 29, 2026 10:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kooksee kooksee merged commit c72b2e2 into main Jan 29, 2026
1 check 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.

2 participants