Skip to content

Expose missing Docker Compose polyglot APIs#16364

Merged
sebastienros merged 4 commits intomainfrom
sebastienros/expose-docker-compose-ts-apis
Apr 22, 2026
Merged

Expose missing Docker Compose polyglot APIs#16364
sebastienros merged 4 commits intomainfrom
sebastienros/expose-docker-compose-ts-apis

Conversation

@sebastienros
Copy link
Copy Markdown
Contributor

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:

  • Export ConfigureComposeFile(...) and GetHostAddressExpression(...) for Docker Compose environments.
  • Export the parameter-builder AsEnvironmentPlaceholder(...) overload for Docker Compose services.
  • Keep the IManifestExpressionProvider placeholder overload ignored because that parameter type is not ATS-compatible.
  • Export the minimal Compose model types needed by ConfigureComposeFile(...) callbacks.

Fixes #16363

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

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>
Copilot AI review requested due to automatic review settings April 21, 2026 23:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16364

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16364"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-builder AsEnvironmentPlaceholder(...) 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).

Comment thread tests/PolyglotAppHosts/Aspire.Hosting.Docker/TypeScript/apphost.ts Outdated
Comment thread tests/PolyglotAppHosts/Aspire.Hosting.Docker/Java/AppHost.java Outdated
Comment thread tests/PolyglotAppHosts/Aspire.Hosting.Docker/Python/apphost.py Outdated
@sebastienros sebastienros requested a review from davidfowl April 21, 2026 23:41
sebastienros and others added 3 commits April 21, 2026 16:45
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>
@github-actions
Copy link
Copy Markdown
Contributor

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.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@github-actions
Copy link
Copy Markdown
Contributor

🎬 CLI E2E Test Recordings — 72 recordings uploaded (commit a50e689)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJavaEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateJavaAppHostWithViteApp ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DashboardRunWithOtelTracesReturnsNoTraces ▶️ View Recording
DeployK8sBasicApiService ▶️ View Recording
DeployK8sWithGarnet ▶️ View Recording
DeployK8sWithMongoDB ▶️ View Recording
DeployK8sWithMySql ▶️ View Recording
DeployK8sWithPostgres ▶️ View Recording
DeployK8sWithRabbitMQ ▶️ View Recording
DeployK8sWithRedis ▶️ View Recording
DeployK8sWithSqlServer ▶️ View Recording
DeployK8sWithValkey ▶️ View Recording
DeployTypeScriptAppToKubernetes ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance ▶️ View Recording
DoListStepsShowsPipelineSteps ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InitTypeScriptAppHost_AugmentsExistingViteRepoAtRoot ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
OtelLogsReturnsStructuredLogsFromStarterApp ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithConfigureEnvFileUpdatesEnvOutput ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
PublishWithoutOutputPathUsesAppHostDirectoryDefault ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RestoreRefreshesGeneratedSdkAfterAddingIntegration ▶️ View Recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View Recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
UnAwaitedChainsCompileWithAutoResolvePromises ▶️ View Recording

📹 Recordings uploaded automatically from CI run #24753616032

@sebastienros sebastienros merged commit 17db348 into main Apr 22, 2026
562 of 565 checks passed
@sebastienros sebastienros deleted the sebastienros/expose-docker-compose-ts-apis branch April 22, 2026 17:38
@github-actions github-actions Bot added this to the 13.3 milestone Apr 22, 2026
@aspire-repo-bot
Copy link
Copy Markdown
Contributor

No documentation PR is required for this change.

Reason: This PR exposes existing Docker Compose APIs (ConfigureComposeFile, GetHostAddressExpression, AsEnvironmentPlaceholder) to polyglot AppHosts (TypeScript/Python/Java) via ATS export attributes, and fixes a TypeScript code generator bug where the target parameter was incorrectly included in user-visible parameter lists. No new public .NET APIs were added, and the underlying behavior for C# AppHost developers is unchanged. The existing Docker Compose and polyglot AppHost documentation already covers this feature area adequately.

Generated by PR Documentation Check for issue #16364 · ● 276.2K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose missing Docker Compose polyglot APIs to TypeScript AppHosts

3 participants