Prevent nested smoke builds from falling back to Maven Central - #12491
AlexeyKuznetsov-DD wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Nested build scripts can add Maven Central after the init hook. Existing Vert.x and WildFly smoke builds do this, so proxy-only jobs can still send dependency requests to Maven Central.
🤖 Datadog Autotest · Commit f70ab11 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
| buildscript.repositories.redirectMavenCentral() | ||
| repositories { | ||
| mavenLocal() | ||
| mavenRepositoryProxy?.takeIf { it.isNotBlank() }?.let { proxy -> |
There was a problem hiding this comment.
The init script explicitly adds the proxy, while redirectMavenCentral() also rewrites every subsequent mavenCentral() declaration to that same URL. Consequently, both plugin-management and project repository lists contain the proxy twice. These remain distinct Gradle repositories, potentially duplicating metadata/artifact requests and repository-side effects.
amarziali
left a comment
There was a problem hiding this comment.
I left a comment raised by codex as P2. Otherwise lgtm
What Does This Do
Prevents nested smoke-test Gradle builds from registering Maven Central when the Maven repository proxy is configured.
Adds end-to-end coverage that verifies the nested plugin-management and project dependency repository lists contain the configured proxy and do not contain Maven Central.
Motivation
GitLab builds are required to resolve Maven artifacts only through Depot. They must not fall back to Maven Central when the Depot proxy is configured.
The root build and build-logic settings already follow this policy, but the init script injected into nested smoke-test builds still registered Maven Central unconditionally. Dynamic dependency resolution could therefore contact Maven Central directly even when Depot was available, exposing GitLab jobs to Maven Central rate limits.
This extends the repository policy introduced in #12403 and #12404 to nested smoke-test builds.
Additional Notes
The GitLab smoke-test failure contained this dependency-resolution stack trace:
Validation:
The build-logic smoke-test suite ran 27 tests with no failures or skips.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [N/A]