Skip to content

Centralize smoke app Gradle proxy setup#11575

Open
bric3 wants to merge 8 commits into
masterfrom
bdu/gradle9-smoke-test-app
Open

Centralize smoke app Gradle proxy setup#11575
bric3 wants to merge 8 commits into
masterfrom
bdu/gradle9-smoke-test-app

Conversation

@bric3
Copy link
Copy Markdown
Contributor

@bric3 bric3 commented Jun 4, 2026

What Does This Do

Moves the smoke-test app Gradle proxy setup into the smoke app build logic.

The smoke app extension now adds the shared init script only for CI nested builds. The init script is Kotlin, runs early enough to affect plugin resolution, and prepends Maven proxy repositories without replacing project repositories.

It also removes duplicated nested repository and cache wiring from smoke apps that can rely on the shared setup.

Motivation

Gradle 9 exposed a few nested-build assumptions in the smoke apps: plugin repositories, CI proxy repositories, and duplicated boilerplate lived in too many places.

Centralizing that setup keeps the smoke apps consistent while preserving app-specific repositories, including the Tomcat repositories that still belong to those builds.

Additional Notes

This keeps the direction focused on Maven proxy injection. Ivy repository handling remains in app-specific builds for now.

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

bric3 added 8 commits June 4, 2026 21:37
Exercise the two inputs the native smoke apps rely on: a provider-backed environment variable and a provider-backed file forwarded as a Gradle property. This locks in the Gradle 9 migration support that now replaces the old Exec wiring.
Leave the OpenLiberty smoke apps on the Maven wrapper for now. They are the only Maven nested application builds, so a dedicated NestedMavenBuild task would add API surface before there is a pattern to share.
Move nested smoke-test repository policy into the plugin. Nested Gradle builds now pass root proxy properties and load one init script, so individual application settings files no longer need to repeat the same repository blocks.
Let the smoke-test-app init script own nested repository policy. Application settings files now keep only project-specific settings, with Quarkus retaining its plugin version declaration.
Nested smoke-test builds already pass an explicit build-cache flag from the plugin. Removing the per-application CI cache redirects avoids dead settings and fixes the RUM EAR path that pointed outside the cached workspace.
Keep repository proxy init scripts as a smoke app convention so NestedGradleBuild only passes --init-script when callers provide scripts.

Enable that convention only when CI=true and forward proxy properties from the outer build in that mode.
Use a Kotlin init script that configures plugin repositories in beforeSettings and registers a beforeProject hook to add Maven proxy repositories before project build scripts add their own repositories.

This keeps project repositories available while making the CI proxy repositories first in nested smoke-test builds.
Use Gradle Action callbacks in the Kotlin init script instead of Kotlin DSL closure helpers.

This keeps the script on non-Groovy hook overloads while still running early enough to prepend plugin and project Maven proxy repositories.
@bric3 bric3 added type: refactoring comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: no release note tag: no release notes Changes to exclude from release notes and removed tag: no release note labels Jun 4, 2026
@bric3 bric3 marked this pull request as ready for review June 4, 2026 21:46
@bric3 bric3 requested review from a team as code owners June 4, 2026 21:46
@bric3 bric3 requested review from AlexeyKuznetsov-DD, amarziali, daniel-romano-DD, jandro996, leoromanovsky, typotter and vandonr and removed request for a team June 4, 2026 21:46
Copy link
Copy Markdown
Contributor

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD left a comment

Choose a reason for hiding this comment

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

LGTM, but I have a feeling that SmokeTestAppEndToEndTest can be refactored a bit to reuse similar code in tests.

fun `nested build receives native app environment and provider backed file inputs`() {
writeOuterSettings()
File(projectDir.toFile(), "agent.jar").writeText("agent")
outerBuild.writeText(
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.

nit: can this be writeOuterBuild(...)? to be consistent with writeInnerBuild()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'll make another pass on the tests tomorrow. I have the same feeling as you.

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: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants