Skip to content

Switch spring-boot-2.7-webflux to the smoke-test plugin - #11407

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 8 commits into
masterfrom
bdu/smoke-test-pattern-c-webflux
May 21, 2026
Merged

Switch spring-boot-2.7-webflux to the smoke-test plugin#11407
gh-worker-dd-mergequeue-cf854d[bot] merged 8 commits into
masterfrom
bdu/smoke-test-pattern-c-webflux

Conversation

@bric3

@bric3bric3 commented May 18, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Replaces the inline Exec task in dd-smoke-tests/spring-boot-2.7-webflux/build.gradle with a smokeTestApp { application { … } } block from the dd-trace-java.smoke-test-app plugin (added in #11405).

The existing application/ subproject is unchanged.

Before (excerpt):

def appDir ="$projectDir/application"def appBuildDir ="$buildDir/application"def gradlewCommand = isWindows ?'gradlew.bat':'gradlew'
tasks.register('webfluxBuild', Exec) {
workingDir "$appDir"
environment += ["JAVA_HOME": getLazyJavaHomeFor(8)]
commandLine "$rootDir/${gradlewCommand}", "bootJar", "--no-daemon", "--max-workers=4",
"-PappBuildDir=$appBuildDir",
"-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}"
outputs.dir(appBuildDir).withPropertyName("applicationJar")
inputs.files(fileTree(appDir) { include '**/*'; exclude '.gradle/**' })
.withPropertyName("application")
.withPathSensitivity(PathSensitivity.RELATIVE)
}
tasks.named("webfluxBuild", Exec) {
dependsOn project(':dd-trace-api').tasks.named("jar")
}

After:

smokeTestApp {
application {
taskName ='webfluxBuild'
nestedTasks = ['bootJar']
artifactPath ='libs/webflux-2.7-smoketest.jar'
sysProperty ='datadog.smoketest.webflux.uberJar.path'
}
projectJar('apiJar', project(':dd-trace-api'))
}

Note

smokeTestApp has a convention of running Gradle 8.14.5, with a daemon running on Java 21, so it's not explicitly set. It's configurable if needed.

Motivation

The current build invokes the rootgradlew for the nested build. As soon as the root project moves to Gradle 9, the Spring Boot plugin 2.7 inside application/build.gradle breaks (Configuration.getUploadTaskName is gone). The nested build must therefore pin its own Gradle version.

The smokeTestApp DSL uses the Gradle Tooling API to run that pinned distribution (8.14.5) and applies the Java 8 toolchain to the nested daemon. The dd-trace-api.jar forwarding is now wired through a resolvable Configuration, so the build order is established automatically — no evaluationDependsOn(...) needed.

Mirrors PR #11379 "Pattern B" (existing-application/ modules), but uses the new plugin instead of a committed Gradle 8.14.5 wrapper inside application/.

Additional Notes

  • Stacked on #11405 (smoke-test plugin infrastructure). Merge target is the infrastructure branch; rebase to master once the infrastructure PR lands.
  • The application/ subproject is untouched — same application/settings.gradle, same application/build.gradle from master. Only the outer build.gradle changes.
  • Verified locally with ./gradlew :dd-smoke-tests:spring-boot-2.7-webflux:test -PskipFlakyTests=true.

Contributor Checklist

🤖 Generated with Claude Code

Adds a new included build `build-logic/` hosting a single subproject
`smoke-test` that exposes the `dd-trace-java.smoke-test-app` plugin.
The plugin contributes:
- `NestedGradleBuild` task type that runs a nested Gradle build via the
Gradle Tooling API. It 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>`, and redirects the nested `buildDir` via
`-PappBuildDir=<path>` so outputs land under the outer project's build
directory.
- `smokeTestApp` project extension with an `application { ... }` block
that registers the `NestedGradleBuild` task, wires it into every `Test`
task via `dependsOn` + a `jvmArgumentProvider` for the produced
artifact's system property. Consumers can also register
`NestedGradleBuild` directly when they need more control; the plugin
is a no-op until `application` or a manual registration is done.
- `projectJar(name, project)` helper that forwards a sibling project's
jar to the nested build through a resolvable `Configuration` (avoids
`evaluationDependsOn` and the cross-project access ordering issues).
The plugin is verified with JUnit 5 unit tests (`ProjectBuilder`) and
end-to-end tests that drive the Tooling API path through the Gradle Test
Kit with a temporary Kotlin-DSL test project.
`build-logic/settings.gradle.kts` references the existing
`gradle/libs.versions.toml` catalog (mirroring `buildSrc/`) so the
plugin can use the same library coordinates as the rest of the repo.
The Gradle libs Maven repository (`https://repo.gradle.org/gradle/libs-releases`,
scoped to `org.gradle:`) is added to the root build's `pluginManagement`
and to `gradle/repositories.gradle` so the Tooling API jar resolves.
Smoke-test modules with Spring Boot plugin versions incompatible with
Gradle 9 will use this plugin in follow-up PRs instead of a committed
Gradle 8 wrapper.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bric3bric3 added type: feature Enhancements and improvements 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 May 18, 2026
@bric3
bric3 marked this pull request as ready for review May 19, 2026 08:40
@bric3
bric3 requested a review from a team as a code ownerMay 19, 2026 08:40
@bric3
bric3 requested review from ValentinZakharov and removed request for a teamMay 19, 2026 08:40
@bric3bric3 changed the title chore(smoke-tests): switch spring-boot-2.7-webflux to the smoke-test pluginSwitch spring-boot-2.7-webflux to the smoke-test pluginMay 19, 2026
@bric3
bric3force-pushed the bdu/smoke-test-pattern-c-webflux branch from e5e6dbf to 3c25ac0CompareMay 19, 2026 14:02
…14.5
Set conventions on `smokeTestApp`:
- `gradleVersion` defaults to `"8.14.5"` (Gradle 8 last release; pinned because
Spring Boot plugin pre-3.5 calls `Configuration.getUploadTaskName()`, removed
in Gradle 9).
- `javaLauncher` defaults to a JDK 21 toolchain (the version the root build
requires for its own Gradle 9 migration; standardising the nested daemon on
the same JDK avoids requiring an extra toolchain on dev machines and CI
runners).
Consumers that need a different JDK or Gradle version still override
explicitly. The inner build script is responsible for pinning the produced
bytecode level (`java { sourceCompatibility = JavaVersion.VERSION_1_8 }` or
similar) — Gradle adds `--release N` automatically when source/target differs
from the daemon JVM.
`JavaToolchainService` is now injected into the extension; this works in any
project where a `java*` (or related) plugin is applied. Smoke-test modules
already apply `gradle/java.gradle`, which applies `java`, so the convention
resolves on first read.
Public defaults exposed as `DEFAULT_NESTED_GRADLE_VERSION` and
`DEFAULT_NESTED_JAVA_VERSION` constants so the values are discoverable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bric3
bric3force-pushed the bdu/smoke-test-plugin-infrastructure branch from c6d9744 to 1562192CompareMay 19, 2026 14:08
@bric3
bric3 requested a review from a team as a code ownerMay 19, 2026 14:08
@bric3
bric3 requested a review from mhliddMay 19, 2026 14:08
@datadog-prod-us1-4

This comment has been minimized.

@bric3
bric3force-pushed the bdu/smoke-test-pattern-c-webflux branch 2 times, most recently from 3cdf4e8 to 37c0f84CompareMay 19, 2026 16:32
bric3and others added 2 commits May 19, 2026 18:59
…ugin
Switch the plugin sources and unit tests over to the typed
`org.gradle.kotlin.dsl` extension functions where they replace
`::class.java` boilerplate:
- `tasks.register(name, Type::class.java) { … }` → `tasks.register<Type>(name) { … }`
- `tasks.withType(Type::class.java).configureEach { … }` → `tasks.withType<Type>().configureEach { … }`
- `extensions.create("name", Type::class.java)` → `extensions.create<Type>("name")`
- `extensions.getByType(Type::class.java)` → `extensions.getByType<Type>()`
- `extensions.findByName("name")` (followed by `isInstanceOf`) → `extensions.findByType<Type>()`
- `project.plugins.apply(Plugin::class.java)` → `project.apply<Plugin>()` (PluginAware)
- `objects.newInstance(Type::class.java)` → `objects.newInstance<Type>()`
Also drop the six `captured*` local variables in `SmokeTestAppExtension.application` —
inside `tasks.register<NestedGradleBuild>(taskName) { … }` the outer extension's
properties are now reached via `this@SmokeTestAppExtension.<prop>` directly.
No behavioural change; the 9 plugin tests still pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…plugin
This module already had a nested `application/` Gradle subproject built
via an `Exec` task that invoked the root `gradlew`. With the root build
moving to Gradle 9 (incompatible with Spring Boot plugin 2.x), the
nested build must pin its own Gradle version.
Swap the `Exec` task for the `smokeTestApp { application { … } }` DSL
from the `build-logic:smoke-test` plugin: Gradle 8.14.5 is pinned via
the Tooling API, the Java 8 toolchain is applied to the nested daemon,
and `dd-trace-api.jar` is forwarded via `projectJar('apiJar', …)`
(resolved through a `Configuration`, so no `evaluationDependsOn` is
needed).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bric3
bric3force-pushed the bdu/smoke-test-pattern-c-webflux branch from 37c0f84 to 74cffd3CompareMay 19, 2026 17:00
Base automatically changed from bdu/smoke-test-plugin-infrastructure to masterMay 19, 2026 20:48
@gh-worker-ownership-write-b05516
gh-worker-ownership-write-b05516Bot removed the request for review from a teamMay 19, 2026 23:48

