-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/upgrade #22
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
Feat/upgrade #22
Conversation
Summary of ChangesHello @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 Highlights
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this 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/funktogithub.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 subsequentCommandResult{Success: err == nil, ...}logic unreachable and prevents returning the error response to the client. Handleerrnormally (populateresult.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.
There was a problem hiding this 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.