Repository navigation
[release/17.0] Fix Radius container image exports for TypeScript - #22014
Closed
Mitch Denny (mitchdenny) wants to merge 1 commit into
Closed
Mitch Denny (mitchdenny) wants to merge 1 commit into
Mitch Denny (mitchdenny) wants to merge 1 commit into
Conversation
## Description Restores Radius's `withContainerImage(image)` method on `DotnetProjectResource` in generated TypeScript AppHosts. Overlapping legacy and generic exports previously caused a collision on `CSharpAppResource` that removed the generic capability for every target, including modern .NET projects. Export the generic overload once using the existing `Aspire.Hosting.Radius/withContainerImage` capability ID, and exclude the legacy overload from ATS discovery. Both public C# overloads and scanner collision policy remain unchanged. Add real-assembly generation/scanning and runtime-dispatch regressions for legacy projects, file-based apps, and modern .NET projects. No new external package dependencies are required. Fixes #21803 ### User-facing usage With the Radius and Dotnet integrations referenced, TypeScript AppHosts can again use: ```typescript await builder.addDotnetProject("api", "../Api/Api.csproj") .withContainerImage("ghcr.io/myorg/api:v1"); ``` The corresponding C# API is unchanged: ```csharp builder.AddDotnetProject("api", "../Api/Api.csproj") .WithContainerImage("ghcr.io/myorg/api:v1"); ``` ### Compatibility The retained capability now targets and returns `IDotnetProgramResource` in ATS metadata, while generated methods preserve each resource's concrete fluent return type. A scoped compatibility suppression records that intentional metadata generalization; generated release baselines are untouched. The separate earlier-preview `Aspire.Hosting.Radius/withDotnetProgramContainerImage` capability ID is retired. SDKs generated against that preview ID must be regenerated. ### Validation Reproduced the missing method with Aspire CLI/SDK 13.6.4 and the integration versions from the issue. Strict TypeScript compilation failed for the modern resource before the fix and passed against the patched generated SDK. The following commands passed on macOS ARM64 with Podman selected. Quarantined and outerloop tests were excluded. No live Radius deployment was run. ```bash export ASPIRE_CONTAINER_RUNTIME=podman MSBUILDTERMINALLOGGER=false # Passed: 4 tests. ./dotnet.sh test --project tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj --no-launch-profile -- --filter-method '*.Generate_RadiusWithContainerImage_*' --filter-method '*.Generate_LegacyAddProject_RetainsDeprecatedBuilderMethod' --filter-method '*.Generate_DotnetProjectOptions_UsesDtoWithoutChangingLegacyOptions' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Passed: 4 tests. ./dotnet.sh test --project tests/Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.csproj --no-launch-profile -- --filter-method '*.Invoke_RadiusWithContainerImage_*' --filter-method '*.ScanAssembly_TargetSpecificMethodShadowsGenericExpandedMethodOnlyForThatTarget' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Passed: 665 tests. ./dotnet.sh test --project tests/Aspire.Hosting.Radius.Tests/Aspire.Hosting.Radius.Tests.csproj --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' ``` The patched generated SDK also passed the following command from an isolated TypeScript AppHost containing concrete and promise-chain calls for all three resource types: ```bash node node_modules/typescript/bin/tsc --noEmit --module nodenext --target es2022 --strict --types node smoke.mts ``` Fresh ATS compatibility validation passed with exactly one declared return-type-change suppression and no undeclared breaks. Evaluated test-selection traces reach both new regression consumers from Radius production changes and select the compatibility job for the suppression file. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] 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 - [x] 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 - [x] No Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 399e3e6)
14 tasks
This comment has been minimized.
This comment has been minimized.
Mitch Denny (mitchdenny)
marked this pull request as ready for review
November 10, 2026 04:31
Member
Author
|
Approved for inclusion in release/17.0. Do not merge yet. |
Mitch Denny (mitchdenny)
requested review from
James Newton-King (JamesNK),
Adam Ratzman (adamint),
David Negstad (danegsta),
David Fowler (davidfowl),
Eric Erhardt (eerhardt),
Ella Hathaway (ellahathaway),
Karol Zadora-Przylecki (karolz-ms) and
Ankit Jain (radical)
as code owners
November 10, 2026 05:36
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-17-pr21830
branch
from
November 10, 2026 05:38
831949b to
f340ca8
Compare
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22014Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22014" |
This comment has been minimized.
This comment has been minimized.
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-17-pr21830
branch
from
November 10, 2026 06:57
f340ca8 to
831949b
Compare
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-17-pr21830
branch
from
November 10, 2026 07:21
831949b to
f340ca8
Compare
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-17-pr21830
branch
from
November 10, 2026 09:08
f340ca8 to
831949b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #21830 to
release/17.0(cherry-picked from 399e3e6 with no modifications). Layer 17 of 55 in the release/17.0 backport stack; stacked on #22013.Backport recommendation: Yes — Restores missing withContainerImage in TypeScript AppHosts.
Backport of #21830
Checklist
<remarks />and<code />elements on your triple slash comments?