Skip to content

Stop persisting ambient NuGet policy into AppHost configs - #21373

Merged
David Negstad (danegsta) merged 7 commits into
mainfrom
danegsta-nuget-mapping-regression
Oct 30, 2026
Merged

David Negstad (danegsta) merged 7 commits into
mainfrom
danegsta-nuget-mapping-regression

Conversation

@danegsta

@danegsta David Negstad (danegsta) commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Description

Creating or updating an AppHost can copy machine-specific NuGet feeds and mappings into the project's nuget.config. Persisting the temporary discovery overlay also introduces a mapping <clear />, replacing inherited policy and making generated projects depend on the generating machine's configuration.

Separate C# project persistence from temporary discovery policy. Persist the selected integration feed configuration as needed and maintain CLI-owned local entries without copying ambient configuration or inventing default package routing. NuGetClient remains unchanged.

  • Preserve the effective mapping mode. If no package-source mapping entries exist, add the channel feed without enabling mapping, so unrelated dependencies can continue using ambient feeds. If mapping is already enabled, persist the selected integration-specific mappings and preserve existing user mappings and their native precedence.
  • Do not copy ambient feeds or mappings, synthesize catch-all bindings, or introduce a mapping <clear />. Existing user-authored clears and disabledPackageSources entries remain untouched.
  • Retirement only removes owned records from the target file. Parent sources and mappings are neither modified nor suppressed, and their survival or reappearance does not prevent local removal. New mapping writes retain their alias-ownership checks.
  • Remove automatic NuGet.org fallback mappings from daily, staging, local/PR channels, and explicit-source composition. Ordinary stable uses ambient sources; an explicit stable integration-source override does not become an all-packages default.
  • Approval compares the original target file with the exact proposed persisted content, not the discovery overlay. Native candidate restore uses the preserved hierarchy and can reject an update that cannot restore without overriding user policy.

Fixes #21362

Examples

When ambient configuration has no package-source mappings, a newly generated configuration adds only the selected source. It does not enable mapping or serialize the generating machine's other feeds:

<configuration>
  <packageSources>
    <add key="aspire-apphost-source" value="https://selected.example/v3/index.json" />
  </packageSources>
</configuration>

When mapping is already enabled, the generated file also contains the integration binding below. Ambient mappings remain inherited rather than being copied into this file:

<packageSourceMapping>
  <packageSource key="aspire-apphost-source">
    <package pattern="Aspire*" />
  </packageSource>
</packageSourceMapping>

Ordinary stable selection does not create a redundant configuration. Existing local CLI-owned channel records can be retired without changing parent configuration or disabled-source entries.

Validation

Final published-tree validation on macOS arm64: 1,511 passed, 0 failed, 1 skipped across the affected CLI test classes, including the dedicated merger snapshots, creation and initialization, channel resolution, updater behavior, and native restore. The offline native-restore regression verifies that a configuration without mappings can restore packages from both ambient and selected local feeds. Generated snapshot changes were reviewed.

Exact broad test command
MSBUILDTERMINALLOGGER=false ./.dotnet/dotnet test \
  --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj \
  --no-launch-profile -- \
  --filter-class '*.DotNetAppHostNuGetConfigMergerTests' \
  --filter-class '*.DotNetAppHostNuGetConfigMergerSnapshotTests' \
  --filter-class '*.DotNetCliRunnerTests' \
  --filter-class '*.NewCommandTests' \
  --filter-class '*.NewCommandChannelResolutionTests' \
  --filter-class '*.NewCommandLocalTemplateTests' \
  --filter-class '*.NewCommandTemplateConfigPersistenceTests' \
  --filter-class '*.InitCommandTests' \
  --filter-class '*.UpdateCommandTests' \
  --filter-class '*.ProjectUpdaterTests' \
  --filter-class '*.ProjectUpdaterNuGetConfigurationTests' \
  --filter-class '*.PackagingServiceTests' \
  --filter-class '*.PackageChannelTests' \
  --filter-class '*.PackageSourceOverrideMappingsTests' \
  --filter-class '*.IntegrationPackageSearchServiceTests' \
  --filter-class '*.TemplateNuGetConfigServiceTests' \
  --filter-class '*.DotNetTemplateFactoryTests' \
  --filter-class '*.BundleNuGetServiceTests' \
  --filter-class '*.NuGetConfigurationTests' \
  --filter-class '*.NuGetConfigurationQueryTests' \
  --filter-class '*.NuGetPackageOperationConfigurationTests' \
  --filter-class '*.AppHostServerProjectTests' \
  --filter-class '*.PrebuiltAppHostServerTests' \
  --filter-not-method '*.UpdateAsync_FileBasedNativePackageMetadataEditsSourceAndRollsBackOnFailure' \
  --filter-not-method '*.UpdateAsync_UnresolvableSdkAndBackslashReference_RepairsSdkForNativeEvaluation' \
  --filter-not-method '*.CreateProjectFiles_RestoreRootConfigDirectory_PreservesRelativeSources' \
  --filter-not-trait 'quarantined=true' \
  --filter-not-trait 'outerloop=true'

Result: 1,511 passed, 0 failed, 1 skipped.

The relative-source scenario excluded from the broad run also passed separately on the current head:

MSBUILDTERMINALLOGGER=false ./.dotnet/dotnet test \
  --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj \
  --no-launch-profile -- \
  --filter-method '*.CreateProjectFiles_RestoreRootConfigDirectory_PreservesRelativeSources' \
  --filter-not-trait 'quarantined=true' \
  --filter-not-trait 'outerloop=true'

Result: 1 passed, 0 failed.

The two excluded updater native-restore scenarios were not validated in the final run. Quarantined and outerloop tests were excluded. CLI E2E tests were not run locally; CI/E2E validation of 5a5901bc08 remains outstanding.

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

Separate C# project edits from temporary discovery overlays. Maintain selected channel entries without copying ambient mappings or introducing mapping clears, and let stable use ambient policy without adding Aspire mappings.

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

Or

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

@github-actions

This comment has been minimized.

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

Critical NuGet mapping defects can leave non-Aspire dependencies without an eligible source or preserve inherited mappings to obsolete feeds, causing restores to fail or use the wrong feed.

4 open issues
What changed in this PR

This PR addresses #21362 by separating temporary NuGet discovery policy from persisted AppHost configuration, aiming to prevent generated projects from inheriting machine-specific feeds and mappings.

Changes:

  • Adds dedicated AppHost persistence composition and mapping edits while preserving user-owned policy.
  • Updates template creation and project updates to use the persistence path, including stable-channel cleanup.
  • Adds regression coverage and revises snapshots and documentation for the new behavior.
File Description
tests/​Aspire.Cli.Tests/​TestServices/​DotNetAppHostNuGetConfigTestHelper.cs Uses the AppHost-specific configuration builder.
tests/​Aspire.Cli.Tests/​Templating/​TemplateNuGetConfigServiceTests.cs Tests selected-only persistence and stable policy preservation.
tests/​Aspire.Cli.Tests/​Snapshots/​TemplateNuGetConfigServiceTests.CreateNuGetConfigIfMissingAsync_PreservesInheritedAndNestedConfigs.verified.txt Removes copied inherited mappings.
tests/​Aspire.Cli.Tests/​Snapshots/​TemplateNuGetConfigServiceTests.CreateNuGetConfig_PersistsOnlySelectedMappings_hasAmbientMappings=True_builtInScaffolding=True.verified.txt Records built-in output with ambient mappings.
tests/​Aspire.Cli.Tests/​Snapshots/​TemplateNuGetConfigServiceTests.CreateNuGetConfig_PersistsOnlySelectedMappings_hasAmbientMappings=True_builtInScaffolding=False.verified.txt Records external-template output with ambient mappings.
tests/​Aspire.Cli.Tests/​Snapshots/​TemplateNuGetConfigServiceTests.CreateNuGetConfig_PersistsOnlySelectedMappings_hasAmbientMappings=False_builtInScaffolding=True.verified.txt Records built-in output without ambient mappings.
tests/​Aspire.Cli.Tests/​Snapshots/​TemplateNuGetConfigServiceTests.CreateNuGetConfig_PersistsOnlySelectedMappings_hasAmbientMappings=False_builtInScaffolding=False.verified.txt Records external-template output without ambient mappings.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithSimpleNuGetConfig_ProducesExpectedXml.stable.verified.xml Removes synthesized stable mappings.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithSimpleNuGetConfig_ProducesExpectedXml.pr-1234.verified.xml Records PR-channel mappings without a mapping clear.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithSimpleNuGetConfig_ProducesExpectedXml.daily.verified.xml Records daily mappings without a mapping clear.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithExtraInternalFeedIncorrectlyMapped_ProducesExpectedXml.stable.verified.xml Preserves user-owned internal-feed policy on stable.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithExtraInternalFeedIncorrectlyMapped_ProducesExpectedXml.pr-1234.verified.xml Preserves internal-feed policy alongside the PR feed.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithDailyFeedWithExtraMappingsIsPreserved_ProducesExpectedXml.stable.verified.xml Retains user mappings during stable selection.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithDailyFeedWithExtraMappingsIsPreserved_ProducesExpectedXml.pr-1234.verified.xml Retains user mappings during PR-channel selection.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithDailyFeedWithExtraMappingsIsPreserved_ProducesExpectedXml.daily.verified.xml Preserves existing daily-feed mappings and aliases.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithBrokenSdkState_ProducesExpectedXml.stable.verified.xml Removes synthesized stable mapping policy.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithBrokenSdkState_ProducesExpectedXml.pr-1234.verified.xml Removes the inserted mapping clear.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_WithBrokenSdkState_ProducesExpectedXml.daily.verified.xml Removes the inserted mapping clear.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_ExtraPatternOnDailyFeedWhenOnPrFeedGetsConsolidatedWithOtherPatterns_ProducesExpectedXml.stable.verified.xml Preserves existing patterns without stable additions.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_ExtraPatternOnDailyFeedWhenOnPrFeedGetsConsolidatedWithOtherPatterns_ProducesExpectedXml.pr-1234.verified.xml Records PR-channel output without a mapping clear.
tests/​Aspire.Cli.Tests/​Snapshots/​Merge_ExtraPatternOnDailyFeedWhenOnPrFeedGetsConsolidatedWithOtherPatterns_ProducesExpectedXml.daily.verified.xml Records daily output without a mapping clear.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceReenablesSelectedInheritedSourceWithoutEnablingOtherSources.verified.xml Preserves mapping inheritance when enabling a source.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceMasksOnlySurvivingRetiredSources_locallyDefined=True_inheritedDefined=True_clearSources=True.verified.xml Updates section ordering for cleared-source retirement.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceMasksOnlySurvivingRetiredSources_locallyDefined=True_inheritedDefined=True_clearSources=False.verified.xml Updates ordering for local and inherited retirement.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceMasksOnlySurvivingRetiredSources_locallyDefined=True_inheritedDefined=False_clearSources=False.verified.xml Updates ordering for local-only retirement.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceMasksOnlySurvivingRetiredSources_locallyDefined=False_inheritedDefined=True_clearSources=False.verified.xml Updates ordering for inherited-source retirement.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.PrepareAsync_DefersExistingConfigChanges.verified.xml Removes synthesized ambient mappings from proposed content.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.PrepareAsync_ChannelRoundTripDoesNotAccumulateProjectionMasks.verified.xml Removes ambient catch-all and mapping clear.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.CreateOrUpdateAsync_PreservesUserMappingsForSelectedPattern.verified.xml Records preservation of competing user mappings.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.CreateOrUpdateAsync_DoesNotSynthesizeMappingsForExistingSources.verified.xml Records selected-only mapping creation.
tests/​Aspire.Cli.Tests/​Snapshots/​DotNetAppHostNuGetConfigMergerTests.CreateOrUpdateAsync_CreatesConfigFromMappings_WhenNoExistingConfig.verified.xml Omits the mapping clear in new configuration.
tests/​Aspire.Cli.Tests/​Projects/​ProjectUpdaterNuGetConfigurationTests.cs Updates ambient-policy and CLI-owned cleanup scenarios.
tests/​Aspire.Cli.Tests/​NuGet/​NuGetConfigurationTests.cs Tests separate operation and persistence policies.
tests/​Aspire.Cli.Tests/​NuGet/​NuGetConfigurationQueryTests.cs Checks discovery and persisted source eligibility separately.
tests/​Aspire.Cli.Tests/​NuGet/​BundleNuGetServiceTests.cs Separates preview assertions from persistence expectations.
tests/​Aspire.Cli.Tests/​DotNet/​DotNetAppHostNuGetConfigMergerTests.cs Tests user-policy preservation and stable cleanup.
src/​Aspire.Cli/​Templating/​TemplateNuGetConfigService.cs Routes new configuration through the AppHost merger.
src/​Aspire.Cli/​Projects/​ProjectUpdater.cs Uses dedicated stable persistence composition.
src/​Aspire.Cli/​NuGet/​NuGetConfigurationBuilder.cs Shares CLI-source identification and removes catch-all repair.
src/​Aspire.Cli/​NuGet/​NuGetConfiguration.cs Stores a separate AppHost persistence plan.
src/​Aspire.Cli/​NuGet/​BundleNuGetService.cs Adds AppHost composition and delegates persistence writing.
src/​Aspire.Cli/​DotNet/​DotNetAppHostNuGetConfigMerger.cs Applies targeted mapping edits to proposed configuration.
src/​Aspire.Cli/​DotNet/​DotNetAppHostNuGetConfigBuilder.cs Composes selected mappings and CLI-owned cleanup.
docs/​specs/​polyglot-integration-restore.md Documents discovery versus persistence behavior.

Review effort: Balanced

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

Reject configuration edits that borrow user-owned aliases or shadow inherited mappings, while allowing local CLI-owned maintenance and byte-identical no-ops. Report planned refusals as normal creation failures in new and init, and cover the behavior with focused regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot October 28, 2026 20:56
@github-actions

This comment has been minimized.

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

