Build smoke-test apps via Gradle Tooling API for Gradle 9 readiness#11404
Closed
bric3 wants to merge 15 commits into
Closed
Build smoke-test apps via Gradle Tooling API for Gradle 9 readiness#11404bric3 wants to merge 15 commits into
bric3 wants to merge 15 commits into
Conversation
Adds a new included build `build-logic/` hosting a single subproject `smoke-test` that exposes the `dd-trace-java.smoke-test-app` plugin and its `NestedGradleBuild` task type. The task runs a nested Gradle build via the Tooling API: - pins the nested Gradle version (no committed per-application wrappers), - uses the configured Java toolchain for the nested daemon, - forwards artifact paths from the root build as `-P<name>=<path>`, - redirects the nested `buildDir` via `-PappBuildDir=<path>` so outputs land under the outer project's build directory. Smoke-test modules with Spring Boot plugin versions incompatible with Gradle 9 will use this plugin instead of a committed Gradle 8 wrapper (see PR #11379 for the wrapper-based alternative). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Spring Boot Gradle plugin 2.x calls `Configuration.getUploadTaskName()`, removed in Gradle 9, so springboot-jpa (Spring Boot 2.6.0) cannot stay as a direct subproject of the Gradle 9 root build. Extract the application source into a self-contained `application/` Gradle project pinned to Spring Boot 2.6.0 and built via the new `dd-trace-java.smoke-test-app` plugin from `build-logic/`. The plugin uses the Gradle Tooling API to run the nested build with a pinned Gradle version (8.14.5) and the Java 8 toolchain — no committed `gradlew` wrapper. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…registry The Spring Boot Gradle plugin was applied but the module never produced a bootJar/bootWar — it ships a shadow jar instead. Removing the plugin eliminates a Gradle-9 blocker (the plugin's pre-3.5.0 versions call `Configuration.getUploadTaskName()`, removed in Gradle 9) with no behavioural change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… Gradle build These three Spring Boot 2.7.15 smoke tests fail under Gradle 9 because the Spring Boot plugin (pre-3.5.0) calls `Configuration.getUploadTaskName()`, removed in Gradle 9. Extract the application source into self-contained `application/` Gradle projects built via the nested-build plugin from `build-logic/`, which pins Gradle 8.14.5 and the Java 8 toolchain for the inner build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Extract Spring Boot 2.7.15 application sources into self-contained `application/` Gradle projects built via the nested-build plugin from `build-logic/`, so the root build can run on Gradle 9 without the Spring Boot plugin's `Configuration.getUploadTaskName()` regression. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Spring Boot 2.5.12 with the Ivy-downloaded Tomcat server. Move the inline plugin + Ivy repo + unzip task into a self-contained `application/` Gradle project built via the nested-build plugin (Gradle 8.14.5, Java 8). The outer build keeps the test source and forwards the produced war path plus the Tomcat install directory as system properties. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Spring Boot 2.7.15 app depends on the iast-util jar produced by the root build. Extract the application into a self-contained `application/` project and forward `iast-util.jar` via `-PiastUtilJar=<path>` (tracked as a task input so the nested build re-runs when the upstream jar changes). `spring-kafka-test` is pinned to 2.8.11 (the version the Spring Boot BOM previously resolved); the test module no longer applies the BOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Spring Boot 2.7.15, Java 11. Extract the application into a self-contained `application/` project; forward the `feature-flagging-api` jar from the root build via `-PfeatureFlaggingApiJar=<path>` (tracked as a task input). The inner build pins the OpenFeature SDK explicitly because the dependency is `api`-scoped in feature-flagging-api but is not transitively resolved when its jar is passed as a `files()` dependency. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Spring Boot 2.7.15 wrapping starter-web 2.2.0, Java 11. Extract the application into a self-contained `application/` project and forward `iast-util-11.jar` from the root build via `-PiastUtil11Jar=<path>`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same shape as springboot-java-11: Spring Boot 2.7.15 plugin wrapping starter-web 2.2.0, Java 17, with `iast-util-17.jar` forwarded from the root build via `-PiastUtil17Jar=<path>`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Spring Boot 2.7.18, Java 8. Extract the application into a self-contained
`application/` project and forward `dd-trace-api.jar` from the root build
via `-PapiJar=<path>`.
The non-flaky tests pass locally; the `@Flaky`-marked
`ApmTracingDisabledSamplingSmoke{V04,V1}Test` variants remain skipped in
CI as today.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lugin This module already had its application source in `application/`, built via an `Exec` task invoking the root `gradlew`. With the root build moving to Gradle 9 (incompatible with Spring Boot plugin 2.x), the nested build must instead pin its own Gradle version. Swap the `Exec` task for the `NestedGradleBuild` task type from the `build-logic:smoke-test` plugin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Gradle 9.5 added a `DependencyHandler.project(String)` overload that
returns a `ProjectDependency`. Inside a `dependencies { }` block, that
overload now shadows the `Project.project(String)` accessor that
previously resolved via Groovy fallback. Result:
`project(':foo').sourceSets` no longer reaches the producing project's
source sets — it hits a `DefaultProjectDependency` and fails with
"unknown property 'sourceSets'".
`dd-smoke-tests/debugger-integration-tests/build.gradle:21` used
`project(':dd-java-agent:agent-debugger').sourceSets.test.output` to
pull two helper classes (`LogProbeTestHelper`, `MoshiSnapshotTestHelper`)
from `agent-debugger`'s test sources.
Apply the canonical Gradle 9.5 fix (see #11367): expose the helpers via
the `java-test-fixtures` plugin on `agent-debugger`. The helpers move
from `src/test/java/com/datadog/debugger/util/` to
`src/testFixtures/java/com/datadog/debugger/util/` (same package), and
the consumer pulls them in via
`testImplementation testFixtures(project(':dd-java-agent:agent-debugger'))`.
The 15 existing in-project consumers (test classes inside agent-debugger)
keep working because the testFixtures source set is automatically on the
`test` source set's classpath.
This unblocks running the root build on Gradle 9.5.1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Combined with the smoke-test plugin work earlier on this branch (Spring Boot 2.x extracted into nested-build subprojects running under a Gradle 8.14.5 daemon via the Tooling API) and the agent-debugger java-test-fixtures migration, this unblocks the root build on Gradle 9.5.1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fe8cd93 to
132c13d
Compare
…plugin The wildfly and rum:wildfly-15 smoke tests built their EAR via an `Exec` task invoking the root `gradlew` with `JAVA_HOME=8` (or whatever the parent shell had). Once the root wrapper moved to Gradle 9, that pattern broke — Gradle 9 requires a JDK 17 daemon, which then can't load the JDK 8-targeted application. Swap both `earBuild` tasks for the `NestedGradleBuild` task type from the `build-logic:smoke-test` plugin so the nested EAR build runs on a Gradle 8.14.5 daemon with the Java 8 toolchain. `dd-trace-api.jar` is forwarded through the plugin's `projectJar(...)` helper. The surrounding wildfly orchestration (unzip the server zip, copy the EAR into `standalone/deployments`, `Test.dependsOn 'deploy'`) is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Debugger benchmarksParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 9 metrics, 6 unstable metrics. See unchanged results
Request duration reports for reportsgantt
title reports - request duration [CI 0.99] : candidate=None, baseline=None
dateFormat X
axisFormat %s
section baseline
noprobe (343.272 µs) : 295, 392
. : milestone, 343,
basic (297.507 µs) : 291, 304
. : milestone, 298,
loop (8.976 ms) : 8970, 8982
. : milestone, 8976,
section candidate
noprobe (335.846 µs) : 310, 362
. : milestone, 336,
basic (296.371 µs) : 290, 303
. : milestone, 296,
loop (8.984 ms) : 8979, 8990
. : milestone, 8984,
|
Contributor
Author
|
superseded by smaller prs |
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.
For easier review see
New Smoke test Plugin
Smoke tests fixes
earBuildtasks to the smoke-test plugin #11417What Does This Do
Introduces a new
build-logic/included build hosting thedd-trace-java.smoke-test-appplugin, which builds smoke-test applications via the Gradle Tooling API in a nested daemon with a pinned Gradle version and Java toolchain — without committing per-applicationgradlewwrappers.Fourteen smoke-test modules that pin Spring Boot 2.x are converted to this new plugin so the root build can move to Gradle 9 (the Spring Boot Gradle plugin <3.5.0 calls
Configuration.getUploadTaskName(), which is removed in Gradle 9).apm-tracing-disableddd-trace-apijarkafka-2iast-utiljaropenfeaturefeature-flagging-apijarspring-boot-2.7-webfluxwebfluxBuildspringboot-freemarkercopyAppResourcesfor FS templatesspringboot-java-11iast-util-11springboot-java-17iast-util-17springboot-jetty-jspspringboot-jpaspringboot-thymeleafspringboot-tomcatspringboot-tomcat-jspspringboot-velocitycopyAppResourcesfor FS templatesdatastreams/kafkaschemaregistryMotivation
Gradle 9.5 readiness requires every direct subproject of the root build to be compatible with Gradle 9. The Spring Boot Gradle plugin pinned by some smoke tests can't run on Gradle 9, so those apps have to be built out-of-process.
This is an alternative path to #11379, which solved the same problem by committing 22 per-application Gradle 8.14.5 wrappers and shelling out via
Exec. In #11379 this created many gradle wrappers, also someExectasks forwarded project jars without declaring them as task inputs (stale-cache risk). The approach here addresses both: no wrappers, and forwarded jars are modelled as resolvableConfigurations that Gradle wires as task inputs / task dependencies automatically.Effort part of #10402, #11272
Additional Notes
There's a new included build
build-logic/with one subproject (smoke-test) for a single plugin id (dd-trace-java.smoke-test-app). The reason for this aredd-trace-java.smoke-test-appwas inbuildSrcit would add its dependencies in anything that consumes buildSrc plugins. Given this is very specific to some smoke tests, it is preferable to isolate it.buildSrc/will be. They are some issue with the (legacy)buildSrc/way, more details here, in Gradle best practices. Initiating this project now makes sense.Structurally this new plugin consists of
NestedGradleBuildtask type wraps theGradleConnectorfrom the Gradle Tooling API. It pins the nested Gradle distribution and JDK and declares the application directory as@InputFilesand the produced artifact tree as@OutputDirectory.smokeTestApp { application { ... } }project extension that will be used to configure the task and wiring. If a consumer does not useapplication { ... }, the plugin is a no-op and the task type can be registered manually.projectJar(name, project), which creates a resolvableConfigurationwithisTransitive = false— noevaluationDependsOnand noafterEvaluate.freemarkerandvelocitymodules also need a smallCopytask to mirror the nested build'sresources/maininto the outer build dir, because their controller resolves templates via filesystem paths rather than the classpath.Noteworthy as well this PR took another route than #11272, in there Spring Boot Gradle plugin is sidestepped, the smoke build emits a flat
shadowJar. THis results in jars that have different layout from Spring Boot jars (Spring Boot Class Loader to accommodate the boot jar, BOOT-INF, layered jar). While this approach keeps "thinner" impact, it somewhat makes smoke test not testing exactly the same thing.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]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.