Skip to content

Redact restore diagnostics and clarify update validation failures - #22208

Open
David Negstad (danegsta) wants to merge 11 commits into
danegsta-force-channel-updatesfrom
danegsta-update-restore-diagnostics
Open

David Negstad (danegsta) wants to merge 11 commits into
danegsta-force-channel-updatesfrom
danegsta-update-restore-diagnostics

Conversation

@danegsta

@danegsta David Negstad (danegsta) commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Description

aspire update now captures native restore diagnostics following #22355, but those diagnostics can contain credential-bearing feed URLs that are persisted in the CLI log. This follow-up applies the existing NuGet redactor before stdout or stderr is buffered or logged, while preserving useful diagnostics for troubleshooting validation failures.

The redactor uses known sources from candidate and referenced-project NuGet configurations, plus RestoreAdditionalProjectSources values obtained during project evaluation. Raw evaluation diagnostics are suppressed so those source properties do not leak through the probes themselves. Restore diagnostics remain logged for success and failure, and are displayed only on failure.

The failure summary now includes the channel and project and explicitly states that the update was not applied.

Redaction scope

This reuses package-only polyglot restore redaction; it does not scan diagnostic text for unknown URLs or inspect restore graph files. Sources introduced only by restore-time targets, additive source changes after planning, and arbitrary non-source secrets are outside this change's coverage.

Stacked on #22207. Follows up on #22355. No new dependencies.

Validation

The following command passed 10/10 cases, covering project and file-based AppHosts, successful and failed restores, both output streams, root and referenced-project sources, evaluated additive sources, encoded credentials, probe suppression, and candidate feed configuration:

dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-method "*.UpdateAsync_RestoreDiagnosticsAreRedactedBeforeLoggingAndFailureDisplay" --filter-method "*.UpdateAsync_DryRunUsesAmbientEvaluationForImportedSdkAndColdCandidateRestore" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

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

Capture stdout and stderr from the validation restore that runs after applying candidate update steps, display them before the update is rolled back, and clarify that a failed validation restore means the update was not applied.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve isolated restore settings alongside diagnostic output capture and exercise the failure case through dry-run validation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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 -- 22208

Or

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

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.

🟡 Changes recommended

Failed restore diagnostics retain credential-bearing feed URLs in displayed output and persistent logs, requiring redaction before buffering and regression coverage for both paths.

1 open issue
1 file not reviewed
  • src/Aspire.Cli/Resources/UpdateCommandStrings.Designer.cs: Generated file
What changed in this PR

This PR makes failed aspire update validation restores diagnosable for .NET AppHosts, building on the dry-run workflow introduced in #22207.

Changes:

  • Captures restore stdout and stderr, displays them on failure, and logs the captured diagnostics at Debug level.
  • Revises the failure message to identify the channel and state that the update was not applied.
  • Extends failure-path tests to verify both output streams and refreshes localization resources.
File Description
tests/​Aspire.Cli.Tests/​Projects/​ProjectUpdaterTests.cs Verifies stdout and stderr from failed dry-run validation.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.zh-Hant.xlf Refreshes the Traditional Chinese translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.zh-Hans.xlf Refreshes the Simplified Chinese translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.tr.xlf Refreshes the Turkish translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.ru.xlf Refreshes the Russian translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.pt-BR.xlf Refreshes the Brazilian Portuguese translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.pl.xlf Refreshes the Polish translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.ko.xlf Refreshes the Korean translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.ja.xlf Refreshes the Japanese translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.it.xlf Refreshes the Italian translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.fr.xlf Refreshes the French translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.es.xlf Refreshes the Spanish translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.de.xlf Refreshes the German translation entry.
src/​Aspire.Cli/​Resources/​xlf/​UpdateCommandStrings.cs.xlf Refreshes the Czech translation entry.
src/​Aspire.Cli/​Resources/​UpdateCommandStrings.resx Revises the validation failure message and placeholder notes.
src/​Aspire.Cli/​Resources/​UpdateCommandStrings.Designer.cs Synchronizes the resource accessor’s documentation.
src/​Aspire.Cli/​Projects/​ProjectUpdater.cs Captures, logs, and displays restore diagnostics before rollback.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

Preserve restore diagnostics assertions while adopting the parent's dry-run test helper.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve display-only restore diagnostics with the renamed isolated restore option.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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.

Reuse upstream restore capture and regression coverage, remove persistent raw diagnostic logging, and retain the channel-aware validation failure message.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@danegsta David Negstad (danegsta) changed the title Surface restore output when update validation fails Keep restore diagnostics display-only and clarify validation failures Nov 17, 2026
@github-actions

This comment has been minimized.

Use candidate and referenced-project source settings with the existing NuGet redactor before buffering or logging either output stream.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@danegsta David Negstad (danegsta) changed the title Keep restore diagnostics display-only and clarify validation failures Redact restore diagnostics and clarify update validation failures Nov 17, 2026
@github-actions

This comment has been minimized.

Collect RestoreAdditionalProjectSources from AppHost and referenced-project evaluations and suppress raw probe diagnostics before redacting restore output.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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.

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.

One credential-redaction issue: raw subprocess Trace logging bypasses the updater callbacks.

Preserve sensitive-source collection alongside isolated restore preview support.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

Keep redacted callback logging while disabling the child process logger that runs before output callbacks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

3 / 101 PR test projects · 4 PR jobs, from 21 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/UpdateCommandStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

🧪 tests/Aspire.Cli.Tests/DotNet/ProcessExecutionFactoryEnvironmentTests.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/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/DotNet/DotNetAppHostRestorePreview.cs, src/Aspire.Cli/Projects/ProjectUpdater.cs, src/Aspire.Cli/Resources/UpdateCommandStrings.Designer.cs, src/Aspire.Cli/Resources/UpdateCommandStrings.resx, 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
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit de72324.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants