Expose missing Docker Compose polyglot APIs#16364
Conversation
Expose the missing Docker Compose polyglot APIs by exporting ConfigureComposeFile, the parameter-builder AsEnvironmentPlaceholder overload, and GetHostAddressExpression. Update the checked-in API surface and Docker polyglot validation apphosts to cover the expanded export set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16364Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16364" |
There was a problem hiding this comment.
Pull request overview
This PR expands the polyglot (ATS) export surface for Aspire.Hosting.Docker so TypeScript/Python/Java AppHosts can customize Docker Compose publishing with the same key APIs available in .NET.
Changes:
- Exported Docker Compose customization APIs to ATS (notably
ConfigureComposeFile(...),GetHostAddressExpression(...), and the parameter-builderAsEnvironmentPlaceholder(...)overload). - Exported the minimal Docker Compose model types needed for
ConfigureComposeFile(...)callbacks. - Updated polyglot validation AppHosts (TypeScript, Python, Java) to cover the newly exported APIs and regenerated the checked-in API surface file.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/PolyglotAppHosts/Aspire.Hosting.Docker/TypeScript/apphost.ts | Adds validation coverage for compose-file customization, host-address expressions, and env placeholders (but currently calls the wrong ReferenceExpression API). |
| tests/PolyglotAppHosts/Aspire.Hosting.Docker/Python/apphost.py | Adds validation coverage for the new compose APIs (but currently references a non-existent ReferenceExpression member). |
| tests/PolyglotAppHosts/Aspire.Hosting.Docker/Java/AppHost.java | Adds validation coverage for the new compose APIs (but currently calls the wrong ReferenceExpression API). |
| src/Aspire.Hosting.Docker/api/Aspire.Hosting.Docker.cs | Regenerates/updates exported ATS surface to include missing compose APIs and required compose model types. |
| src/Aspire.Hosting.Docker/Resources/ServiceNodes/Volume.cs | Exposes Volume properties to ATS so compose callbacks can mutate/inspect volume definitions. |
| src/Aspire.Hosting.Docker/Resources/ComposeNodes/ServiceDependency.cs | Exposes ServiceDependency properties to ATS for compose callback access. |
| src/Aspire.Hosting.Docker/Resources/ComposeNodes/Secret.cs | Exposes Secret properties to ATS for compose callback access. |
| src/Aspire.Hosting.Docker/Resources/ComposeNodes/Network.cs | Exposes Network properties to ATS for compose callback access. |
| src/Aspire.Hosting.Docker/Resources/ComposeNodes/Config.cs | Exposes Config properties to ATS for compose callback access. |
| src/Aspire.Hosting.Docker/Resources/ComposeFile.cs | Exposes ComposeFile properties to ATS to enable ConfigureComposeFile(...) callbacks. |
| src/Aspire.Hosting.Docker/DockerComposeServiceExtensions.cs | Exports the parameter-builder AsEnvironmentPlaceholder(...) overload and refines ignore reasons for non-ATS-compatible overloads. |
| src/Aspire.Hosting.Docker/DockerComposeEnvironmentResource.cs | Exports GetHostAddressExpression(...) to ATS for polyglot use. |
| src/Aspire.Hosting.Docker/DockerComposeEnvironmentExtensions.cs | Exports ConfigureComposeFile(...) to ATS and updates XML docs to reflect its intended use. |
| src/Aspire.Hosting.Docker/DockerComposeAspireDashboardResource.cs | Minor attribute qualification cleanup (no functional change). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
|
🎬 CLI E2E Test Recordings — 72 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #24753616032 |
|
No documentation PR is required for this change. Reason: This PR exposes existing Docker Compose APIs (
|
Description
TypeScript and other polyglot AppHosts could already publish with Docker Compose, but the exported ATS surface was still missing key Docker Compose customization APIs. This change exposes the missing Docker Compose polyglot APIs, regenerates the checked-in API surface file, and updates the Docker polyglot validation apphosts in TypeScript, Python, and Java to cover the expanded surface.
Notable details:
ConfigureComposeFile(...)andGetHostAddressExpression(...)for Docker Compose environments.AsEnvironmentPlaceholder(...)overload for Docker Compose services.IManifestExpressionProviderplaceholder overload ignored because that parameter type is not ATS-compatible.ConfigureComposeFile(...)callbacks.Fixes #16363
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: