Skip to content

[release/17.0] Fix AppHost channel updates and restore diagnostics - #22219

Merged
Jose Perez Rodriguez (joperezr) merged 12 commits into
release/17.0from
backport/pr-22182-to-release/17.0
Nov 23, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 12 commits into
release/17.0from
backport/pr-22182-to-release/17.0

Conversation

@aspire-repo-bot

@aspire-repo-bot aspire-repo-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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-run validation, and log/display native restore diagnostics with best-effort credential redaction.

Normal channel updates apply confirmed edits without requiring a validation restore. Explicit --dry-run validation 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.0 still has PatchVersion=0 although 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

  • 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
      • 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
    • 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

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:

MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.ProjectUpdater*' --filter-class '*.UpdateCommand*' --filter-class '*.ConfigSourceCommandTests' --filter-class '*.DotNetAppHostRestorePreviewTests' --filter-class '*.DotNetAppHostUpdateTransactionTests' --filter-class '*.DotNetCliRunnerTests' --filter-class '*.ProcessInvocationOptionsTests' --filter-class '*.NuGetClientTests' --filter-class '*.ProcessExecutionFactoryEnvironmentTests' --filter-class '*.PackageSourceRedactorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

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:

PATH="$PWD/.dotnet:$PATH" DOTNET_ROOT="$PWD/.dotnet" MSBUILDTERMINALLOGGER=false .dotnet/dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-method '*.UpdateAsync_FileBasedNativePackageMetadataEditsSourceAndRollsBackOnFailure' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

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.

@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 -- 22219

Or

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

@github-actions

This comment has been minimized.

@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.

@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.

@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.

@joperezr Jose Perez Rodriguez (joperezr) added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Nov 16, 2026
@joperezr

Copy link
Copy Markdown
Member

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.

David Pine (IEvangelist) added a commit to microsoft/aspire.dev that referenced this pull request Nov 17, 2026
## 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]>
@danegsta David Negstad (danegsta) changed the title [release/17.0] Honor configured channels when updating C# AppHosts [release/17.0] Fix AppHost channel updates and restore diagnostics Nov 18, 2026
Preserve automatic response-file suppression alongside isolated validation restore options, with coverage for all restore option combinations.

Co-authored-by: Copilot App <[email protected]>
@github-actions

This comment has been minimized.

@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.

@danegsta

Copy link
Copy Markdown
Member

PR Testing Report

PR Information

  • PR: microsoft/aspire#22219
  • Title: [release/17.0] Fix AppHost channel updates and restore diagnostics
  • Head commit: a6458f63c4a55c78ce20837440ed03cc5dcb5946
  • Base: release/17.0
  • Tested at: 2026-11-19T01:22:03Z
  • Execution: User-approved repository container runner, Linux arm64 on Docker Desktop; manual artifact scenarios, not the repository E2E suite.

Artifact Version Verification

  • Expected commit: a6458f63c4a55c78ce20837440ed03cc5dcb5946
  • Installed version: 17.0.0-pr.22219.ga6458f63
  • Artifact producer: CI run 44383216926
  • Status: Verified. Both the installed version and GitHub PR head were checked again after testing.
  • CLI path: /workspace/.aspire/dogfood/pr-22219/bin/aspire
  • Package hive: /workspace/.aspire/hives/pr-22219/packages

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 -- 22219

The installer reported a nested dogfood/pr-22219/bin path, which was used for every subsequent CLI command. The first verification attempted the generic .aspire/bin/aspire example path and failed because that path was not installed; using the installer's reported path resolved this test-harness issue.

The runner image did not include dotnet. Initial AppHost startup correctly reported that prerequisite missing. Installed .NET SDK 11.0.100 into /workspace/.dotnet using Microsoft's dotnet-install.sh; startup then passed. This was environment setup, not a PR defect or a bundle repair. No Aspire repository binaries were compiled.

Changes Analyzed

Categories: 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:

  • src/Aspire.Cli/Commands/UpdateCommand.cs: configured-channel precedence, dry-run options and validation.
  • src/Aspire.Cli/Projects/ProjectUpdater.cs: explicit-channel application without graph restore, isolated dry-run restore, diagnostic capture.
  • src/Aspire.Cli/DotNet/DotNetAppHostRestorePreview.cs: candidate restore configuration and output isolation.
  • src/Aspire.Cli/DotNet/DotNetAppHostUpdateTransaction.cs: backup consent and rollback.
  • src/Aspire.Cli/DotNet/DotNetRestoreConfiguration.cs and DotNetCliRunner.cs: restore arguments and cache isolation.
  • src/Aspire.Cli/NuGet/BundleNuGetService.cs and NuGetClient.cs: SDK acquisition and cache bypass.
  • src/Aspire.Cli/Utils/PackageSourceRedactor.cs and Projects/PrebuiltAppHostServer.cs: diagnostic-redaction guidance.
  • src/Aspire.Cli/Projects/IAppHostProject.cs: update-context options.
  • src/Aspire.Cli/Resources/* and Resources/xlf/*: related messages and translations.
  • tests/Aspire.Cli.Tests/*: focused command, updater, transaction, process, and NuGet coverage.
  • tests/Aspire.Cli.EndToEnd.Tests/UpdateChannelNuGetConfigOrderingTests.cs: channel application and validation regression scenarios.
  • tests/Aspire.Cli.EndToEnd.Tests/SelfUpdateChannelPersistenceTests.cs and Helpers/ConfigSourceTestContext.cs: related fixture updates.
  • src/Aspire.Cli/README.md, docs/specs/cli-identity-sidecar.md, and docs/specs/polyglot-integration-restore.md: documented behavior.

Test Setup and Commands

Each scenario began with a fresh project created by aspire new using the verified PR hive:

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 --nologo

Result: 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 AppHost.csproj fixture targeting net10.0.

Two separately named hives, configured-test and explicit-test, pointed to the downloaded PR packages, distinguishing configured/explicit selection from the running CLI identity. Non-Aspire dependencies used the internal NuGet mirror https://packagefeedproxy.microsoft.io/nuget/v3/index.json. Each update fixture used its own ambient package cache.

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 Executed

1. Artifact, template, and lifecycle smoke

Coverage: 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-interactive

Observed: Startup succeeded, describe returned {"resources":[]} for the empty template, and stop succeeded. No resource wait was applicable to an empty model. All three commands ran in the same ephemeral runner container.

Evidence: create-smoke.log, smoke-lifecycle.log, final-state.log.

2. Configured channel application

Coverage: Happy path, feed-only update. Status: Passed.

Configured channel=configured-test, retained current package versions, and began with a mirror-only NuGet configuration.

"$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 AfterTargets="Restore" marker was absent, confirming no graph restore.

Evidence: configured-update.log, fixture assertions in test_scenarios.py.

3. Explicit channel precedence

Coverage: Boundary. Status: Passed.

Started with channel=configured-test and selected a different channel:

"$CLI" update --apphost AppHost.csproj --channel explicit-test --yes --non-interactive --nuget-config-dir .

Observed: Persisted channel and NuGet source selected explicit-test, not configured-test. No graph restore occurred.

Evidence: override-update.log.

4. No-channel native NuGet compatibility

Coverage: 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-interactive

Observed: 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: native-update.log.

5. Successful isolated dry run

Coverage: 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-interactive

Observed: 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: dry-success-restore.log, dry-success-update.log.

6. Existing recovery-backup protection

Coverage: Unhappy path. Status: Passed.

Created an existing AppHost.csproj.aspire-backup containing recovery data:

"$CLI" update --apphost AppHost.csproj --channel configured-test --dry-run --yes --non-interactive

Expected/observed: Nonzero exit without replacing the existing backup. Project/configuration/restore files and the backup contents remained unchanged. --yes did not bypass the separate backup consent.

Evidence: backup-update.log.

7. Invalid dry-run option combinations

Coverage: 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-interactive

Expected/observed: All three commands rejected invalid combinations with nonzero exits. Source and configuration files remained unchanged.

Evidence: invalid--no-channel-update.log, invalid--self-update.log, invalid--migrate-update.log.

8. Warm-cache-only dependency rejection

Coverage: 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 debug

Expected/observed: The dry run failed with NU1101 naming the unavailable dependency instead of accepting the warm cache. All captured source/configuration/restore files were restored byte-for-byte, no recovery backups remained, and the original cached dependency was preserved.

Evidence: dry-failure-restore.log, dry-failure-update.log.

9. Native restore diagnostics and credential redaction

Coverage: 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.log

Expected/observed: Nonzero exit with native NU1301/connection-refused diagnostics. Known URL credential material was sanitized; synthetic password, token, and fragment values were absent from both captured output and the trace log. Original source/configuration files were restored.

This verifies the selected known-source case only; redaction remains best effort, not a general security guarantee.

Evidence: diagnostics-update.log, diagnostics-cli.log.

10. Multiple package edits without graph restore

Coverage: 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: apply-multiple-update.log.

11. Declining the NuGet policy preview

Coverage: Interactive rejection. Status: Passed.

Ran the same update without --yes in a PTY, accepted the initial update question, inspected the proposed NuGet policy, and declined the NuGet configuration question:

"$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: decline.log, decline.ansi, test_decline.py.

Summary

Scenario Result
Artifact/template/lifecycle smoke Passed
Configured-channel apply Passed
Explicit-channel precedence Passed
No-channel native NuGet policy Passed
Successful dry run and rollback Passed
Existing-backup protection Passed
Invalid option combinations (3 cases) Passed
Warm-cache-only dependency rejection Passed
Native diagnostic redaction Passed
Multiple package edits without graph restore Passed
Interactive NuGet-preview rejection Passed

Final aspire ps --format Json --non-interactive returned []. No temporary validation directories remained. CLI version and PR head were unchanged, and the repository worktree remained clean.

Overall Result and Limitations

Passed: 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 17.0.0-pr.*, below published stable 17.0.0, while the intended servicing release is 17.0.1. No version bump or self-update fix was made, and this run does not establish that a version bump alone resolves every CI failure.

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.

Artifacts

Report, scenario logs, copied CLI logs, raw/plain-text interactive transcript, assertion harnesses, and results.json are preserved together in the session's files/pr-22219-testing/ directory. Temporary dashboard login tokens were redacted from preserved logs.

No product or test changes were committed, pushed, or made to the PR during this testing run.

@JamesNK

Copy link
Copy Markdown
Member

--dry-run is a new feature. Should it be backported?

IMO the important things to backport is providing more diagnostics for failure, and keeping file changes on failure.

@danegsta

David Negstad (danegsta) commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

--dry-run is a new feature. Should it be backported?

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.

@github-actions

This comment has been minimized.

@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.

Jose Perez Rodriguez (joperezr) pushed a commit that referenced this pull request Nov 20, 2026
## 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]>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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]>
@github-actions

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]>
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

3 / 101 PR test projects · 4 PR jobs, from 57 changed files.

Selected PR test projects (3 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Infrastructure.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

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

🔧 src/Aspire.Cli/Resources/ConfigSourceStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

🔧 src/Aspire.Cli/Resources/UpdateCommandStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/Helpers/ConfigSourceTestContext.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/SelfUpdateChannelPersistenceTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/UpdateChannelNuGetConfigOrderingTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Commands/ConfigSourceCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Commands/UpdateCommandRepositoryToolsTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Commands/UpdateCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/DotNet/DotNetAppHostRestorePreviewTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/DotNet/DotNetAppHostUpdateTransactionTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/DotNet/DotNetCliRunnerTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/DotNet/ProcessExecutionFactoryEnvironmentTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/DotNet/ProcessInvocationOptionsTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/NuGet/NuGetClientTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Projects/ProjectUpdaterNuGetConfigurationTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Projects/ProjectUpdaterTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/TestServices/FakeNuGetClient.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Commands/UpdateCommand.cs, src/Aspire.Cli/DotNet/DotNetAppHostRestorePreview.cs, src/Aspire.Cli/DotNet/DotNetAppHostUpdateTransaction.cs, src/Aspire.Cli/DotNet/DotNetCliRunner.cs, src/Aspire.Cli/DotNet/DotNetRestoreConfiguration.cs, src/Aspire.Cli/NuGet/BundleNuGetService.cs, src/Aspire.Cli/NuGet/NuGetClient.cs, src/Aspire.Cli/Projects/IAppHostProject.cs, src/Aspire.Cli/Projects/PrebuiltAppHostServer.cs, src/Aspire.Cli/Projects/ProjectUpdater.cs, src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs, src/Aspire.Cli/Resources/ConfigSourceStrings.resx, src/Aspire.Cli/Resources/UpdateCommandStrings.Designer.cs, src/Aspire.Cli/Resources/UpdateCommandStrings.resx, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.de.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.es.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.it.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.zh-Hant.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.de.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.es.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.it.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/UpdateCommandStrings.zh-Hant.xlf, src/Aspire.Cli/Utils/PackageSourceRedactor.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 56b3596.

@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.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit 8d56d6a into release/17.0 Nov 23, 2026
1271 of 1291 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 23, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

✅ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-cli NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants