Repository navigation
Add Java polyglot AppHost parity - #15470
Conversation
Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15470Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15470" |
There was a problem hiding this comment.
Pull request overview
This PR expands Java polyglot AppHost support to better match the TypeScript experience by adding Java validation AppHosts across the polyglot playground, introducing a runnable Java sample, and wiring Java validation into CI/Docker workflows.
Changes:
- Added multiple Java playground validation AppHosts (configs + AppHost.java + generated .modules) mirroring TypeScript coverage
- Added a runnable
playground/JavaAppHostsample (Java AppHost + Node/React frontend) - Added Java CI/unit-test job and Docker/scripts for Java playground validation
Reviewed changes
Copilot reviewed 86 out of 374 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| playground/polyglot/Java/Aspire.Hosting.Azure.PostgreSQL/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for Java validation AppHost SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.OperationalInsights/ValidationAppHost/aspire.config.json | Adds Java AppHost config enabling experimental Java polyglot and package restore. |
| playground/polyglot/Java/Aspire.Hosting.Azure.OperationalInsights/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising OperationalInsights API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.OperationalInsights/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.OperationalInsights/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.Kusto/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for Kusto package. |
| playground/polyglot/Java/Aspire.Hosting.Azure.Kusto/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising Kusto API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.Kusto/ValidationAppHost/.modules/Transport.java | Adds generated Java JSON-RPC transport for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.Kusto/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.Kusto/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.KeyVault/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for KeyVault package. |
| playground/polyglot/Java/Aspire.Hosting.Azure.KeyVault/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising KeyVault API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.KeyVault/ValidationAppHost/.modules/Transport.java | Adds generated Java JSON-RPC transport for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.KeyVault/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.KeyVault/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.Functions/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for Functions (+ Storage dependency). |
| playground/polyglot/Java/Aspire.Hosting.Azure.Functions/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising Functions API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.Functions/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.Functions/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for EventHubs package. |
| playground/polyglot/Java/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising EventHubs API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.CosmosDB/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for CosmosDB (+ KeyVault dependency). |
| playground/polyglot/Java/Aspire.Hosting.Azure.CosmosDB/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising CosmosDB API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.CosmosDB/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.CosmosDB/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.ContainerRegistry/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for ContainerRegistry (+ AppContainers dependency). |
| playground/polyglot/Java/Aspire.Hosting.Azure.ContainerRegistry/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising ContainerRegistry API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.ContainerRegistry/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.ContainerRegistry/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for CognitiveServices package. |
| playground/polyglot/Java/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising CognitiveServices/OpenAI API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.ApplicationInsights/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for ApplicationInsights (+ OperationalInsights dependency). |
| playground/polyglot/Java/Aspire.Hosting.Azure.ApplicationInsights/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising ApplicationInsights API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.ApplicationInsights/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.ApplicationInsights/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppService/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for AppService package. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppService/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising AppService API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppService/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppService/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppContainers/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for AppContainers (+ OperationalInsights dependency). |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppContainers/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising AppContainers API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppContainers/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppContainers/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/aspire.config.json | Adds Java validation AppHost config for AppConfiguration package. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/AppHost.java | Adds Java validation AppHost exercising AppConfiguration API surface. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for SDK. |
| playground/polyglot/Java/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| playground/JavaAppHost/frontend/vite.config.ts | Adds Vite config including API proxy for frontend dev server. |
| playground/JavaAppHost/frontend/tsconfig.node.json | Adds TS config for Vite/node tooling. |
| playground/JavaAppHost/frontend/tsconfig.json | Adds TS project references setup. |
| playground/JavaAppHost/frontend/tsconfig.app.json | Adds TS config for React app compilation. |
| playground/JavaAppHost/frontend/src/main.tsx | Adds React entrypoint. |
| playground/JavaAppHost/frontend/src/index.css | Adds base/reset styles and reduced-motion handling. |
| playground/JavaAppHost/frontend/src/App.tsx | Adds sample UI fetching weather forecast via API proxy. |
| playground/JavaAppHost/frontend/package.json | Adds frontend dependencies/scripts and Node engine constraints. |
| playground/JavaAppHost/frontend/index.html | Adds Vite HTML entry. |
| playground/JavaAppHost/frontend/eslint.config.js | Adds ESLint config for TS/React hooks and refresh. |
| playground/JavaAppHost/frontend/.dockerignore | Adds Docker ignore for Node build artifacts. |
| playground/JavaAppHost/aspire.config.json | Adds Java AppHost config for the runnable JavaAppHost sample. |
| playground/JavaAppHost/api/tsconfig.json | Adds TS config for the API service build output. |
| playground/JavaAppHost/api/src/instrumentation.ts | Adds OpenTelemetry NodeSDK initialization for Aspire dashboard. |
| playground/JavaAppHost/api/src/index.ts | Adds Express API service serving forecast and optional static bundle. |
| playground/JavaAppHost/api/package.json | Adds API dependencies including express and OpenTelemetry exporters/SDK. |
| playground/JavaAppHost/AppHost.java | Adds runnable Java AppHost wiring Node API + Vite frontend and publish bundling. |
| playground/JavaAppHost/.modules/Transport.java | Adds generated Java JSON-RPC transport for the JavaAppHost sample. |
| playground/JavaAppHost/.modules/Base.java | Adds generated Java base/runtime helpers for the JavaAppHost sample. |
| playground/JavaAppHost/.modules/.codegen-hash | Adds codegen hash for generated SDK output. |
| .github/workflows/tests.yml | Adds Java SDK unit test job and integrates it into overall results gating. |
| .github/workflows/polyglot-validation/test-java.sh | Updates Java polyglot validation script to create/restore/run a minimal Redis-backed Java AppHost. |
| .github/workflows/polyglot-validation/test-java-playground.sh | Adds script to restore + javac compile all Java validation AppHosts in the playground. |
| .github/workflows/polyglot-validation/Dockerfile.java | Updates Docker image and runs both Java validation scripts in container. |
Files not reviewed (1)
- playground/JavaAppHost/frontend/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
playground/JavaAppHost/.modules/Transport.java:1
- The RandomAccessFile used for the Windows named pipe is a local variable that is never stored/closed. If it becomes GC-eligible, the underlying handle can be closed unexpectedly (via finalization/cleaner), breaking the transport. Store the RandomAccessFile as an instance field to keep it alive for the duration of the connection and close it when disconnecting/shutting down (or avoid RandomAccessFile entirely by opening streams directly against the pipe path if supported).
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
… code generation to split public source files for compact JEP 512 AppHosts, remove checked-in generated playground .modules content, and update validation coverage for the new compile flow.\n\nCo-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
🎬 CLI E2E Test Recordings — 51 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23548548397 |
* Add Java polyglot apphost parity Co-authored-by: Copilot <[email protected]> * Fix Java AppHost CI regressions Co-authored-by: Copilot <[email protected]> * Fix Java validation flows Co-authored-by: Copilot <[email protected]> * Fix Java CI regressions Co-authored-by: Copilot <[email protected]> * Fix polyglot apphost file path defaults Co-authored-by: Copilot <[email protected]> * Fix polyglot createBuilder defaults Co-authored-by: Copilot <[email protected]> * Update Azure SQL snapshots Co-authored-by: Copilot <[email protected]> * Narrow Kusto log assertions Co-authored-by: Copilot <[email protected]> * Revert narrowed Kusto log assertions Co-authored-by: Copilot <[email protected]> * Preserve fluent Java builder return types Co-authored-by: Copilot <[email protected]> * Support compact Java AppHosts and clean playground SDK\n\nSwitch Java code generation to split public source files for compact JEP 512 AppHosts, remove checked-in generated playground .modules content, and update validation coverage for the new compile flow.\n\nCo-authored-by: Copilot <[email protected]> * Update Java E2E test image to JDK 25 Co-authored-by: Copilot <[email protected]> * Split polyglot E2E Dockerfiles Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
Documentation check ✅No documentation PR is required for this change. Reason: This PR introduces experimental Java polyglot AppHost support behind the
When the Java AppHost support reaches a stable, complete state, the [
|
Description
This PR brings Java polyglot AppHost support much closer to the existing TypeScript experience.
Summary:
playground/polyglot/Java/**to mirror the TypeScript playground coverageplayground/JavaAppHostsampletests.ymland the polyglot validation Docker/scripts, including a dedicated Java playground validation scriptEmpty (Java AppHost)behind the experimental Java feature flag.gitignoreentries for Java playground build outputsMotivation/context:
Limitation:
If we want to generate compact source files (https://openjdk.org/jeps/512) like file-based apps in C# we need to explore the currently unique .java sdk file into split classes which would generate a lot of fils in the
.modulesfolder. That wouldn't change the size of the git repo (objects would be reused) but can feel very overwhelming. Likenode_modulesfeel. Current generated code is also compatbile with jdk 17 while jep512 requires jdk 25.To enable the java support, type
aspire config set -g features.experimentalPolyglot:java trueChecklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: