Repository navigation
Honor selected launch profile in bundled dotnet run - #19958
Karol Zadora-Przylecki (karolz-ms) merged 1 commit into
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19958Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19958" |
There was a problem hiding this comment.
🟢 Approval recommended
The precedence behavior is correctly implemented with focused unit and end-to-end regression coverage.
Pull request overview
Honors the launch profile selected by the .NET SDK when bundled execution delegates to Aspire.
Changes:
- Uses
DOTNET_LAUNCH_PROFILEwhen no explicit Aspire option is provided. - Adds unit coverage for precedence, defaults, and missing profiles.
- Extends CLI end-to-end coverage to bundled
dotnet run.
File summaries
| File | Description |
|---|---|
src/Aspire.Cli/Projects/DotNetAppHostProject.cs |
Resolves the effective launch profile. |
tests/Aspire.Cli.Tests/Projects/DotNetAppHostProjectTests.cs |
Tests profile selection and fallback behavior. |
tests/Aspire.Cli.EndToEnd.Tests/LaunchProfileTests.cs |
Verifies explicit and bundled launch paths. |
Review details
- Files reviewed: 3/3 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.
|
@microsoft-github-policy-service agree |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
PR #19958 review and issue #19867 verificationResult: No actionable review findings. The reported Windows failure reproduces with stable Aspire 13.5.3 and is fixed by the reviewed PR source. Revision and scope
The production change is in DotNetAppHostProject.RunAsync. It uses the effective Explicit Behavioral impact and coverage
The E2E change exercises both explicit Aspire selection and the SDK bundle hook, checking the profile name, profile-specific environment variable, arguments, and application URL. Existing runner tests cover forwarding to project, single-file, and watch commands. No new test project, runtime package input, CI job, or test eligibility change was introduced. Environment and artifact identity
Focused tests and negative controlRan dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -p:SkipNativeBuild=true -- --filter-class '*.DotNetAppHostProjectTests' --filter-class '*.DotNetCliRunnerTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'225 total: 222 passed, 3 platform-specific skips, 0 failures. To verify that the new tests detect the bug, temporarily changed only the production selection expression back to
Negative control: 3 failed, 4 passed. Restored the PR expression and reran the same cases: 7 passed, 0 failures. All temporary production edits were removed. Windows runtime scenariosAll nine processes reached AppHost startup and exited with code 0. For the seven PR scenarios, assertions checked the complete profile name, marker, argument list, and application URL.
The Limits and cleanup
|
PR #19958 testing reportResult: PASS for the tested launch-profile behavior. Seven Windows runtime scenarios passed, the focused launcher suite passed 209 tests with five platform skips, and both modified Linux E2E cases passed in the approved CI run. PR and artifact information
CI initially required contributor-workflow approval. After explicit approval, the Windows CLI was installed using the PR's dogfood script with an isolated The source tests ran from a separate, clean checkout of the exact PR commit, not this session's newer Changes analyzed
Only CLI implementation and its unit/E2E tests changed. There were no hosting integration, dashboard, template, VS Code extension, or CI infrastructure changes. 1. Launcher regression suiteStatus: Passed - 209 passed, 0 failed, 5 skipped, 214 total. The selected classes were .\restore.cmd -projects tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj /p:SkipNativeBuild=true
dotnet test `
--project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj `
--no-launch-profile --no-restore `
--results-directory $evidenceDir `
-- `
--filter-class "*.DotNetAppHostProjectTests" `
--filter-class "*.AppHostLauncherTests" `
--filter-not-trait "quarantined=true" `
--filter-not-trait "outerloop=true" `
--report-trx --report-trx-filename launcher-regressions.trxAll seven new or expanded regression cases executed and passed: the five inherited/context/default selection rows and both explicit/inherited missing-profile rows. These include context environment taking precedence over the inherited environment. The five skips cover Windows case-sensitivity, symlink availability, and Unix-only process behavior; none is a new launch-profile regression case. Evidence: 2. Windows runtime scenariosStatus: All seven distinct scenarios passed. Each executed scenario used a fresh The AppHost source was replaced with a small profile-observation fixture. Two launch profiles were installed in deliberate order: For every passing scenario, the harness compared the complete observed profile JSON with the expected object, confirmed AppHost startup, successfully queried
Original repro: proof of bundle delegationThe live process tree contained the exact verified dogfood The running AppHost reported: {
"selectedProfile": "selected-profile",
"launchProfile": "http",
"arguments": [
"--profile-argument",
"selected-profile"
],
"applicationUrl": "http://127.0.0.1:0"
}Missing inherited profile: expected fallback behaviorThe process tree showed the SDK The AppHost reported The diagnostic is captured in the CLI's log, not its normal run-console output. 3. Modified Linux E2E casesStatus: Passed - 2 executed, 2 passed, 0 failed, 0 skipped. The focused CI job ran on the tested PR commit. Its downloaded TRX confirms both theory rows executed:
These are CI results, not a claim that the Linux-only Hex1b harness ran locally on Windows. Evidence: Setup observations and limitations
Evidence and cleanupThe report, reproducible PowerShell harness, C# and launch-settings fixtures, full expected/observed JSON, exact commands, process snapshots, stdout/stderr, CLI diagnostic logs, unit/CI TRX files, and terminal recording are retained in the session's
No files in the working repository were changed. No user PATH, VS Code extension, or certificate trust-store changes were made. Overall conclusionThe tested PR build honors inherited launch-profile selection in bundled |
e5714ca
into
microsoft:main
|
Irakli Gabisonia (@gabisonia) many thanks for helping us make Aspire better! 🤗 |
|
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
With CLI bundles enabled,
dotnet run --launch-profile httpdelegates toaspire run. The .NET SDK passes the selected profile throughDOTNET_LAUNCH_PROFILE, but the Aspire launcher ignored it and selected the first profile again.Use the effective
DOTNET_LAUNCH_PROFILEvalue when no explicit Aspire launch-profile option is provided. This preserves the selection for both direct AppHost launch and the fallback todotnet run; an explicit--launch-profilestill takes precedence.Fixes #19867
Validation
LaunchProfileTestsend-to-end cases passed in Linux ARM64 Docker containers using a locally built CLI bundle. They runaspire run --launch-profile E2Eanddotnet run --launch-profile E2E /p:AspireUseCliBundle=true, asserting the profile name, environment, application URL, and arguments observed by the running AppHost.Checklist