Repository navigation
Merging internal commits for release/9.0.3xx - #10540
Merged
Merged
Conversation
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._
…-merge-9.0.3xx-2026-10-13-2150
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
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.