Skip to content

Prevent nested smoke builds from falling back to Maven Central - #12491

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
alexeyk/avoid-nested-maven-central-fallback
Sep 16, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
alexeyk/avoid-nested-maven-central-fallback

Conversation

@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor

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:

Could not determine the dependencies of task ':shadowJar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
   > Could not resolve com.datadoghq:dd-trace-api:+.
      > Failed to list versions for com.datadoghq:dd-trace-api.
         > Unable to load Maven meta-data from https://repo.maven.apache.org/maven2/com/datadoghq/dd-trace-api/maven-metadata.xml.
            > Could not GET 'https://repo.maven.apache.org/maven2/com/datadoghq/dd-trace-api/maven-metadata.xml'.
              Received status code 429 from server: Too Many Requests

Caused by: org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException:
Could not GET 'https://repo.maven.apache.org/maven2/com/datadoghq/dd-trace-api/maven-metadata.xml'.
Received status code 429 from server: Too Many Requests

Validation:

./gradlew -p build-logic :smoke-test:test
./gradlew spotlessKotlinGradleCheck

The build-logic smoke-test suite ran 27 tests with no failures or skips.

Contributor Checklist

Jira ticket: [N/A]

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added type: bug fix Bug fix tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM labels Sep 14, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Sep 14, 2026
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD marked this pull request as ready for review September 14, 2026 22:53
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from a team as a code owner September 14, 2026 22:53
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested review from amarziali and removed request for a team September 14, 2026 22:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T22:57:14.483210Z f70ab11 Draft marked ready
🔒 Security Review Completed 2026-09-14T22:56:30.302565Z f70ab11 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-datadog-prod-us1-2

This comment has been minimized.

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Datadog Autotest: FAIL

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.

Open Bits AI session

🤖 Datadog Autotest · Commit f70ab11 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@dd-octo-sts

dd-octo-sts Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.05 s 14.01 s [-0.5%; +1.0%] (no difference)
startup:insecure-bank:tracing:Agent 12.92 s 12.95 s [-0.8%; +0.4%] (no difference)
startup:petclinic:appsec:Agent 17.45 s 17.24 s [+0.2%; +2.2%] (maybe worse)
startup:petclinic:iast:Agent 16.81 s 17.04 s [-7.4%; +4.7%] (unstable)
startup:petclinic:profiling:Agent 16.63 s 16.71 s [-6.6%; +5.6%] (unstable)
startup:petclinic:sca:Agent 17.50 s 17.20 s [+0.7%; +2.8%] (maybe worse)
startup:petclinic:tracing:Agent 16.03 s 16.66 s [-9.1%; +1.6%] (unstable)

Commit: 0dfd0c6d · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@amarziali amarziali left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I left a comment raised by codex as P2. Otherwise lgtm

The init script injects the repository proxy and redirectMavenCentral()
rewrites any mavenCentral() the nested build declares onto that same URL,
so both the plugin-management and project repository lists end up holding
the proxy twice. They stay distinct Gradle repositories, duplicating
metadata and artifact requests on every cache miss.

Drop the redundant entries, keeping the repository this script injected:
it is the only one known to be unrestricted. A declared mavenCentral()
may carry content filters or narrowed metadata sources that the redirect
does not lift, so keeping such a declaration instead would stop resolving
whatever it excludes. Containers this script never injected into are left
untouched, so nothing removes a proxy the nested build owns outright.

Also handle a repository declared without a URL, which would otherwise
fail with a NullPointerException thrown from an injected init script
rather than Gradle's own error.

The test fixture now declares Maven Central with a content filter before
the injection happens, which is the ordering that makes the choice of
survivor observable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD force-pushed the alexeyk/avoid-nested-maven-central-fallback branch from 70576ed to 0dfd0c6 Compare September 16, 2026 00:09
@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor Author

/merge -f --reason "This is a fix for test build, no need to run MQ, tested on PR"

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Sep 16, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-16 13:04:42 UTC ℹ️ Start processing command /merge -f --reason "This is a fix for test build, no need to run MQ, tested on PR"


2026-09-16 13:04:48 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 0s (p90).


2026-09-16 13:04:58 UTC ℹ️ MergeQueue: This merge request was merged

Warning

This change was merged without running any pre merge CI checks

Reason: This is a fix for test build, no need to run MQ, tested on PR

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit f74eea4 into master Sep 16, 2026
602 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the alexeyk/avoid-nested-maven-central-fallback branch September 16, 2026 13:04
@github-actions github-actions Bot added this to the 1.67.0 milestone Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants