Repository navigation
Make Project v2 options polyglot-friendly - #20157
Conversation
Co-authored-by: Copilot App <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20157Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20157" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 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
DotnetProjectOptionsfor 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.
Karol Zadora-Przylecki (karolz-ms)
left a comment
There was a problem hiding this comment.
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?: ProjectResourceOptionsentry insrc/Aspire.Hosting.Dotnet/api/Aspire.Hosting.Dotnet.ats.txtis correct to leave alone — ATS baselines are release artifacts regenerated bygenerate-ats-diffs.ymland dropped by the CI prefilter. - The
capability-parameter-type-changedbreak needs no.tscompat.suppression.txt:SuppressFinalPackageVersionimpliesDisablePackageBaselineValidation(src/Directory.Build.targets:3), which excludes the package from the TypeScript API compat check. DotnetProjectOptionscovers all threeProjectResourceOptionsproperties, soApplyProjectResourceOptionsloses nothing, and the null-options vs. empty-DTO paths are behaviorally identical.- No existing polyglot fixture or playground AppHost passes
optionstoaddDotnetProject, so nothing breaks. - No
eng/github-ci/test-trigger-map.ymlchange is needed — the newProjectReferenceis ProjectGraph-visible (Layer 1), andAspire.Hosting.Dotnetalready routes tojob:polyglot.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <[email protected]>
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
PR testing reportResult: Passed — no product defects found. Tested current head
The full behavior matrix was initially exercised on At completion, all 183 PR checks were complete with no failures or pending checks. |
Co-authored-by: Copilot App <[email protected]>
Tests selector12 / 99 PR test projects · 3 PR jobs, from 11 changed files. Selected PR test projects (12 / 99)
Selected PR jobs (3)
How these were chosen — grouped by what changed
🔧 📦 affected project 🔧 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟢 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
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
f856e00
into
main
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]>
|
Pull request created: #1695
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1695 targeting Updated
Note This draft PR needs human review before merging. |
|
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):
Suggested actions:
You can re-run the failed jobs from the workflow run page. |
## 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]>
) 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]>
Description
Make Project v2 launch options usable from polyglot AppHosts.
The current
addDotnetProjectexport acceptsProjectResourceOptions, 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]DotnetProjectOptionstype specifically for the Project v2 polyglot adapter. Generated callers can pass a plain options object:The DTO also supports
excludeLaunchProfileandexcludeKestrelEndpoints, preserving the existing C# option semantics:excludeLaunchProfiletakes precedence over a supplied profile name.excludeKestrelEndpointsprevents 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 sharedProjectResourceOptionshandle, legacyaddProjectandaddCSharpAppexports, 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
mainand does not depend on the publishing changes in #19997.Validation
Aspire.Hosting.Dotnet.Tests: 162 passed; 3 skipped because Windows symbolic-link privileges were unavailable.Aspire.Hosting.CodeGeneration.TypeScript.Tests: 129 passed.Checklist
<remarks />and<code />elements on your triple slash comments?