Critical fallback-source persistence issues can break dependency restoration on other machines and unintentionally re-enable user-disabled feeds.

5 open issues
1 resolved since last review
1 file not reviewed
  • src/Aspire.Cli/Resources/UpdateCommandStrings.Designer.cs: Generated file

Review effort: Balanced

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

Stop persisting default mappings and disabled-source overrides. Reject edits that require inherited old-channel overrides or explicitly disabled sources while preserving local maintenance and byte-identical no-ops. Add cross-user alias and configuration-preservation regressions.

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

This comment has been minimized.

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

Ancestor-config cleanup can delete unrelated package-source mappings and sources hidden by local overrides, breaking package routing for other projects.

4 open issues
3 resolved since last review
1 file not reviewed
  • src/Aspire.Cli/Resources/UpdateCommandStrings.Designer.cs: Generated file

Review effort: Balanced

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

Remove implicit channel fallback sources, leave package-source mapping disabled when ambient policy has no mappings, and keep channel retirement limited to local records. Update creation, restore, and snapshot regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve the regenerated UpdateCommandStrings accessors from main and retain the channel-feed conflict resource without duplicate properties.

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

This comment has been minimized.

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.

🔵 Needs a closer look

Native NuGet hierarchy and persistence changes still need runtime confirmation because two updater native-restore scenarios and the changed mapped/unmapped CLI E2E paths remain unvalidated.

No open issues 🎉

1 file not reviewed
  • src/Aspire.Cli/Resources/UpdateCommandStrings.Designer.cs: Generated file

Review effort: Balanced

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot October 29, 2026 20:56
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

3 / 100 PR test projects · 5 PR jobs, from 100 changed files.

Selected PR test projects (3 / 100)

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

Selected PR jobs (5)

cli-starter-validation, extension-e2e, extension-unit, 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.EndToEnd.Tests/EmulatedStagingBuildTests.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/InitCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

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

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

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

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

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

🧪 tests/Aspire.Cli.Tests/DotNet/DotNetAppHostNuGetConfigMergerTests.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/NuGet/BundleNuGetServiceTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

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

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

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