@AlexeyKuznetsov-DDAlexeyKuznetsov-DD 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.

LGTM, left minor comments.

Comment threaddd-smoke-tests/spring-boot-2.7-webflux/application/build.gradle Outdated
application {
taskName = 'webfluxBuild'
nestedTasks = ['bootJar']
artifactPath = 'libs/webflux-2.7-smoketest.jar'

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.

In other PR, I've already suggested to use calculated default and override only if it is really neeed.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'll do that in a follow-up

@bric3
bric3 added this pull request to the merge queueMay 20, 2026
@dd-octo-sts

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351Bot commented May 20, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-05-20 07:06:36 UTC ℹ️ Start processing command /merge


2026-05-20 07:06:40 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-05-20 09:07:08 UTC 🚨 MergeQueue: This merge request is in error

error while getting head build completion result

Details

Error: There was an error while retrieving the result for pipeline 114148829

FullStacktrace:
child workflow execution error (type: mergequeue_private.MergeQueue_WaitForChecksOrUntilIsFinal, workflowID: 019e4435-3d21-70b6-a604-18ef542a5415_74, runID: 019e4435-9bfe-76aa-b100-1d92d2b49e94, initiatedEventID: 74, startedEventID: 75): child workflow execution error (type: mergequeue.MergeQueue_WaitForCompletionOfRef, workflowID: 019e4435-9bfe-76aa-b100-1d92d2b49e94_8, runID: 019e4435-9c69-739c-bf6e-954cbb4cd86b, initiatedEventID: 8, startedEventID: 10): There was an error while retrieving the result for pipeline 114148829 (type: FlowError, retryable: false): There was an error while retrieving the result for pipeline 114148829

@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks May 20, 2026
bric3and others added 3 commits May 20, 2026 14:52
Match the review feedback applied on #11408: expand the terse comments
in the spring-boot-2.7-webflux nested settings.gradle to explain the CI
Maven mirror proxies and the CI-only shared build cache (f6ec1f5 /
#982, b34ccbc).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bric3

Copy link
Copy Markdown
ContributorAuthor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351Bot commented May 21, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-05-21 09:10:56 UTC ℹ️ Start processing command /merge


2026-05-21 09:11:03 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-05-21 10:22:32 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854dBot merged commit 814c574 into masterMay 21, 2026
569 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854dBot deleted the bdu/smoke-test-pattern-c-webflux branch May 21, 2026 10:22
@github-actionsgithub-actionsBot added this to the 1.63.0 milestone May 21, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: toolingBuild & Toolingtag: ai generatedLargely based on code generated by an AI or LLMtag: no release notesChanges to exclude from release notestype: featureEnhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@bric3@ValentinZakharov@sarahchen6@AlexeyKuznetsov-DD