Repository navigation
[release/17.0] Fix AppHost channel updates and restore diagnostics - #22219
Jose Perez Rodriguez (joperezr) merged 12 commits into
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
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 -- 22219Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22219" |
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. |
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. |
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. |
|
Discussed offline. Let's target this for 17.0.1 as we'll want to get a couple of other changes ported as well and get them all in at the same time, as well as run more tests on this. |
## Summary Consolidates the open `docs-from-code` PRs that cover features from @IEvangelist's product work or that request their review, all targeting `release/17.0`, into this single PR. Each PR was checked against its merged microsoft/aspire source PR and against product `release/17.0`, to confirm the change shipped in 17.0 and is user-facing rather than an implementation detail. Accepted text was corrected where the bot's wording was inaccurate. | PR(s) | Verdict | Notes | | --- | --- | --- | | #2103, #2098, #1967, #2073, #2070 | Accepted with fixes | Go AppHost conventions, `aspire init`, and VS Code extension. Unrelated e2e test edits from #2073 were dropped. | | #1972 | Partially accepted | Only the verified behavior was kept. | | #2069, #2064, #1829 | Accepted with fixes | Dashboard explore page and `aspire describe --format Mermaid` | | #2044 | Partially accepted | The Cards/Home/Graph layout selector text is outdated, so it was dropped. | | #1959, #1904, #1835, #1801 | Accepted with fixes | `WithTerminal` options, the dashboard terminal UX, and TypeScript `configure` | | #1902 | Accepted with fixes | `dotnet run --operation publish` guidance | | #2081 | Accepted with fixes | WSLc limited publish support. The minimum version is corrected to 3.0.4.0. | | #2014, #1862, #1809, #1936, #2140, #1997, #2051, #2068, #2022, #1963 | Accepted with fixes | DCP timeouts, the container tunnel base image, browser origins, the PVC `WithConfiguration` API, the interaction service caution, secrets, `aspire update`, and agent init telemetry | | #2092 | Rejected | Documents implementation details. | | #2078 | Rejected | Already documented correctly; the proposed text was wrong. | | #2110, #2104, #2085, #2094 | Rejected | The product change isn't in `release/17.0`; it's 17.1-only. Redo these against the next release branch. | | #2133 | Rejected for now | Its backport, microsoft/aspire#22219, is still open, so redo this once it merges. | Additional consistency fixes: - **WSLc:** the minimum version is now 3.0.4.0, the source's `MinimumWslcVersion`, across prerequisites, `aspire doctor`, configuration, and what's new. The pages now describe limited publish support and state that Docker Compose isn't supported. - **`WithTerminal`:** `WithTerminal` and `TerminalOptions` are no longer `[Experimental]` in 17.0. I removed the stale `ASPIRETERMINAL001` pragmas and cautions and rewrote the diagnostic page to cover the terminal APIs that are still experimental. Closes #2140 Closes #2133 Closes #2110 Closes #2104 Closes #2103 Closes #2098 Closes #2094 Closes #2092 Closes #2085 Closes #2081 Closes #2078 Closes #2073 Closes #2070 Closes #2069 Closes #2068 Closes #2064 Closes #2051 Closes #2044 Closes #2022 Closes #2014 Closes #1997 Closes #1972 Closes #1967 Closes #1963 Closes #1959 Closes #1936 Closes #1904 Closes #1902 Closes #1862 Closes #1835 Closes #1829 Closes #1809 Closes #1801 ## Third-party links and affiliations None. The only added external link is to mermaid.js.org, which the page already links elsewhere. ## Validation - I compared each claim with the merged microsoft/aspire source and checked that it's included in product `release/17.0`, using `gh api compare` and searches for backport PRs. - I checked the TypeScript sample against the generated `aspire.d.ts`. `EndpointReferenceExpression` is an `IValueProvider`. - I reviewed the full diff by hand for MDX and table formatting, imports, and anchors. The new `seoTitle` is 58 characters. - I didn't run any local unit, e2e, or build commands because frontend dependencies aren't installed locally. CI covers the build, unit, and e2e checks, including the updated `custom-components.spec.ts` assertion. --------- Co-authored-by: David Pine <[email protected]> Co-authored-by: Copilot App <[email protected]>
(cherry picked from commit 164d249) Co-authored-by: Copilot App <[email protected]>
(cherry picked from commit 30326eb) Co-authored-by: Copilot App <[email protected]>
…2208) (cherry picked from commit 79127e0) Co-authored-by: Copilot App <[email protected]>
Preserve automatic response-file suppression alongside isolated validation restore options, with coverage for all restore option combinations. 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. |
|
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. |
PR Testing ReportPR Information
Artifact Version Verification
The dogfood command from the PR comment was run inside the repository container runner: curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22219The installer reported a nested The runner image did not include Changes AnalyzedCategories: CLI implementation, CLI unit/E2E tests, documentation, and localized CLI resources. No hosting integration, dashboard, template implementation, extension, or CI-infrastructure changes. Principal changed files:
Test Setup and CommandsEach scenario began with a fresh project created by CLI=/workspace/.aspire/dogfood/pr-22219/bin/aspire
HIVE=/workspace/.aspire/hives/pr-22219/packages
VERSION=17.0.0-pr.22219.ga6458f63
export DOTNET_ROOT=/workspace/.dotnet
export PATH=/workspace/.dotnet:/workspace/.aspire/dogfood/pr-22219/bin:$PATH
"$CLI" new aspire-empty --name TestApp --output "/workspace/<scenario>" \
--language csharp --source "$HIVE" --version "$VERSION" \
--localhost-tld false --suppress-agent-init --use-config-source false \
--non-interactive --nologoResult: All eleven fresh-project creations passed. The smoke project retained its generated file-based AppHost. Update scenarios converted their generated project into an SDK-style Two separately named hives, The commands below ran from their respective scenario directory. Synthetic dependency packages and synthetic URL credentials were test fixtures; no real credentials were introduced. Source/configuration/lockfile/restore-output comparisons used exact file bytes. Test Scenarios Executed1. Artifact, template, and lifecycle smokeCoverage: Happy path. Status: Passed. Created a fresh file-based C# AppHost, then ran: "$CLI" start --apphost /workspace/smoke/apphost.cs --non-interactive --isolated --format Json
"$CLI" describe --apphost /workspace/smoke/apphost.cs --format Json --non-interactive
"$CLI" stop --apphost /workspace/smoke/apphost.cs --non-interactiveObserved: Startup succeeded, describe returned Evidence: 2. Configured channel applicationCoverage: Happy path, feed-only update. Status: Passed. Configured "$CLI" update --apphost AppHost.csproj --yes --non-interactive --nuget-config-dir .Observed: Output identified the configured channel; its hive source was persisted. Project and Aspire configuration files remained byte-identical. An Evidence: 3. Explicit channel precedenceCoverage: Boundary. Status: Passed. Started with "$CLI" update --apphost AppHost.csproj --channel explicit-test --yes --non-interactive --nuget-config-dir .Observed: Persisted channel and NuGet source selected Evidence: 4. No-channel native NuGet compatibilityCoverage: Compatibility boundary. Status: Passed. Omitted configured and command-line channels. Supplied the PR hive as an ordinary ambient source alongside the mirror. "$CLI" update --apphost AppHost.csproj --yes --non-interactiveObserved: The package version range was normalized and a native restore completed. The entire NuGet configuration remained byte-identical and no Aspire channel setting was introduced. Evidence: 5. Successful isolated dry runCoverage: Happy path and non-mutation boundary. Status: Passed. Seeded a local synthetic dependency and warm ambient restore, removed the temporary seed-hive source, and validated a candidate channel: dotnet restore AppHost.csproj --force --no-http-cache --packages /workspace/dry-success/cache
"$CLI" update --apphost AppHost.csproj --channel configured-test --dry-run --non-interactiveObserved: Output confirmed validation succeeded and no update was applied. Project source, Aspire/NuGet configuration, lockfile, assets, and generated restore props/targets remained byte-identical. Recovery backups were removed; the original cached dependency remained. Evidence: 6. Existing recovery-backup protectionCoverage: Unhappy path. Status: Passed. Created an existing "$CLI" update --apphost AppHost.csproj --channel configured-test --dry-run --yes --non-interactiveExpected/observed: Nonzero exit without replacing the existing backup. Project/configuration/restore files and the backup contents remained unchanged. Evidence: 7. Invalid dry-run option combinationsCoverage: Three unhappy-path cases. Status: Passed. "$CLI" update --apphost AppHost.csproj --dry-run --non-interactive
"$CLI" update --apphost AppHost.csproj --dry-run --channel configured-test --self --non-interactive
"$CLI" update --apphost AppHost.csproj --dry-run --channel configured-test --migrate --non-interactiveExpected/observed: All three commands rejected invalid combinations with nonzero exits. Source and configuration files remained unchanged. Evidence: 8. Warm-cache-only dependency rejectionCoverage: Unhappy path and cold-cache boundary. Status: Passed. Restored a synthetic dependency, removed its only feed package, and confirmed an ordinary warm restore still succeeded. Then: dotnet restore AppHost.csproj --force --no-http-cache --packages /workspace/dry-failure/cache
"$CLI" update --apphost AppHost.csproj --channel configured-test --dry-run --non-interactive --log-level debugExpected/observed: The dry run failed with Evidence: 9. Native restore diagnostics and credential redactionCoverage: Unhappy path. Status: Passed. Used a synthetic credential-bearing source pointing at an unavailable loopback endpoint: "$CLI" update --apphost AppHost.csproj --channel configured-test --dry-run --non-interactive \
--log-level trace --log-file /workspace/diagnostics-cli.logExpected/observed: Nonzero exit with native This verifies the selected known-source case only; redaction remains best effort, not a general security guarantee. Evidence: 10. Multiple package edits without graph restoreCoverage: Happy path with unavailable unrelated dependency. Status: Passed. Used three Aspire package ranges and a non-Aspire dependency unavailable from both source and scenario cache: "$CLI" update --apphost AppHost.csproj --yes --non-interactive --nuget-config-dir .Observed: Redis, PostgreSQL, and Kafka package ranges were all normalized to the channel version. Update succeeded despite the missing unrelated dependency; no graph restore marker was written. Evidence: 11. Declining the NuGet policy previewCoverage: Interactive rejection. Status: Passed. Ran the same update without "$CLI" update --apphost AppHost.csproj --nuget-config-dir .Observed: Original project and configuration bytes were unchanged both while the policy preview was awaiting input and after rejection. Command exited successfully and performed no graph restore. The Hex1b MCP terminal could not start because its native PTY library was missing. A Python-standard-library PTY drove this manual interaction instead; no repository E2E tests were run. Evidence: Summary
Final Overall Result and LimitationsPassed: all 11 targeted artifact scenario groups. No new product defect was observed. This is not a blanket claim that all PR checks pass. The previously diagnosed four CI E2E failures at CLI self-update prompts remain known failures, acknowledged by the author. The separate release/17.0 version prerequisite remains: this PR is still branded The earlier focused unit run at this same head passed 804 tests, with 2 skipped; those unit tests were not rerun here. This run covered native Linux arm64 artifact behavior, not Windows/macOS artifacts, TypeScript runtime behavior, global-channel precedence, or the full CI matrix. ArtifactsReport, scenario logs, copied CLI logs, raw/plain-text interactive transcript, assertion harnesses, and No product or test changes were committed, pushed, or made to the PR during this testing run. |
|
IMO the important things to backport is providing more diagnostics for failure, and keeping file changes on failure. |
It's moving an existing feature behind a flag. We were testing the restore and rolling back on failure, this moves that behind a flag and switches the default back to applying the config regardless of whether restore succeeds or not. |
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. |
## Description Test-only change for `release/17.0`. It fixes CLI E2E failures that show up on unrelated release PRs (for example #22401 and #22362). There are no product changes. **1. ConfigSource brownfield adoption test.** This ports only the `ConfigSourceTestContext` test fix from #22182, which is already merged on `main` and is also part of the open backport #22219. `Update_AcceptingConfigurationSourceUpdatesBrownfieldConfiguration` assumed the old SDK version and an exact JSON property order. With this change, the test: - runs `aspire update --yes --nuget-config-dir .` - sets the expected `sdk.version` from the AppHost - compares the result with `JsonNode.DeepEquals` **2. Post-update CLI self-update prompt.** After the project update, `aspire update` may ask `An update is available for the Aspire CLI. Would you like to update it now? [Y/n]`. `features.updateNotificationsEnabled` does not control this prompt. It appears only when a newer CLI has been published on the selected channel. Four tests blocked on it until they timed out: - `CentralPackageManagementTests.AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps` - `CentralPackageManagementTests.AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent` - `ChannelUpdateWorkflowTests.UpdateToStable_TypeScriptSingleFileInit_KeepsConfigChannel` - `ChannelUpdateWorkflowTests.UpdateToStable_TypeScript_PreviewsStablePkgsAndKeepsChannel` The new `CliE2EAutomatorHelpers.WaitForAspireUpdateCompletionAsync` helper waits until one of three things appears for the current `SequenceCounter` value: - the success prompt - the error prompt, which still fails fast - the CLI self-update prompt Only output after the line where the command was typed is considered, so a prompt left on screen by an earlier `aspire update` in the same test does not count. When the CLI self-update prompt appears, the helper types `n` without Enter, so no phantom shell command desyncs the counter, and then waits for the success prompt. It does not press Enter blindly or use fixed delays, and it works whether or not the prompt appears. The comments that claimed `updateNotificationsEnabled` suppresses this prompt have been corrected. ### Validation - `MSBUILDTERMINALLOGGER=false dotnet build tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj -v q -nologo` succeeded with 0 warnings and 0 errors. - The affected E2E tests were **not run locally**: they need Docker plus a Linux CLI archive, and Docker isn't available on the authoring machine. The CLI E2E jobs in this PR's CI provide that validation. - Root cause comes from the asciinema recordings and TRX files of CI run 44398134189 (#22401). In all four failures the terminal is blocked at the CLI self-update `[Y/n]` prompt. Fixes # (issue) ## 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 <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Jose Perez Rodriguez (joperezr)
left a comment
There was a problem hiding this comment.
This is conditional approved but waiting for David Negstad (@danegsta) to do some validation tests to ensure things look good.
When `dotnet nuget config paths` exits with a nonzero code, the command itself could not run (for example, when global.json requests an SDK that is not installed). Report the command and its own output instead of "Failed to discover NuGet.config files.", which is now reserved for a successful discovery that finds no configuration files. Also stop attributing fallback parsing to an unresolvable AppHost SDK; MSBuild evaluation can fail for other reasons. Co-authored-by: Copilot App <[email protected]>
This comment has been minimized.
This comment has been minimized.
When the requested SDK is missing, the dotnet host writes its error to stderr but the installed SDK list to stdout. Capture both so the reported command output is complete. Co-authored-by: Copilot App <[email protected]>
Tests selector3 / 101 PR test projects · 4 PR jobs, from 57 changed files. Selected PR test projects (3 / 101)
Selected PR jobs (4)
How these were chosen — grouped by what changed📦 affected project 🔧 🔧 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
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. |
8d56d6a
into
release/17.0
|
✅ No documentation update needed. excluded → head_branch_is_backport (also title_release_prefix, body_backport_marker, base_branch_is_release). This is a backport to release/17.0; docs belong with the original forward PR. Triggered signals (not acted on): cli_command_file_changed (UpdateCommand.cs), cli_option_added (--dry-run), cli_resource_strings_changed, pr_body_has_cli_flag_mention, pr_body_has_security_marker. |
Backport of #22182 to release/17.0
Also backports #22207, #22355, and #22208 using their distinct squash-merge changes, without replaying the stacked PR history.
/cc David Negstad (@danegsta)
Description
C# AppHost updates can ignore configured channels, and failed restores can block channel updates while hiding actionable diagnostics. Honor configured channels, separate applying channel updates from
--dry-runvalidation, and log/display native restore diagnostics with best-effort credential redaction.Normal channel updates apply confirmed edits without requiring a validation restore. Explicit
--dry-runvalidation uses isolated caches and restore outputs, then restores the original source files. Updates without a selected channel retain their existing restore behavior. These changes do not fix underlying dependency conflicts or MSBuild task DLL locks.Relates to #22214 and #22352.
Release prerequisite: This backport is intended for 17.0.1.
release/17.0still hasPatchVersion=0although stable v17.0.0 is published. Advance the release branch to the next unshipped servicing version in a separate PR; no version bump is included here.Checklist
<remarks />and<code />elements on your triple slash comments?Customer Impact
Customers updating C# AppHosts can have their configured channel ignored or lose candidate updates when dependency conflicts cause restore to fail, with no useful restore diagnostics. The combined fixes honor the configured channel, let customers apply channel updates independently of validation, and expose actionable restore errors. Credential-bearing package source URLs are redacted on a best-effort basis before diagnostics are buffered or logged.
Testing
./restore.sh- passed (13 existing package vulnerability warnings, 0 errors).git diff --check 38e4ce6d00..HEAD- passed. Each of the three added commits has the same stable patch ID as its source squash commit.Focused CLI unit run on macOS ARM64 - 788 passed, 2 failed, 2 skipped:
Both failures were the native file-based restore theory, with MSB4216/MSB4027 task-host errors caused by mixing the system .NET host with the repository-local SDK. Rerunning only those cases with the repository-local host on PATH passed 2/2, without code changes:
Across the initial run and targeted retry, all 790 runnable cases passed. The two skips require Windows batch execution and a case-sensitive filesystem, respectively.
E2E scenarios are included in the backport but were not run locally; CI validation remains outstanding.
Risk
Medium. This changes when C# channel updates restore and introduces validation-only rollback and isolated caches/restore outputs. Updates without a selected channel retain their restore behavior. Credential redaction is best effort, not a security guarantee; logs should still be checked before sharing. No supported library API changes or new dependencies are introduced.
Regression?
No.