🧪 tests/Aspire.Cli.Tests/Packaging/PackagingServiceTests.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/Snapshots/DotNetAppHostNuGetConfigMergerTests.CreateOrUpdateAsync_CreatesConfigFromMappings_WhenNoExistingConfig.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.CreateOrUpdateAsync_DoesNotSynthesizeMappingsForExistingSources.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.CreateOrUpdateAsync_IntegrationConfigurationDoesNotCaptureUserDefaultAliases.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.CreateOrUpdateAsync_PreservesUserMappingsForSelectedPattern.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_ChannelRoundTripDoesNotAccumulateProjectionMasks.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_DefersExistingConfigChanges.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceMasksOnlySurvivingRetiredSources_locallyDefined=False_inheritedDefined=True_clearSources=False.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceMasksOnlySurvivingRetiredSources_locallyDefined=True_inheritedDefined=False_clearSources=False.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceMasksOnlySurvivingRetiredSources_locallyDefined=True_inheritedDefined=True_clearSources=False.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceMasksOnlySurvivingRetiredSources_locallyDefined=True_inheritedDefined=True_clearSources=True.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistencePreservesDisabledSourcesWhenRetiringLocalSources_locallyDefined=False_inheritedDefined=True_clearSources=False.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistencePreservesDisabledSourcesWhenRetiringLocalSources_locallyDefined=True_inheritedDefined=False_clearSources=False.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistencePreservesDisabledSourcesWhenRetiringLocalSources_locallyDefined=True_inheritedDefined=True_clearSources=False.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistencePreservesDisabledSourcesWhenRetiringLocalSources_locallyDefined=True_inheritedDefined=True_clearSources=True.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PersistenceReenablesSelectedInheritedSourceWithoutEnablingOtherSources.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PreservesDisabledSourcesWithoutNormalization_hasLocalSection=False_clearDisabled=False.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PreservesDisabledSourcesWithoutNormalization_hasLocalSection=True_clearDisabled=False.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DotNetAppHostNuGetConfigMergerTests.PrepareAsync_PreservesDisabledSourcesWithoutNormalization_hasLocalSection=True_clearDisabled=True.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_ExtraPatternOnDailyFeedWhenOnPrFeedGetsConsolidatedWithOtherPatterns_ProducesExpectedXml.daily.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_ExtraPatternOnDailyFeedWhenOnPrFeedGetsConsolidatedWithOtherPatterns_ProducesExpectedXml.pr-1234.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_ExtraPatternOnDailyFeedWhenOnPrFeedGetsConsolidatedWithOtherPatterns_ProducesExpectedXml.stable.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithBrokenSdkState_ProducesExpectedXml.daily.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithBrokenSdkState_ProducesExpectedXml.pr-1234.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithBrokenSdkState_ProducesExpectedXml.stable.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithDailyFeedWithExtraMappingsIsPreserved_ProducesExpectedXml.daily.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithDailyFeedWithExtraMappingsIsPreserved_ProducesExpectedXml.pr-1234.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithDailyFeedWithExtraMappingsIsPreserved_ProducesExpectedXml.stable.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithExtraInternalFeedIncorrectlyMapped_ProducesExpectedXml.pr-1234.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithExtraInternalFeedIncorrectlyMapped_ProducesExpectedXml.stable.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithSimpleNuGetConfig_ProducesExpectedXml.daily.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithSimpleNuGetConfig_ProducesExpectedXml.pr-1234.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/Merge_WithSimpleNuGetConfig_ProducesExpectedXml.stable.verified.xml (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_ConfiguresMissingNuGetConfigForIdentity_channel=daily_version=17.0.0-preview.1.12345.1.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_ConfiguresMissingNuGetConfigForIdentity_channel=local_version=17.0.0-dev.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_ConfiguresMissingNuGetConfigForIdentity_channel=pr-12345_version=17.0.0-pr.12345.gabcdef12.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_ConfiguresMissingNuGetConfigForIdentity_channel=staging_version=17.0.0.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_CreatesMissingNuGetConfigForStableSourceOverrides_localPackagesOverride=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_CreatesMissingNuGetConfigForStableSourceOverrides_localPackagesOverride=True.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_HiddenNuGetSourceStillUsesCliIdentity.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_InjectsIdentityNuGetSourceWithoutPrompting_channel=stable_interactive=False_parameterName=canonical.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_InjectsIdentityNuGetSourceWithoutPrompting_channel=stable_interactive=False_parameterName=mixed-case.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_InjectsIdentityNuGetSourceWithoutPrompting_channel=stable_interactive=True_parameterName=canonical.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_InjectsIdentityNuGetSourceWithoutPrompting_channel=stable_interactive=True_parameterName=mixed-case.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.LocalTemplate_PreservesEnterpriseNuGetConfigAndRouting_channel=stable_fileName=nuget.config.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.RepositoryTemplate_ConfiguresOnlyGeneratedNuGetConfig_templateOwnsConfig=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/TemplateNuGetConfigServiceTests.CreateNuGetConfigIfMissingAsync_PreservesInheritedAndNestedConfigs.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/TemplateNuGetConfigServiceTests.CreateNuGetConfig_PersistsOnlySelectedMappings_hasAmbientMappings=False_builtInScaffolding=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/TemplateNuGetConfigServiceTests.CreateNuGetConfig_PersistsOnlySelectedMappings_hasAmbientMappings=False_builtInScaffolding=True.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/TemplateNuGetConfigServiceTests.CreateNuGetConfig_PersistsOnlySelectedMappings_hasAmbientMappings=True_builtInScaffolding=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/TemplateNuGetConfigServiceTests.CreateNuGetConfig_PersistsOnlySelectedMappings_hasAmbientMappings=True_builtInScaffolding=True.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

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

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

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • extension/scripts/run-e2e.js, extension/src/test/e2eLaunchProfile.test.ts, src/Aspire.Cli/Commands/InitCommand.cs, src/Aspire.Cli/Commands/NewCommand.cs, src/Aspire.Cli/DotNet/DotNetAppHostNuGetConfigBuilder.cs, src/Aspire.Cli/DotNet/DotNetAppHostNuGetConfigMerger.cs, src/Aspire.Cli/NuGet/BundleNuGetService.cs, src/Aspire.Cli/NuGet/NuGetConfiguration.cs, src/Aspire.Cli/NuGet/NuGetConfigurationBuilder.cs, src/Aspire.Cli/Packaging/PackageChannel.cs, src/Aspire.Cli/Packaging/PackageSourceOverrideMappings.cs, src/Aspire.Cli/Packaging/PackagingService.cs, src/Aspire.Cli/Projects/IntegrationRestorePlan.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, src/Aspire.Cli/Templating/TemplateEngineFactory.cs, src/Aspire.Cli/Templating/TemplateNuGetConfigService.cs
• affected project Aspire.Cli
extension-unit extension/scripts/run-e2e.js, extension/src/test/e2eLaunchProfile.test.ts
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 5e2214b.

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.

🔵 Needs a closer look

The changed NuGet persistence and discovery policies need runtime confirmation because two native updater restore scenarios were excluded and mapped/unmapped CLI E2E tests remain unexecuted.

No open issues 🎉

1 file not reviewed
  • src/Aspire.Cli/Resources/UpdateCommandStrings.Designer.cs: Generated file

Review effort: Balanced

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

PR Smoke Testing Report

PR Information

  • PR: microsoft/aspire#21373
  • Title: Stop persisting ambient NuGet policy into AppHost configs
  • Manual smoke-tested commit: e62ef348c3fcdd5d6422c09d662ccb48e0287ecc
  • Latest CI-validated head: 5e2214bb6cd115e2db1e1a481100a92429a5df70
  • Report revised: 2026-10-29, after the extension fixture fix and successful CI rerun
  • Execution: Approved repository container runner, Linux arm64, fresh temporary workspaces
  • Follow-up change: 5e2214bb6c changes only the extension E2E fixture setup and its matching unit expectation. Production CLI code is unchanged from the manually tested commit.

Artifact Version Verification

  • Expected commit: e62ef348c3fcdd5d6422c09d662ccb48e0287ecc
  • Installed version: 17.0.0-pr.21373.ge62ef348
  • Installed binary: /workspace/.aspire/dogfood/pr-21373/bin/aspire
  • Package hive: /workspace/.aspire/hives/pr-21373/packages
  • Artifact-producing run: 40937836793
  • Status: Verified against the manual smoke-tested commit. The six container scenarios were not rerun on 5e2214bb6c; latest-head confirmation comes from CI.

The standard dogfood command was executed inside the repository container runner:

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21373

The installer succeeded. Its actual reported install path was used for every subsequent CLI command. No installer repair, bundle repair, or host-profile modification was performed.

Changes Analyzed

Principal Files

  • src/Aspire.Cli/DotNet/DotNetAppHostNuGetConfigBuilder.cs
  • src/Aspire.Cli/DotNet/DotNetAppHostNuGetConfigMerger.cs
  • src/Aspire.Cli/NuGet/{BundleNuGetService,NuGetConfiguration,NuGetConfigurationBuilder}.cs
  • src/Aspire.Cli/Packaging/{PackageChannel,PackageSourceOverrideMappings,PackagingService}.cs
  • src/Aspire.Cli/Commands/{NewCommand,InitCommand}.cs
  • src/Aspire.Cli/Projects/{ProjectUpdater,IntegrationRestorePlan}.cs
  • src/Aspire.Cli/Templating/{TemplateEngineFactory,TemplateNuGetConfigService}.cs
  • Related resource strings, CLI tests, snapshots, and staging/update E2E tests
  • extension/scripts/run-e2e.js and extension/src/test/e2eLaunchProfile.test.ts - follow-up shared-fixture correction

The complete change list is retained as changed-files.txt in the evidence directory.

Change Categories

  • CLI source-policy and persisted-configuration behavior: changed.
  • Test coverage and generated configuration snapshots: changed.
  • Template files: unchanged; CLI-generated NuGet configuration is affected.
  • Extension E2E harness: changed to preserve isolated sources without enabling source mapping in generic fixtures.
  • Hosting APIs, dashboard, client integrations, production extension behavior, and workflow definitions: unchanged.

Test Environment

The container used an isolated CLI install and per-scenario NuGet package caches. Parent configurations included a working internal mirror and, where relevant, an empty private feed, existing mappings, and orphaned disabled-source records.

The minimal container needed a .NET SDK. The SDK was installed under /workspace/.dotnet; PATH and DOTNET_ROOT were set accordingly. Non-interactive creation explicitly used --use-config-source false to select standard configuration, and agent initialization was suppressed.

Initial Docker availability and test-environment setup errors were corrected before the successful scenario runs. They are not classified as PR failures.

Container Scenarios Executed

1. Fresh C# starter with mapping disabled

Coverage: Happy path and mapping-mode boundary
Status: Passed

Created a fresh starter with a parent configuration that had registered ambient feeds but no effective package-source mappings. Explicitly selected the downloaded PR hive and installed version:

"$cli" new aspire-starter \
  --name PrUnmapped --output /workspace/unmapped/PrUnmapped \
  --source "$hive" --version "$version" \
  --test-framework None --use-redis-cache false --localhost-tld false \
  --suppress-agent-init --use-config-source false --non-interactive

Verified:

  • The generated configuration contains exactly the selected PR feed declaration.
  • It contains no packageSourceMapping or disabledPackageSources section.
  • Parent feeds and their aliases are not copied into the generated file.
  • Native restore succeeds using the selected feed and ambient dependency feed.
  • The AppHost starts; aspire wait webfrontend --status up succeeds.
  • aspire describe --format Json reports the API service and frontend running.
  • Exact-target aspire stop succeeds.
  • Parent configuration remains byte-identical.

Evidence: unmapped/{new.log,generated-nuget.xml,restore.log,start.json,wait.log,describe.json,stop.log}

2. Fresh C# starter with mapping already enabled

Coverage: Happy path and inherited-policy preservation
Status: Passed

Used a separate fresh project with parent mappings for the ambient mirror and private package patterns.

Verified:

  • The generated configuration declares only the selected PR feed and its Aspire* mapping.
  • It does not insert a mapping clear, copy parent mappings, or emit disabled-source records.
  • Native restore, AppHost startup, resource wait, JSON description, and exact-target stop all succeed.
  • Parent configuration remains byte-identical.

Evidence: mapped/{new.log,generated-nuget.xml,restore.log,start.json,wait.log,describe.json,stop.log}

3. File-based C# initialization and local-only retirement

Coverage: Happy path, inherited-source boundary, and no-op
Status: Passed

Ran:

"$cli" init --language csharp --file-based \
  --suppress-agent-init --use-config-source false --non-interactive

The parent and local configuration both defined aspire-staging. The parent also contained a differently cased disabled-source key. The local configuration included an unrelated user source and an orphaned disabled entry with a comment.

Verified:

  • Only the local old-channel declaration is retired.
  • The user-owned local source is retained.
  • The selected PR feed is registered without enabling mapping.
  • Parent bytes and the local disabled-source section, including its comment and explicit value, are preserved.
  • Native build of the generated apphost.cs succeeds.
  • Rerunning initialization leaves NuGet configuration byte-identical.

Evidence: file-init/{local-before.xml,local-after.xml,init.log,build.log,rerun.log} and retirement/parent-before.xml

4. Solution/project-based C# initialization

Coverage: Happy path and removal-only retirement
Status: Passed

Created a fresh solution, initialized C#, built the generated AppHost project, and reran initialization.

Verified the same retirement, parent-preservation, disabled-section preservation, mapping-mode, and byte-identical rerun properties as the file-based scenario.

Evidence: project-init/{solution.log,local-before.xml,local-after.xml,init.log,build.log,rerun.log}

5. Refuse a mapping write borrowing an inherited user alias

Coverage: Unhappy path
Status: Passed

Configured the PR package directory under a parent-owned customer-channel alias, with mapping already enabled, then attempted fresh C# project creation from that feed.

Expected and observed: Exit code 4, an actionable refusal, byte-identical parent configuration, and no generated AppHost files. The CLI did not add an alias or override the inherited mapping.

Evidence: borrowed/{new.log,exit-code.txt,parent-before.xml}

6. Refuse an explicitly disabled selected feed

Coverage: Unhappy path
Status: Passed

Configured the selected PR feed under an explicitly disabled parent entry and attempted fresh C# project creation.

Expected and observed: Exit code 4, unchanged parent bytes, and no generated AppHost files. The CLI did not re-enable or normalize the disabled source.

Evidence: disabled/{new.log,exit-code.txt,parent-before.xml}

CLI CI Evidence at the Manual Smoke-Tested Commit

Actual TRX results from run 40937836793, at e62ef348c3, were inspected rather than relying on job conclusions. The counts below are from that run, not newly inspected TRX counts at 5e2214bb6c.

CLI unit suite Passed occurrences Not executed Failed
Linux 9,292 59 0
macOS 9,289 72 0
Windows 9,198 99 0

These are platform-specific test occurrences, not unique test counts. Targeted ownership, cleanup, no-op, mapping-mode, and concurrent-write cases were confirmed passed in the artifacts.

CLI E2E class Passed Not executed Failed
Emulated staging 3 0 0
Smoke 10 0 0
New channel configuration 2 0 0
Channel update workflow 4 0 0
C# initialization 4 0 0
C# project-mode initialization 3 0 0
Empty AppHost template 5 0 0
Update ordering on source mapping 0 1 0

Both mappingEnabled: False and mappingEnabled: True staging rows actually ran and passed. The channel-update cases include ordinary stable transitions for C# and TypeScript.

The update-ordering case was skipped because CI installed a LocalArchive, while that test requires LocalHive. Its green job is not counted as executed coverage.

Evidence: ci/{unit-results.json,e2e-results.json,additional-e2e-results.json}

Downstream Extension E2E Follow-Up: Resolved

The earlier run at e62ef348c3 had seven deterministic extension E2E shard failures caused by one shared fixture setup. These are resolved at 5e2214bb6c.

Fixture correction

The failing setup registered the PR hive under inherited alias e2e-source-2 and gave every feed a * mapping. Creation therefore hit the CLI's intended refusal to write an integration mapping through an inherited, fixture-owned alias:

Cannot modify '.../nuget.config' because channel source 'e2e-source-2'
is disabled, or the source or its package mappings are inherited or user-owned.

Commit 5e2214bb6c retains the explicit local/approved source list, source clear, and empty mapping clear, but removes the generic wildcard mapping entries. This keeps fixture restores isolated without enabling source mapping. The exact-XML unit expectation was updated alongside it. No CLI ownership guard was weakened.

A separate fresh container proof with the same inherited alias and mapping disabled also passed project creation and native build, with byte-identical parent configuration. The subsequent CI rerun provides actual Extension Host confirmation of the fixture correction.

Actual rerun results at the latest head

Run 40953093397 completed successfully at 5e2214bb6cd115e2db1e1a481100a92429a5df70. Each previously failing shard's job log was inspected for its Mocha passing count, rather than treating a green advisory job alone as evidence:

Previously failing shard Actual passing tests Evidence
Linux zero-to-running 1 Job log
Windows zero-to-running 1 Job log
Linux workspace-target-proof 2 Job log
Linux edge-cases 6 Job log
Windows edge-cases 6 Job log
Linux Azure Functions Node 1 Job log
Linux Deno debugger 1 Job log
Total 18 All seven shards passed

Both Final Test Results and Final Results succeeded.

Focused local validation of the fixture change also passed:

Command Result
cd extension && corepack yarn run compile-tests Passed
cd extension && corepack yarn mocha --ui tdd out/test/e2eLaunchProfile.test.js 97 passed
cd extension && corepack yarn eslint src/test/e2eLaunchProfile.test.ts Passed
node --check extension/scripts/run-e2e.js Passed
dotnet test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj --no-launch-profile -- --filter-namespace 'Infrastructure.Tests.TestTriggerMap' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' 340 passed

Transient failure cleared by retry

Windows launch-profiles initially timed out during TypeScript Node.js dependency installation in the earlier run. Attempt 2 ran all three tests successfully on that unchanged commit. Both Linux and Windows launch-profile jobs are also green in the latest run. This was consistent with transient install/timing noise; no timeout or product change was made.

Remaining Limitations and Separate Issue

  • The dedicated source-mapping update-ordering case was not executed in the inspected CLI E2E evidence because it requires LocalHive, whereas CI installed LocalArchive. It is not counted as coverage.
  • Manual container smoke scenarios were run against e62ef348c3, not rerun against 5e2214bb6c. Only the fixture and its expectation changed between those commits.
  • The separate native AOT/generated SDK/Docker/DCP/CLI/Dashboard check was still running when this report was revised. This report does not claim that every PR check has completed.
  • The pre-existing polyglot stable integration-restore issue with an explicit ASPIRE_CLI_NUGET_SERVICE_INDEX is tracked separately in #21398. It is outside this PR's scope, not an additional regression found in these smoke scenarios.

Summary

Validation Result
Installed CLI identity at manual smoke-tested commit Verified
Six fresh container scenarios at e62ef348c3 Passed
Inspected CLI unit suites on three platforms at e62ef348c3 No failed test results
Inspected executed CLI E2E cases at e62ef348c3 31 passed
Dedicated update-ordering E2E Skipped; not validated
Previously failing extension E2E shards at 5e2214bb6c All seven passed; 18 actual passing tests
Focused fixture unit suite 97 passed
Test-selection regression suite 340 passed
Latest CI run and final-results jobs Passed
Windows launch-profiles timeout Cleared on retry; latest jobs also green
Final isolated aspire ps --format Json Empty list

Overall Result

TARGETED SMOKE VALIDATION PASSED; DOWNSTREAM FIXTURE FAILURES RESOLVED.

No additional product regression was identified in the smoke scenarios. The earlier downstream failures were corrected in the shared fixture and confirmed resolved by actual passing Extension Host tests at the latest head. The coverage and pending-check limitations above remain explicit; this is not a claim that every possible scenario or PR check has been validated.

Evidence, Posting, and Inspection Status

  • Sanitized logs, generated XML, resource state, and structured CI summaries are retained in the companion pr-21373-testing-evidence directory.
  • Raw CI artifacts remain available from the linked workflow run.
  • This revised report is being posted to the PR at the user's request; retained local evidence has not been uploaded.
  • Both manually started AppHosts were stopped. The final listing contains no running AppHosts.
  • The temporary container workspace is retained pending the user's inspection/cleanup decision.

@danegsta
David Negstad (danegsta) merged commit bf29669 into main Oct 30, 2026
417 of 421 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 30, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1997

Generated by PR Documentation Check · copilot · auto · 24.4 AIC · ⌖ 1.14 AIC · ⊞ 7.1K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1997 targeting release/17.0.

Updated aspire-update.mdx to describe the new nuget.config persistence behavior (no ambient feed/mapping copying, no mapping <clear />, mapping mode preserved). Triggered signals: cli_command_file_changed (InitCommand.cs, NewCommand.cs), cli_resource_strings_changed (UpdateCommandStrings.resx), pr_body_has_cli_flag_mention.

Note

This draft PR needs human review before merging.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aspire new persists machine-specific NuGet source mappings into generated projects

3 participants