Skip to content

Make Project v2 options polyglot-friendly - #20157

Merged
Karol Zadora-Przylecki (karolz-ms) merged 3 commits into
mainfrom
dev/karolz/project-v2-options
Sep 17, 2026
Merged

Karol Zadora-Przylecki (karolz-ms) merged 3 commits into
mainfrom
dev/karolz/project-v2-options

Conversation

@karolz-ms

Copy link
Copy Markdown
Contributor

Description

Make Project v2 launch options usable from polyglot AppHosts.

The current addDotnetProject export accepts ProjectResourceOptions, which is projected as an RPC handle. Because the generated SDK exposes no way to construct that handle, callers cannot configure named or excluded .NET service launch profiles through this API.

This change introduces an internal [AspireDto] DotnetProjectOptions type specifically for the Project v2 polyglot adapter. Generated callers can pass a plain options object:

const api = await builder.addDotnetProject("api", "../Api/Api.csproj", {
    launchProfileName: "https"
});

The DTO also supports excludeLaunchProfile and excludeKestrelEndpoints, preserving the existing C# option semantics:

  • Omitted or null profile names use the default launch profile.
  • excludeLaunchProfile takes precedence over a supplied profile name.
  • excludeKestrelEndpoints prevents Aspire from deriving model endpoints from Kestrel configuration; it does not modify the service's own Kestrel configuration.

The change is deliberately limited to addDotnetProject. The shared ProjectResourceOptions handle, legacy addProject and addCSharpApp exports, and existing public C# overloads remain unchanged.

Related to #19818. This is a prerequisite for the migration skill, which will be submitted separately. This PR targets main and does not depend on the publishing changes in #19997.

Validation

  • Full Aspire.Hosting.Dotnet.Tests: 162 passed; 3 skipped because Windows symbolic-link privileges were unavailable.
  • Full Aspire.Hosting.CodeGeneration.TypeScript.Tests: 129 passed.
  • New coverage verifies default/named/excluded profiles, exclusion precedence, and independent Kestrel endpoint handling.
  • A generated TypeScript snapshot verifies the flat DTO input and unchanged legacy options/contract shapes.

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 — generated polyglot SDK surface; no new public C# API.
      • 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 — the DTO and adapter are internal; usage examples are in the README.
    • 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

@github-actions

Copy link
Copy Markdown
Contributor

🚀 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 -- 20157

Or

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

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot September 15, 2026 21:10
@github-actions github-actions Bot added the area-integrations Issues pertaining to Aspire Integrations packages label Sep 15, 2026
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The adapter preserves existing semantics and contracts with focused runtime and generated-SDK coverage.

Pull request overview

Adds a DTO-based polyglot adapter for Project v2 launch options while preserving existing C# and legacy ATS contracts.

Changes:

  • Introduces DotnetProjectOptions for generated SDKs.
  • Maps launch-profile and Kestrel options to existing behavior.
  • Adds runtime, code-generation, snapshot, and documentation coverage.
File summaries
File Description
src/Aspire.Hosting.Dotnet/DotnetProjectOptions.cs Defines the polyglot options DTO.
src/Aspire.Hosting.Dotnet/DotnetProjectHostingExtensions.cs Adapts DTO values to ProjectResourceOptions.
src/Aspire.Hosting.Dotnet/README.md Documents C# and TypeScript usage.
tests/Aspire.Hosting.Dotnet.Tests/DotnetProjectOptionsTests.cs Tests profile and endpoint semantics.
tests/Aspire.Hosting.Dotnet.Tests/DotnetProjectBuildCoordinatorTests.cs Updates polyglot coordinator coverage.
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/AtsTypeScriptCodeGeneratorTests.cs Verifies ATS and generated TypeScript shapes.
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj References the Dotnet integration under test.
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/AtsTypeScriptCodeGeneratorTests.Generate_DotnetProjectOptions_UsesDtoWithoutChangingLegacyOptions.verified.txt Captures the generated API contract.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Code review of the Project v2 polyglot options change.

1 finding (test coverage). No bugs, security, correctness, concurrency, or convention issues found.

Verified while reviewing (not flagged):

  • The stale options?: ProjectResourceOptions entry in src/Aspire.Hosting.Dotnet/api/Aspire.Hosting.Dotnet.ats.txt is correct to leave alone — ATS baselines are release artifacts regenerated by generate-ats-diffs.yml and dropped by the CI prefilter.
  • The capability-parameter-type-changed break needs no .tscompat.suppression.txt: SuppressFinalPackageVersion implies DisablePackageBaselineValidation (src/Directory.Build.targets:3), which excludes the package from the TypeScript API compat check.
  • DotnetProjectOptions covers all three ProjectResourceOptions properties, so ApplyProjectResourceOptions loses nothing, and the null-options vs. empty-DTO paths are behaviorally identical.
  • No existing polyglot fixture or playground AppHost passes options to addDotnetProject, so nothing breaks.
  • No eng/github-ci/test-trigger-map.yml change is needed — the new ProjectReference is ProjectGraph-visible (Layer 1), and Aspire.Hosting.Dotnet already routes to job:polyglot.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The adapter preserves existing semantics and includes focused behavioral, contract, and multi-language validation.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@karolz-ms

Copy link
Copy Markdown
Contributor Author

PR testing report

Result: Passed — no product defects found.

Tested current head 2d8c1221 using PR artifact 13.6.0-pr.20157.g2d8c1221 in the repository's Linux PR-test container environment.

Scenario Result Evidence
TypeScript generated SDK ✅ Pass DotnetProjectOptions generated as a flat optional DTO; addDotnetProject(..., options?: DotnetProjectOptions) compiled successfully. Legacy addProject/addCSharpApp option contracts remained handle-based and unchanged.
Python generated SDK ✅ Pass Clean aspire restore, syntax compilation, Pyright with 0 errors, and DTO field serialization.
Go generated SDK ✅ Pass aspire restore, go test ./..., option-object call compilation, and JSON wire serialization of all three fields.
Java generated SDK ✅ Pass aspire restore, JDK 25 javac, option-object call compilation, and DTO map serialization of all three fields.
Default launch profile ✅ Pass Omitted options selected the first/default profile and exposed model URL http://localhost:5111; HTTP response observed profile marker first.
Named launch profile ✅ Pass launchProfileName: "second" produced model URL http://localhost:5222, DOTNET_LAUNCH_PROFILE=second, profile marker second, and a successful HTTP response.
Kestrel endpoint control ✅ Pass Kestrel derivation enabled selected 5333; excludeKestrelEndpoints: true selected launch-profile endpoint 5111.
Exclusion precedence ✅ Pass excludeLaunchProfile: true overrode a supplied "second" profile: project.launchProfile was null, profile environment variables were absent, and the model exposed no URL.
Service Kestrel independence ✅ Pass With model Kestrel derivation disabled, the service's own Kestrel configuration remained active and served HTTP directly on 5333.
Invalid profile ✅ Pass A nonexistent profile failed promptly with exit code 2 and Capability Error: Launch settings file does not contain 'does-not-exist' profile.

The full behavior matrix was initially exercised on cff70cba. The only subsequent commit changed the four polyglot validation fixtures, not product/package source; the four-language contract checks and named-profile runtime smoke were then rerun against exact current head 2d8c1221.

At completion, all 183 PR checks were complete with no failures or pending checks.

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

12 / 99 PR test projects · 3 PR jobs, from 11 changed files.

Selected PR test projects (12 / 99)

Aspire.Cli.EndToEnd.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Radius.Tests, Aspire.Playground.Tests

Selected PR jobs (3)

extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 10 of the 12 selected test projects come from a single change — src/Aspire.Hosting.Dotnet/DotnetProjectHostingExtensions.cs.

🔧 src/Aspire.Hosting.Dotnet/DotnetProjectHostingExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.Dotnet.Tests
→ 9 via the project graph: Aspire.Hosting.Azure.Kubernetes.Tests (2 hops), Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Docker.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Radius.Tests, Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Hosting.Dotnet
→ 1 test: Aspire.Cli.EndToEnd.Tests

🔧 src/Aspire.Hosting.Dotnet/DotnetProjectOptions.cs (changed source)
→ 1 directly: Aspire.Hosting.Dotnet.Tests

🧪 tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj (changed test)
→ 1 directly: Aspire.Hosting.CodeGeneration.TypeScript.Tests

🧪 tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/AtsTypeScriptCodeGeneratorTests.cs (changed test)
→ 1 directly: Aspire.Hosting.CodeGeneration.TypeScript.Tests

🧪 tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/AtsTypeScriptCodeGeneratorTests.Generate_DotnetProjectOptions_UsesDtoWithoutChangingLegacyOptions.verified.txt (changed test)
→ 1 directly: Aspire.Hosting.CodeGeneration.TypeScript.Tests

🧪 tests/Aspire.Hosting.Dotnet.Tests/DotnetProjectBuildCoordinatorTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Dotnet.Tests

🧪 tests/Aspire.Hosting.Dotnet.Tests/DotnetProjectOptionsTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Dotnet.Tests

Job reasons

Job Triggered by
extension-e2e affected project Aspire.Hosting.Blazor
polyglot • tests/PolyglotAppHosts/Aspire.Hosting.Dotnet/Go/apphost.go, tests/PolyglotAppHosts/Aspire.Hosting.Dotnet/Java/AppHost.java, tests/PolyglotAppHosts/Aspire.Hosting.Dotnet/Python/apphost.py, tests/PolyglotAppHosts/Aspire.Hosting.Dotnet/TypeScript/apphost.mts
• affected project Aspire.Hosting.Dotnet
typescript-api-compat affected project Aspire.Hosting.Dotnet

Selection computed for commit 094b152.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The adapter preserves existing contracts and has focused behavioral, generated-contract, and multi-language validation coverage.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@karolz-ms
Karol Zadora-Przylecki (karolz-ms) merged commit f856e00 into main Sep 17, 2026
1356 of 1376 checks passed
@karolz-ms
Karol Zadora-Przylecki (karolz-ms) deleted the dev/karolz/project-v2-options branch September 17, 2026 21:01
aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request Sep 17, 2026
Documents the new DotnetProjectOptions DTO introduced in microsoft/aspire#20157,
which lets polyglot AppHosts pass launchProfileName, excludeLaunchProfile, and
excludeKestrelEndpoints directly to addDotnetProject without needing the
ProjectResourceOptions RPC handle.

Co-authored-by: Copilot <[email protected]>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1695

Generated by PR Documentation Check · auto · 79.7 AIC · ⌖ 8.2 AIC · ⊞ 18K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1695 targeting release/13.6.

Updated dotnet-host.mdx (Configure options section) to document the new DotnetProjectOptions DTO for the polyglot addDotnetProject API: added a C#/TypeScript example showing excludeLaunchProfile and excludeKestrelEndpoints alongside launchProfileName, explained default/exclusion-precedence semantics, and clarified this options object is specific to addDotnetProject and does not change the shared ProjectResourceOptions handle used by addProject/addCSharpApp.

  • Modified: src/frontend/src/content/docs/integrations/frameworks/dotnet/dotnet-host.mdx (existing page updated; no new pages created)

Note

This draft PR needs human review before merging.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ CI Failure Analysis: Possible Flaky Test(s)

The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests.

Suspected flaky test(s):

  • Aspire.Hosting.Azure.Tests.AzureSqlPrincipalReconciliationTests.ReconciliationCreatesThePrincipalWithTheIdentityObjectIdAsItsSid in job Tests / No-package tests (regular, Aspire.Hosting.Azure.Tests, Hosting.Azure, Hosting.Azure, tests/Aspire... / Hosting.Azure (ubuntu-latest)
    • Error: Class fixture type 'Aspire.Hosting.Azure.Tests.SqlServerContainerFixture' threw in InitializeAsync ---- Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"failed to set up container networking: driver failed programming external connectivity on endpoint focused_sanderson (4d064077e98e0d0bfc72772c1119b95271e9d4622fe54a784549279975d56335): failed to bind host port for 0.0.0.0::172.17.0.3:1433/tcp: address already in use"}
    • Stack Trace (first frames):
----- Inner Stack Trace -----
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers) in /_/src/Docker.DotNet/DockerClient.cs:line 494
   at Docker.DotNet.DockerClient.MakeRequestAsync[T](IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token) in /_/src/Docker.DotNet/DockerClient.cs:line 246
   at Docker.DotNet.ContainerOperations.StartContainerAsync(String id, ContainerStartParameters parameters, CancellationToken cancellationToken) in /_/src/Docker.DotNet/Endpoints/ContainerOperations.cs:line 201
   at DotNet.Testcontainers.Clients.TestcontainersClient.StartAsync(String id, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 129
  • Why likely flaky: Docker port 1433 was already bound by another concurrent container on the shared CI runner, causing the shared SqlServerContainerFixture to fail during test-class setup. This is an environmental port-contention issue, not related to the PR's Aspire.Hosting.Dotnet changes, and matches the known recurring 'sqlserver-container-fixture-port-in-use' cause.
  • Aspire.Hosting.Azure.Tests.AzureSqlPrincipalReconciliationTests.ReconciliationHandlesPrincipalNamesRequiringEscaping in job Tests / No-package tests (regular, Aspire.Hosting.Azure.Tests, Hosting.Azure, Hosting.Azure, tests/Aspire... / Hosting.Azure (ubuntu-latest)
    • Error: Class fixture type 'Aspire.Hosting.Azure.Tests.SqlServerContainerFixture' threw in InitializeAsync ---- Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"failed to set up container networking: driver failed programming external connectivity on endpoint focused_sanderson (4d064077e98e0d0bfc72772c1119b95271e9d4622fe54a784549279975d56335): failed to bind host port for 0.0.0.0::172.17.0.3:1433/tcp: address already in use"}
    • Stack Trace (first frames):
----- Inner Stack Trace -----
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers) in /_/src/Docker.DotNet/DockerClient.cs:line 494
   at Docker.DotNet.DockerClient.MakeRequestAsync[T](IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token) in /_/src/Docker.DotNet/DockerClient.cs:line 246
   at Docker.DotNet.ContainerOperations.StartContainerAsync(String id, ContainerStartParameters parameters, CancellationToken cancellationToken) in /_/src/Docker.DotNet/Endpoints/ContainerOperations.cs:line 201
   at DotNet.Testcontainers.Clients.TestcontainersClient.StartAsync(String id, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 129
  • Why likely flaky: Same Docker port 1433 contention failure as the other AzureSqlPrincipalReconciliationTests in this run; environmental, not caused by PR changes.
  • Aspire.Hosting.Azure.Tests.AzureSqlPrincipalReconciliationTests.ReconciliationIsANoOpWhenTheScriptRunsAgain in job Tests / No-package tests (regular, Aspire.Hosting.Azure.Tests, Hosting.Azure, Hosting.Azure, tests/Aspire... / Hosting.Azure (ubuntu-latest)
    • Error: Class fixture type 'Aspire.Hosting.Azure.Tests.SqlServerContainerFixture' threw in InitializeAsync ---- Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"failed to set up container networking: driver failed programming external connectivity on endpoint focused_sanderson (4d064077e98e0d0bfc72772c1119b95271e9d4622fe54a784549279975d56335): failed to bind host port for 0.0.0.0::172.17.0.3:1433/tcp: address already in use"}
    • Stack Trace (first frames):
----- Inner Stack Trace -----
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers) in /_/src/Docker.DotNet/DockerClient.cs:line 494
   at Docker.DotNet.DockerClient.MakeRequestAsync[T](IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token) in /_/src/Docker.DotNet/DockerClient.cs:line 246
   at Docker.DotNet.ContainerOperations.StartContainerAsync(String id, ContainerStartParameters parameters, CancellationToken cancellationToken) in /_/src/Docker.DotNet/Endpoints/ContainerOperations.cs:line 201
   at DotNet.Testcontainers.Clients.TestcontainersClient.StartAsync(String id, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 129
  • Why likely flaky: Same Docker port 1433 contention failure as the other AzureSqlPrincipalReconciliationTests in this run; environmental, not caused by PR changes.
  • Aspire.Hosting.Azure.Tests.AzureSqlPrincipalReconciliationTests.ReconciliationReplacesThePrincipalWhenTheIdentityObjectIdChanges in job Tests / No-package tests (regular, Aspire.Hosting.Azure.Tests, Hosting.Azure, Hosting.Azure, tests/Aspire... / Hosting.Azure (ubuntu-latest)
    • Error: Class fixture type 'Aspire.Hosting.Azure.Tests.SqlServerContainerFixture' threw in InitializeAsync ---- Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"failed to set up container networking: driver failed programming external connectivity on endpoint focused_sanderson (4d064077e98e0d0bfc72772c1119b95271e9d4622fe54a784549279975d56335): failed to bind host port for 0.0.0.0::172.17.0.3:1433/tcp: address already in use"}
    • Stack Trace (first frames):
----- Inner Stack Trace -----
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers) in /_/src/Docker.DotNet/DockerClient.cs:line 494
   at Docker.DotNet.DockerClient.MakeRequestAsync[T](IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token) in /_/src/Docker.DotNet/DockerClient.cs:line 246
   at Docker.DotNet.ContainerOperations.StartContainerAsync(String id, ContainerStartParameters parameters, CancellationToken cancellationToken) in /_/src/Docker.DotNet/Endpoints/ContainerOperations.cs:line 201
   at DotNet.Testcontainers.Clients.TestcontainersClient.StartAsync(String id, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 129
  • Why likely flaky: Same Docker port 1433 contention failure as the other AzureSqlPrincipalReconciliationTests in this run; environmental, not caused by PR changes.
  • Aspire.Hosting.Azure.Tests.AzureSqlPrincipalReconciliationTests.ReconciliationLeavesPrincipalsItDidNotCreateIntact in job Tests / No-package tests (regular, Aspire.Hosting.Azure.Tests, Hosting.Azure, Hosting.Azure, tests/Aspire... / Hosting.Azure (ubuntu-latest)
    • Error: Class fixture type 'Aspire.Hosting.Azure.Tests.SqlServerContainerFixture' threw in InitializeAsync ---- Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"failed to set up container networking: driver failed programming external connectivity on endpoint focused_sanderson (4d064077e98e0d0bfc72772c1119b95271e9d4622fe54a784549279975d56335): failed to bind host port for 0.0.0.0::172.17.0.3:1433/tcp: address already in use"}
    • Stack Trace (first frames):
----- Inner Stack Trace -----
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers) in /_/src/Docker.DotNet/DockerClient.cs:line 494
   at Docker.DotNet.DockerClient.MakeRequestAsync[T](IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token) in /_/src/Docker.DotNet/DockerClient.cs:line 246
   at Docker.DotNet.ContainerOperations.StartContainerAsync(String id, ContainerStartParameters parameters, CancellationToken cancellationToken) in /_/src/Docker.DotNet/Endpoints/ContainerOperations.cs:line 201
   at DotNet.Testcontainers.Clients.TestcontainersClient.StartAsync(String id, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 129
  • Why likely flaky: Same Docker port 1433 contention failure as the other AzureSqlPrincipalReconciliationTests in this run; environmental, not caused by PR changes.
  • Aspire.Hosting.Azure.Tests.AzureSqlPrincipalReconciliationTests.ReconciliationRollsBackWhenTheUserCannotBeRecreated in job Tests / No-package tests (regular, Aspire.Hosting.Azure.Tests, Hosting.Azure, Hosting.Azure, tests/Aspire... / Hosting.Azure (ubuntu-latest)
    • Error: Class fixture type 'Aspire.Hosting.Azure.Tests.SqlServerContainerFixture' threw in InitializeAsync ---- Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"failed to set up container networking: driver failed programming external connectivity on endpoint focused_sanderson (4d064077e98e0d0bfc72772c1119b95271e9d4622fe54a784549279975d56335): failed to bind host port for 0.0.0.0::172.17.0.3:1433/tcp: address already in use"}
    • Stack Trace (first frames):
----- Inner Stack Trace -----
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers) in /_/src/Docker.DotNet/DockerClient.cs:line 494
   at Docker.DotNet.DockerClient.MakeRequestAsync[T](IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token) in /_/src/Docker.DotNet/DockerClient.cs:line 246
   at Docker.DotNet.ContainerOperations.StartContainerAsync(String id, ContainerStartParameters parameters, CancellationToken cancellationToken) in /_/src/Docker.DotNet/Endpoints/ContainerOperations.cs:line 201
   at DotNet.Testcontainers.Clients.TestcontainersClient.StartAsync(String id, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 129
  • Why likely flaky: Same Docker port 1433 contention failure as the other AzureSqlPrincipalReconciliationTests in this run; environmental, not caused by PR changes.
  • Aspire.Hosting.Azure.Tests.AzureSqlPrincipalReconciliationTests.ReconciliationFailsWithoutDamageWhenThePrincipalOwnsASchema in job Tests / No-package tests (regular, Aspire.Hosting.Azure.Tests, Hosting.Azure, Hosting.Azure, tests/Aspire... / Hosting.Azure (ubuntu-latest)
    • Error: Class fixture type 'Aspire.Hosting.Azure.Tests.SqlServerContainerFixture' threw in InitializeAsync ---- Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"failed to set up container networking: driver failed programming external connectivity on endpoint focused_sanderson (4d064077e98e0d0bfc72772c1119b95271e9d4622fe54a784549279975d56335): failed to bind host port for 0.0.0.0::172.17.0.3:1433/tcp: address already in use"}
    • Stack Trace (first frames):
----- Inner Stack Trace -----
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers) in /_/src/Docker.DotNet/DockerClient.cs:line 494
   at Docker.DotNet.DockerClient.MakeRequestAsync[T](IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token) in /_/src/Docker.DotNet/DockerClient.cs:line 246
   at Docker.DotNet.ContainerOperations.StartContainerAsync(String id, ContainerStartParameters parameters, CancellationToken cancellationToken) in /_/src/Docker.DotNet/Endpoints/ContainerOperations.cs:line 201
   at DotNet.Testcontainers.Clients.TestcontainersClient.StartAsync(String id, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 129
  • Why likely flaky: Same Docker port 1433 contention failure as the other AzureSqlPrincipalReconciliationTests in this run; environmental, not caused by PR changes.
  • Aspire Blazor browser debugger E2E hits a managed breakpoint for standalone in job Tests / Run VS Code extension E2E tests / VS Code extension E2E (Windows, browser-debugger)
    • Error: Failed to apply E2E control revision 1789679801465: Error: Timed out after 287955ms waiting for Blazor page 'counter' to become interactive. Last error: .
    • Stack Trace (first frames):
Error: Failed to apply E2E control revision 1789679801465: Error: Timed out after 287955ms waiting for Blazor page 'counter' to become interactive. Last error: <none>. State: {"debugSessions":[{"id":"7ae5a771-4b55-423c-9697-015363a4cb87","type":"monovsdbg_wasm","name":"Wasm Managed Debugger", ...}]}
  • Why likely flaky: This Windows Blazor WASM debugger E2E test times out waiting for the managed debugger session to become interactive, an environment/timing issue unrelated to the PR (which only touches Aspire.Hosting.Dotnet options), matching the recurring 'vscode-extension-e2e-unrelated-logs-unavailable' timeout cause seen 18 times before for the same test/job.

Suggested actions:

  • Re-run the failed CI jobs to confirm if the failure is intermittent
  • If the test continues to fail, consider quarantining it using /quarantine-test <test name> <issue URL>
  • Search existing issues to see if this test is already known to be flaky

You can re-run the failed jobs from the workflow run page.

Karol Zadora-Przylecki (karolz-ms) added a commit that referenced this pull request Sep 23, 2026
## Description

Prepare the Aspire CLI integration for the approval-first
`aspire-project-v2-migration` skill described in #19818.

The official attested `microsoft/aspire-skills` v0.0.3 release is now
embedded and validated through the production fallback path.

### Dependencies

- #19997 — Project v2 publishing support. **Merged.**
- #20157 — Project v2 polyglot options support. **Merged.**
- microsoft/aspire-skills#65 — canonical migration skill, routing,
fixtures, and evaluations. **Merged.**
- microsoft/aspire-skills v0.0.3 — official attested release containing
the migration skill. **Published and embedded.**

### Changes included

- Embed the official attestation-verified v0.0.3 skills archive and
update its metadata, installer version, project resource, and canonical
telemetry hooks.
- Extend the shared test bundle with the migration skill and its
reference files.
- Verify default and explicit-name installation, complete reference-file
contents, exclusion of evaluation assets, and supported project/user
skill locations.
- Validate the real embedded archive through
`EmbeddedAspireSkillsBundleProvider` and the production installer
fallback, including recognizable content from `SKILL.md` and both
migration references.
- Cover skill selection in interactive and chained agent-init flows.
- Cover the migration skill and both reference paths in the Bash and
PowerShell telemetry-hook behavior tests.
- Allow a complete generated bundle refresh to carry synchronized hook
changes outside the dedicated synchronization branch; hook-only and
incomplete refreshes remain blocked, and canonical content is still
verified independently.
- Add focused workflow tests for synchronization-branch,
complete-refresh, hook-only, and incomplete-refresh behavior.
- Link the migration skill from the .NET hosting integration README.
- Rebase the PR onto the current `main` branch and address the Copilot
review findings.

The product API changes belong to #20157, and the skill implementation
belongs to microsoft/aspire-skills#65. Neither is duplicated here.

### Required before merging

- [x] Land the product prerequisites and canonical skill changes.
- [x] Publish the official attested microsoft/aspire-skills v0.0.3
release.
- [x] Run `eng/scripts/update-aspire-skills-bundle.ps1 -Version 0.0.3`
and review the generated archive, metadata, installer/project, and hook
updates.
- [x] Verify the artifact with
`eng/scripts/verify-aspire-skills-bundle.ps1`.
- [x] Validate installation from the actual embedded bundle, not only
the injected test fixture.
- [x] Rebase onto the current `main` branch.
- [ ] Complete final integration review and CI.

### Validation

- `./restore.sh`
- `dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj
--no-launch-profile -- --filter-class "*.AspireSkillsInstallerTests"
--filter-class "*.AspireSkillsBundleTests" --filter-class
"*.AgentInitCommandTests" --filter-class "*.TelemetryHookInstallerTests"
--filter-class "*.TelemetryHookScriptTests" --filter-not-trait
"quarantined=true" --filter-not-trait "outerloop=true"`
  - **175 passed**, 0 failed, 1 platform-specific skip.
- `dotnet test --project
tests/Infrastructure.Tests/Infrastructure.Tests.csproj
--no-launch-profile -- --filter-class "*.SelectTestsWorkflowTests"
--filter-not-trait "quarantined=true" --filter-not-trait
"outerloop=true"`
  - **11 passed**, 0 failed, 0 skipped.
- `dotnet test --project
tests/Infrastructure.Tests/Infrastructure.Tests.csproj
--no-launch-profile -- --filter-class
"*.VerifyTelemetryHookChangesWorkflowTests" --filter-not-trait
"quarantined=true" --filter-not-trait "outerloop=true"`
  - **8 passed**, 0 failed, 0 skipped.
- `eng/scripts/verify-aspire-skills-bundle.ps1`
- Verified `aspire-skills-v0.0.3.tgz` against its GitHub artifact
attestation.
- Verified both embedded telemetry hooks against
`microsoft/aspire-skills` commit
`a83ca78b9d35b8238f9c4fdba72cb779defe2a90`.
- `dotnet run --project tools/SelectTests -- --changed-files <full PR
file list> --explain`
- All changed files were attributed; selected `Aspire.Cli.Tests`,
`Aspire.Cli.EndToEnd.Tests`, `Infrastructure.Tests`, and the expected
CLI-dependent jobs.
- `git diff --check`

No container validation is required for this bundle integration.

Part of #19818.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship after final review and CI.
  - [ ] 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 <[email protected]>
David Pine (IEvangelist) pushed a commit to microsoft/aspire.dev that referenced this pull request Sep 24, 2026
)

Documents the new DotnetProjectOptions DTO introduced in microsoft/aspire#20157,
which lets polyglot AppHosts pass launchProfileName, excludeLaunchProfile, and
excludeKestrelEndpoints directly to addDotnetProject without needing the
ProjectResourceOptions RPC handle.

Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants