Enable Gradle enhanced graph ordering - #12326
Draft
AlexeyKuznetsov-DD wants to merge 1 commit into
Draft
Conversation
AlexeyKuznetsov-DD
marked this pull request as ready for review
August 27, 2026 20:42
AlexeyKuznetsov-DD
requested review from
ValentinZakharov
and removed request for
a team
August 27, 2026 20:42
Contributor
There was a problem hiding this comment.
More details
The changes use established repository patterns for dependency exclusions, MockServer setup, and Spring metadata merge. The static review finds no concrete failure.
🤖 Datadog Autotest · Commit c6e34cd · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
This comment has been minimized.
This comment has been minimized.
Contributor
🟢 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. |
AlexeyKuznetsov-DD
force-pushed
the
alexeyk/gradle-enhanced-graph-ordering
branch
from
August 27, 2026 23:02
c6e34cd to
bdb9131
Compare
AlexeyKuznetsov-DD
force-pushed
the
alexeyk/gradle-enhanced-graph-ordering
branch
from
August 28, 2026 01:25
bdb9131 to
88bf0ee
Compare
AlexeyKuznetsov-DD
marked this pull request as draft
August 28, 2026 01:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
ENHANCED_GRAPH_ORDERINGfeature preview.mockserver-netty-no-dependencies:5.14.0and a minimal local JUnit extension, avoiding embedded JUnit and incompatible SLF4J classes.build-logic/spring-boot-shadowconvention that merges service and Spring discovery metadata.javax.transactionAPI, and refreshes ordering-sensitive dependency locks.javaxorjakartageneration.Motivation
Gradle 9.6 changed dependency traversal and could place an older fat JAR before newer modular dependencies. Gradle 9.7 addresses that traversal behavior behind
ENHANCED_GRAPH_ORDERING; the preview becomes the default in Gradle 10.Enabling the preview also reveals classpaths that previously depended on incidental traversal order. Some are normal dependency conflicts that can be made deterministic through exclusions or direct dependencies. Others involve classes or resources hidden inside fat/no-dependencies JARs, which Gradle cannot reconcile by module version because they belong to different coordinates.
SofaRPC is in the latter category:
sofa-rpc-all:5.14.2brings the class-carryingnetty-all:4.1.44.Final, while gRPC brings individual Netty 4.1.79 modules. Enhanced ordering changes which copy ofio.netty.**loads first, but does not eliminate the duplicate classes. Retaining the constraint onnetty-all:4.1.79.Finalreplaces the fat JAR with Netty's class-free aggregator and an aligned modular dependency set.The ordering change also exposed two structural issues. Spring Boot fat JARs normally need discovery metadata from every dependency merged rather than retaining an arbitrary duplicate, and Liberty 20 and Liberty 23 reuse IBM implementation class names even though their servlet APIs use different namespaces. The Spring convention makes metadata handling consistent for normal fixtures, while the Liberty common module removes an unnecessary cross-generation test dependency and namespace matchers prevent incompatible servlet advice from being applied.
Additional Notes
This is stacked on #12323 and should be reviewed and merged after it.
The SofaRPC regression can otherwise combine
AbstractReferenceCountedByteBuffrom Netty 4.1.79 withReferenceCountUpdaterfrom the 4.1.44 fat JAR and fail with aNoSuchMethodError. With enhanced ordering, the old fat JAR may instead win for all Netty classes, hiding that particular linkage error while silently testing the wrong Netty version. The retained constraint removes both outcomes.MockServer's previous
mockserver-junit-jupiter-no-dependenciesartifact embeds an older JUnit Platform under the original packages. Enhanced ordering allowed those classes to shadow JUnit Platform 1.14.1, producing:The replacement uses
mockserver-netty-no-dependencies, which contains the server implementation without embedded JUnit classes, plus a small extension implementing only the lifecycle and parameter injection used by the HTTP test fixtures. Version 5.14.0 is intentional: its unrelocated SLF4J API matches this module's SLF4J 1.7 line and it ships no logging provider, whereas 5.15.0 embeds SLF4J 2.0 and a JUL provider.The OpenAI test classpath contains both Datadog's forked OkHttp/Okio and OpenAI's newer upstream versions under identical Java packages. Runtime-only exclusions preserve the tested OpenAI versions and avoid failures such as:
The Spring Boot Shadow convention merges
META-INF/services, Spring handlers, schemas, tooling, and factories. It lives in a separate Java 17 build-logic module because Shadow 9's plugin API targets Java 17, while other build-logic modules still target Java 8.appsec/springbootand the legacy Spring Boot 1.5 IAST fixture intentionally keep raw Shadow behavior plus a directspring-boot-autoconfiguredependency. Merging their complete factory sets changes established request/error behavior: the AppSec fixture stops observing expected blocking, and the Java 8/11 IAST fixture reportsRIPEMD128 MessageDigest not available. The direct dependency makes their historical first-file selection deterministic under enhanced ordering.The Quartz
version40Testsuite is pinned to Quartz 2.4.0 so it remains distinct fromlatestDepTest. Quartz 2.4 usesjavax.transaction.UserTransaction; Quartz 2.5 and later use Jakarta Transactions.Liberty 23 previously loaded the complete Liberty 20 instrumentation module in tests to reuse deployment classloader naming. The shared module now contains the namespace-neutral classloader naming and multipart filename hooks. Request and response finish instrumentations retain symmetric
javax.servletandjakarta.servletstructure matchers because the production agent packages both generations. As a diagnostic, both module suites also passed with those matchers temporarily disabled after the test dependency was decoupled, but that isolated test setup does not model both generations being loaded by the production agent.Validation:
./gradlew :components:http:http-api:check :components:http:http-api:forkedTest :dd-java-agent:instrumentation:openai-java:openai-java-3.0:test :dd-java-agent:instrumentation:openai-java:openai-java-3.0:forkedTest :dd-java-agent:instrumentation:openai-java:openai-java-3.0:latestDepTest :dd-java-agent:instrumentation:sofarpc:sofarpc-5.0:test :dd-java-agent:instrumentation:sofarpc:sofarpc-5.0:forkedTest :dd-java-agent:instrumentation:sofarpc:sofarpc-5.0:latestDepTest :dd-smoke-tests:spring-boot-2.5-webflux:test -PtestJvm=17 --rerun-tasks(197 tests passed, 0 failed; 3 intentionally disabled HTTP-provider tests skipped)./gradlew :components:http:http-api:compileTestFixturesJava :components:http:http-api:forkedTest -PtestJvm=11 --rerun-tasks./gradlew :components:http:http-api:compileTestFixturesJava :components:http:http-api:forkedTest -PtestJvm=25 --rerun-tasks./gradlew :dd-java-agent:instrumentation:quartz-2.0:test :dd-java-agent:instrumentation:quartz-2.0:version40Test :dd-java-agent:instrumentation:quartz-2.0:latestDepTest --rerun-tasks(4 tests passed in each suite)./gradlew :dd-java-agent:instrumentation:spring:spring-webflux:spring-webflux-5.0:iastTest --rerun-tasks(8 tests passed)./gradlew :dd-smoke-tests:spring-boot-2.4-webflux:test :dd-smoke-tests:springboot-mongo:test -PtestJvm=17 --rerun-tasks(3 tests passed in each suite)./gradlew :dd-smoke-tests:appsec:springboot:test -PtestJvm=17 --rerun-tasks./gradlew :dd-smoke-tests:springboot:test -PtestJvm=8 --rerun-tasks(211 tests passed, 0 failed)./gradlew :dd-java-agent:instrumentation:liberty:liberty-20.0:test :dd-java-agent:instrumentation:liberty:liberty-20.0:forkedTest :dd-java-agent:instrumentation:liberty:liberty-23.0:test :dd-java-agent:instrumentation:liberty:liberty-23.0:forkedTest -PtestJvm=17 --rerun-tasks(527 tests passed, 0 failed)./gradlew :dd-java-agent:instrumentation:liberty:liberty-20.0:muzzle :dd-java-agent:instrumentation:liberty:liberty-23.0:muzzle(2 checks passed)./gradlew :dd-java-agent:instrumentation:liberty:liberty-common:build./gradlew -p build-logic :spring-boot-shadow:check./gradlew :dd-java-agent:shadowJarGradle issue: gradle/gradle#38057
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: [PROJ-IDENT]