Expose WithComputeEnvironment to polyglot AppHosts#17093
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Exposes the existing WithComputeEnvironment<T> extension method to polyglot AppHosts by replacing its [AspireExportIgnore] attribute with [AspireExport], and adds usage examples in the Kubernetes and Docker polyglot test apphosts (TypeScript, Java, Python, Go).
Changes:
- Switch
WithComputeEnvironmentfromAspireExportIgnoretoAspireExportand remove the "not available in polyglot app hosts" remark. - Add
withComputeEnvironment(...)calls in Kubernetes polyglot apphost samples across all 4 languages. - Add
withComputeEnvironment(...)calls in Docker polyglot apphost samples across all 4 languages.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Hosting/ResourceBuilderExtensions.cs | Replace AspireExportIgnore with AspireExport on WithComputeEnvironment and drop the polyglot-unavailable remark. |
| tests/PolyglotAppHosts/Aspire.Hosting.Kubernetes/TypeScript/apphost.ts | Exercise withComputeEnvironment on the Kubernetes container resource. |
| tests/PolyglotAppHosts/Aspire.Hosting.Kubernetes/Python/apphost.py | Exercise with_compute_environment on the Kubernetes container resource. |
| tests/PolyglotAppHosts/Aspire.Hosting.Kubernetes/Java/AppHost.java | Exercise withComputeEnvironment on the Kubernetes container resource. |
| tests/PolyglotAppHosts/Aspire.Hosting.Kubernetes/Go/apphost.go | Exercise WithComputeEnvironment on the Kubernetes container resource. |
| tests/PolyglotAppHosts/Aspire.Hosting.Docker/TypeScript/apphost.ts | Exercise withComputeEnvironment binding api to the compose environment. |
| tests/PolyglotAppHosts/Aspire.Hosting.Docker/Python/apphost.py | Exercise with_compute_environment binding api to the compose environment. |
| tests/PolyglotAppHosts/Aspire.Hosting.Docker/Java/AppHost.java | Exercise withComputeEnvironment binding api to the compose environment. |
| tests/PolyglotAppHosts/Aspire.Hosting.Docker/Go/apphost.go | Exercise WithComputeEnvironment binding api to the compose environment. |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17093Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17093" |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ssue-17085-expose-withcomputeenv
|
❓ CLI E2E Tests unknown — 86 passed, 0 failed, 1 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #26044248100 |
…Docker integration pages WithComputeEnvironment is now available in polyglot (TypeScript, Python, Java, Go) app hosts as of microsoft/aspire#17093. Expand the existing tip asides on the Kubernetes and Docker integration pages to include C# and TypeScript code examples showing how to call the API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pull request created: #997
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#997 targeting The Note This draft PR needs human review before merging. |
* Expose WithComputeEnvironment to polyglot AppHosts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update polyglot codegen snapshots Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
WithComputeEnvironmentwas already available to C# app hosts but was excluded from the ATS/polyglot surface becauseIComputeEnvironmentResourcewas previously considered incompatible. The export path already supports resource-builder interface parameters likePublishWithContainerFiles, so this exposes the existing extension directly for polyglot app hosts.This also updates the TypeScript, Java, Python, and Go polyglot apphost samples for Kubernetes and Docker so the generated SDKs compile calls against different
IComputeEnvironmentResourceimplementations.Fixes: #17085
Checklist
<remarks />and<code />elements on your triple slash comments?