[codex] Make mod-check use Go module proxy#1142
Conversation
Summary of ChangesHello, 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 improves the reliability of the module dependency check process by switching from a direct-only VCS fetch to using the public Go module proxy. This change helps mitigate transient network or cache issues encountered when fetching public transitive dependencies, while still maintaining direct access as a fallback. Highlights
New Features🧠 You can now enable Memory (public preview) 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 the 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 counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the GOPROXY configuration in the Makefile to use the official Go proxy before falling back to direct connections. A review comment suggests defining a variable for these settings to avoid repetition and improve maintainability.
| GOPROXY=https://proxy.golang.org,direct $(GOMOD) tidy | ||
| cd swapserverrpc/ && GOPROXY=https://proxy.golang.org,direct $(GOMOD) tidy | ||
| cd looprpc/ && GOPROXY=https://proxy.golang.org,direct $(GOMOD) tidy | ||
| cd tools/ && GOPROXY=https://proxy.golang.org,direct $(GOMOD) tidy |
There was a problem hiding this comment.
The GOPROXY configuration is repeated four times within the mod-check target. While this is explicit, it introduces a maintainability issue as any future changes to the proxy settings (e.g., adding a different mirror or changing the fallback behavior) would need to be updated in multiple places. Consider defining a Makefile variable for these settings to adhere to the DRY (Don't Repeat Yourself) principle.
Summary
make mod-checkto useGOPROXY=https://proxy.golang.org,directinstead of forcingGOPROXY=direct.swapserverrpc,looprpc, andtoolstidy checks.Rationale
The direct-only module fetch path can hit transient Git shallow-clone cache failures for public transitive dependencies, such as
modernc.org/ccgo/v3viagithub.com/golang-migrate/migrate/v4. Using the public Go module proxy first avoids flaky direct VCS fetches while preservingdirectas a fallback.Validation
make mod-check