Skip to content

Merging internal commits for release/9.0.3xx - #10540

Merged
mmitche merged 7 commits into
release/9.0.3xxfrom
internal-merge-9.0.3xx-2026-10-13-2150
Oct 20, 2026
Merged

mmitche merged 7 commits into
release/9.0.3xxfrom
internal-merge-9.0.3xx-2026-10-13-2150

Conversation

@dotnet-release-bot

Copy link
Copy Markdown

No description provided.

marcpopMSFT and others added 6 commits September 17, 2026 00:00
Honor configured NuGet sources during template update

Do not reuse a template package's persisted installation source when checking for or installing updates. This ensures disabled sources remain disabled while preserving explicit sources for normal installs.

Co-authored-by: Copilot <[email protected]>

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix: templates are updated using globally configured NuGet sources instead of the package's stored source, ensuring configured NuGet sources are honored during update and version-check operations.

#### PR Summary
This PR removes the use of a NuGet package's stored source during template update and latest-version checks, ensuring configured NuGet feeds are used instead.
- `NuGetInstaller.cs`: stops passing the stored `NuGetSource` when constructing update `InstallRequest` and when calling `GetLatestVersionAsync`, passing `null` for additional source instead.
- `MockPackageManager.cs`: adds tracking of `LastAdditionalSources` and `LastAdditionalNuGetSource` and support for a fixed download result to enable verifying source usage in tests.
- `NuGetInstallerTests.cs`: adds new tests `Update_RemotePackage_DoesNotUseStoredSource` and `GetLatestVersion_RemotePackage_DoesNotUseStoredSource` verifying that stored/disabled sources are not used during update/version check.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
#### AI description  (iteration 1)
#### PR Classification
New feature enabling NuGet package source mapping support during template package source resolution (dotnet new install).

#### PR Summary
Updates NuGet source selection to respect package source mapping rules and surfaces a dedicated error when no mapping matches, with added unit coverage and localized strings.
- `src/Microsoft.TemplateEngine.Edge/Installers/NuGet/NugetApiPackageManager.cs`: add `LoadNuGetSources(packageIdentifier, additionalSources, settings)` that filters enabled sources via `PackageSourceMapping`, preserves explicit additional sources, and throws `PackageNotFoundException` when mapping yields no sources; update callers and remove old loader.
- `src/Microsoft.TemplateEngine.Edge/Installers/NuGet/Exceptions/PackageNotFoundException.cs`: extend exception with `PackageSourceMappingMatchNotFound` flag to differentiate mapping failures.
- `test/Microsoft.TemplateEngine.Edge.UnitTests/NuGetApiPackageManagerTests.cs`: add comprehensive tests validating mapped source selection, multi-source mapping, disabled sources, mapping-off behavior, and additional-source interactions; add helper to generate a NuGet.config with mapping.
- `test/Microsoft.TemplateEngine.Edge.UnitTests/NuGetInstallerTests.cs`: add test asserting installer returns a specific `PackageNotFound` error message when mapping match is not found.
- `src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings*.xlf`: add new localized string key for the package source mapping “no source found” installer error.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

I didn't test all versions of this PR but I did test this version so included the testing summary here:
_The 9.0.3xx port passed the focused validation.

• Local  Microsoft.TemplateEngine.Edge  build succeeded against the isolated 9.0.318 SDK.
• All 9 package-source-mapping unit tests passed.
• E2E network monitoring confirmed:
• Stock SDK contacted the intentionally unmapped feed 6 times.
• Patched SDK contacted it 0 times for an unmapped package.
• A mapped-package control contacted the feed 6 times, proving the source was selectively filtered rather than globally disabled.
• The 9.0 CLI still displays the generic “package does not exist” message because that CLI layer replaces the detailed Edge error, so network behavior is the reliable E2E assertion._
@dotnet-release-bot
dotnet-release-bot Bot requested a review from a team as a code owner October 13, 2026 21:50
Inject deterministic update metadata while retaining the real Bootstrapper, NuGet installer, and package settings persistence. Assert successful update checks and unchanged installed versions.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 83168eec-3065-446c-bef7-6df6aa17014f
@mmitche
mmitche merged commit d0d8d30 into release/9.0.3xx Oct 20, 2026
8 checks passed
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