Enforce Google Maven Mirror on CI environments#38586
Conversation
|
r: @Abacn |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
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 introduces a robust fallback mechanism for dependency resolution in the build process. By dynamically verifying connectivity to Maven Central, the build system can now automatically switch to the Google Maven Mirror if it detects throttling or blocking, preventing build failures caused by network restrictions on shared CI runners. 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 implements a fallback mechanism to the Google Maven Mirror when Maven Central is inaccessible, covering buildSrc, project repositories, and plugin management. The review feedback identifies a bug in the offline dependencies configuration where the Gradle Plugin Portal was incorrectly excluded during fallback. Additionally, the reviewer suggests simplifying the conditional repository logic to remove duplication and recommends centralizing the accessibility check logic and constants to improve maintainability across the different build scripts.
There was a problem hiding this comment.
Code Review
This pull request introduces a connectivity check for Maven Central, allowing the build to fall back to a mirror if the primary repository is inaccessible. This logic is implemented in buildSrc, the main settings.gradle.kts, and a shared Repositories utility. Reviewer feedback suggests improving the implementation by using java.net.URI to avoid deprecated URL constructors, caching the connectivity status in a system property to prevent redundant network calls, and utilizing Gradle's lifecycle logging instead of standard output.
…ng CI mirror fallback
| val useMirror = isCi && !mavenCentralMirrorUrl.isNullOrBlank() | ||
|
|
||
| if (useMirror) { | ||
| logger.lifecycle("Running in CI. Mirroring Maven Central repositories via Google Maven Mirror.") |
There was a problem hiding this comment.
This log appears multiple times. Logging here once should suffice
There was a problem hiding this comment.
Let's keep them for now. We can remove them later if the infra problem is resolved.
* Implement Maven Central mirroring in CI environments * Fix subproject buildscript classpath resolution for beam-test-gha using CI mirror fallback * Remove duplicated definition. * Discard the new settings file in buildSrc first. * Fix compilation error.
Redirection of Maven Central repository resolution to a Google Maven Mirror when running inside CI to bypass intermittent HTTP 403 Forbidden/IP throttling errors on Maven Central during build configuration.
Example error log from gradle: