Repository navigation
Honor configured NuGet sources for package discovery - #55848
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This PR updates .NET SDK “discovery” experiences to honor the user’s configured/enabled NuGet sources (and new --source/--add-source/--configfile controls), aligning dotnet tool search, dotnet new search, and workload advertising update checks with NuGet configuration policy instead of hardcoding nuget.org.
Changes:
- Refactors
dotnet tool searchto query each selected feed viaNuGet.Protocol’sPackageSearchResource, reporting per-source failures while succeeding if any source succeeds. - Extends
dotnet new searchto accept source-selection options and filters catalog hits by verifying package id+version availability against selected feeds (including package source mapping). - Propagates selected package source location into workload advertising manifest “latest version” checks, plus broad test updates/coverage and localization resource updates.
Reviewed changes
Copilot reviewed 84 out of 85 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.TemplateEngine.Cli.UnitTests/TemplateSearchCoordinatorTests.cs | Updates expected provider display name for template search results. |
| test/Microsoft.TemplateEngine.Cli.UnitTests/TemplateSearch/CliTemplateSearchCoordinatorTests.cs | Adds unit tests for catalog-hit availability filtering helper logic. |
| test/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/SearchTests.cs | Adds parser coverage for new dotnet new search source-selection options. |
| test/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/Approvals/TabCompletionTests.Search_GetAllSuggestions.verified.txt | Updates tab-completion snapshot to include new search options. |
| test/Microsoft.TemplateEngine.Cli.UnitTests/NuGet/PackageAvailabilityCheckerTests.cs | Adds tests for feed availability checks, failures, and source mapping behavior. |
| test/Microsoft.DotNet.Tools.Tests.ComponentMocks/MockNuGetPackageDownloader.cs | Captures PackageSourceLocation passed to latest-version queries for workload tests. |
| test/Microsoft.DotNet.Cli.Utils.Tests/NuGetSourceConfigurationTests.cs | Adds tests for loading enabled sources, overrides, add-source ordering/deduping. |
| test/dotnet.Tests/queryResultSample.json | Removes sample JSON used by deleted deserializer tests. |
| test/dotnet.Tests/dotnet.Tests.csproj | Removes queryResultSample.json from test output assets. |
| test/dotnet.Tests/CommandTests/Workload/Install/GivenWorkloadManifestUpdater.cs | Adds assertions that advertising checks receive configured PackageSourceLocation. |
| test/dotnet.Tests/CommandTests/Tool/Search/ToolSearchParserTests.cs | Adds parser coverage for tool-search --configfile, --source, --add-source. |
| test/dotnet.Tests/CommandTests/Tool/Search/ToolSearchCommandTests.cs | Adds behavioral tests for multi-source execution, ordering, and failure handling. |
| test/dotnet.Tests/CommandTests/Tool/Search/SearchResultPrinterTests.cs | Adds tests for per-source headings/failures and invalid/no-source messages. |
| test/dotnet.Tests/CommandTests/Tool/Search/NugetSearchApiRequestTests.cs | Replaces URL-construction tests with PackageSearchResource behavior tests. |
| test/dotnet.Tests/CommandTests/Tool/Search/NugetSearchApiDeserializerTests.cs | Removes tests for the deleted JSON deserializer path. |
| test/dotnet-new.IntegrationTests/DotnetNewSearchTests.cs | Updates integration expectations for template source display name. |
| test/dotnet-new.IntegrationTests/Approvals/DotnetNewTests.CanUseNormalMode_common.verified.txt | Updates approval snapshot for template source display name. |
| test/dotnet-new.IntegrationTests/Approvals/DotnetNewSearchTests.CanShowMessageInCaseShortNameConflict.verified.txt | Updates approval snapshot for template source display name. |
| test/dotnet-aot.Tests/AotParserTests.cs | Updates AOT expectations to route tool search through managed fallback. |
| src/TemplateEngine/Microsoft.TemplateSearch.Common/Providers/NuGetMetadataSearchProviderFactory.cs | Corrects provider display name to reflect catalog-based search behavior. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hant.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hans.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pt-BR.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf | Adds localization entry for “all feeds failed” template availability verification. |
| src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs | Filters catalog hits by package availability on selected feeds and initializes credential service for interactive mode. |
| src/Cli/Microsoft.TemplateEngine.Cli/NuGet/PackageAvailabilityChecker.cs | Introduces feed-based id+version availability checks (with throttling and source mapping). |
| src/Cli/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx | Adds new localized string for template availability “all feeds failed” case. |
| src/Cli/Microsoft.TemplateEngine.Cli/LocalizableStrings.Designer.cs | Updates resource designer for new template availability string. |
| src/Cli/Microsoft.TemplateEngine.Cli/Commands/search/SearchCommandArgs.cs | Plumbs new source-selection/interactive options into dotnet new search args. |
| src/Cli/Microsoft.DotNet.Cli.Utils/NuGetSourceConfiguration.cs | Adds shared loader for enabled/configured sources plus overrides/additions/deduping. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.zh-Hant.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.zh-Hans.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.tr.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.ru.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.pt-BR.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.pl.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.ko.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.ja.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.it.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.fr.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.es.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.de.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/CommandDefinitionStrings.cs.xlf | Updates localized command/option strings for tool-search source selection. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/Tool/ToolSearchCommandDefinition.cs | Adds config/source/add-source options to dotnet tool search. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/Tool/ToolAppliedOption.cs | Allows per-command override of --source/--add-source descriptions. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/New/SharedOptionsFactory.cs | Adds shared --source and --configfile options for dotnet new commands. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/New/NewSearchCommandDefinition.cs | Registers source-selection options for modern dotnet new search only. |
| src/Cli/Microsoft.DotNet.Cli.Definitions/CommandDefinitionStrings.resx | Adds/updates tool-search command and option descriptions. |
| src/Cli/dotnet/NugetSearch/NugetToolSearchApiRequest.cs | Replaces HTTP/JSON search with PackageSearchResource + typed metadata mapping. |
| src/Cli/dotnet/NugetSearch/INugetToolSearchApiRequest.cs | Updates contract to query a specific PackageSource and return typed results. |
| src/Cli/dotnet/NugetSearch/NugetSearchApiSerializable/NugetSearchApiVersionSerializable.cs | Removes JSON model types for the deleted deserializer path. |
| src/Cli/dotnet/NugetSearch/NugetSearchApiSerializable/NugetSearchApiPackageSerializable.cs | Removes JSON model types for the deleted deserializer path. |
| src/Cli/dotnet/NugetSearch/NugetSearchApiSerializable/NugetSearchApiContainerSerializable.cs | Removes JSON model types for the deleted deserializer path. |
| src/Cli/dotnet/NugetSearch/NugetSearchApiSerializable/NugetSearchApiAuthorsSerializable.cs | Removes JSON model types for the deleted deserializer path. |
| src/Cli/dotnet/NugetSearch/NugetSearchApiResultDeserializer.cs | Removes legacy JSON deserializer used by old tool-search implementation. |
| src/Cli/dotnet/NugetSearch/AuthorsConverter.cs | Removes legacy JSON converter used by old tool-search implementation. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf | Adds localization entry for “no sources configured” tool-search error. |
| src/Cli/dotnet/Commands/Workload/Install/WorkloadAdvertisingManifestUpdater.cs | Passes configured PackageSourceLocation into latest-version checks. |
| src/Cli/dotnet/Commands/Tool/ToolCommandParser.cs | Removes AOT in-proc tool search; routes to managed CLI fallback. |
| src/Cli/dotnet/Commands/Tool/Search/ToolSearchCommand.cs | Implements per-source tool search execution, error handling, and exit codes. |
| src/Cli/dotnet/Commands/Tool/Search/SearchResultPrinter.cs | Adds per-source output/error reporting helpers used by tool search. |
| src/Cli/dotnet/Commands/Tool/Search/NugetSearchSerializables.cs | Adjusts download counts to long for typed metadata parity. |
| src/Cli/dotnet/Commands/CliCommandStrings.resx | Adds localized string for tool-search “no sources configured” error. |
| src/Cli/dotnet-aot/AotSourceFiles.props | Removes tool-search sources from AOT compile set; relies on managed fallback. |
Files not reviewed (1)
- src/Cli/Microsoft.TemplateEngine.Cli/LocalizableStrings.Designer.cs: Generated file
Evangelink
left a comment
There was a problem hiding this comment.
Note
This review was generated with AI assistance and verified against the checked-out PR branch and the corresponding NuGet.Client implementations.
I found 9 issues affecting feed compatibility, authentication, source mapping, failure reporting, and request scaling.
|
/aot-size |
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
/azp run sdk-unified-build |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run dotnet-sdk-public-ci |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run dotnet-sdk-public-ci |
|
/azp run sdk-unified-build |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
🔍 Build Failure AnalysisSummary — the Native AOT build of Root cause:
|
| Code | Project | File | Message |
|---|---|---|---|
IL2026 |
dotnet-aot.csproj |
ILC |
NuGet.Protocol.Plugins.GetOperationClaimsRequest..ctor uses JToken.ToString(Formatting, JsonConverter[]) which has RequiresUnreferencedCodeAttribute |
IL3053 |
dotnet-aot.csproj |
NuGet.Protocol.dll |
Assembly NuGet.Protocol produced AOT analysis warnings |
IL2026 |
dotnet-aot.csproj |
ILC |
NuGet.Protocol.Plugins.GetServiceIndexResponse..ctor uses JToken.ToString(Formatting, JsonConverter[]) which has RequiresUnreferencedCodeAttribute |
MSB3073 |
dotnet-aot.csproj |
Microsoft.NETCore.Native.targets:357 |
ilc command exited with code 1 |
Legs with this exact pattern: 1_0_Linux_arm64_AOT, 3_0_Linux_x64_AOT, 4_0_Linux_x64, 5_0_Mac_arm64_AOT, 6_0_Mac_arm64, 7_0_Windows_arm64_AOT, 8_0_Windows_x64_AOT, 9_0_Windows_x64_FullFramework, 10_0_Windows_x64.
Leg 2_0_Linux_arm64 reported no errors.
🤖 Generated by the Build Failure Analysis workflow using (a href="(dev.azure.com/redacted) · commit b4420b3
🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · auto · 73.2 AIC · ⌖ 2.08 AIC · ⊞ 7.1K · [◷]( · ◷)
|
The size is ok here - we'll be working on that size regresssion shortly |
b4420b3 to
4fb118e
Compare
Centralize configured, exclusive, and additive NuGet source resolution for discovery commands, with localized option text and focused tests. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Search each selected NuGet feed, preserve per-source results, tolerate partial feed failures, and keep managed and Native AOT behavior aligned. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Restore the tool search implementation to the Native AOT source closure and wire its asynchronous cancellation-aware action. Add coverage proving the command executes in-process instead of requesting managed fallback. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Ensure NuGet.Protocol's serializer feature switch is folded in Debug publishes as well as Release so the disabled Newtonsoft.Json reflection path does not enter the AOT closure. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Do not print a tags label when package metadata contains no tags, and cover the mixed populated/empty result case. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Do not print an authors label when package metadata contains no authors, and cover empty authors alongside empty tags. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Default run-dn to Release so NuGet.Protocol's serializer feature switch is folded without forcing optimization in the dotnet-aot project configuration. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Parse shared --configfile options as FileInfo and rely on System.CommandLine's AcceptExistingOnly validator. Convert to string paths only at existing NuGet-facing boundaries. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Restore the Native AOT development harness to its pre-change configuration and remove comments or organization changes that do not explain necessary behavior. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Update typed config option and search help expectations, and configure discovery fixtures to expose downloaded packages through a local NuGet source. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Keep NuGet-compatible package files in the configured local feed while giving the test discovery provider catalog copies named with its ID##version convention. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Consolidate overlapping tests, simplify template package availability orchestration, and reuse existing localized option descriptions without changing discovery behavior. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Keep rebased workload commands aligned with typed config-file options, avoid per-result version requests for concise tool searches, and retain the narrow Native AOT warning treatment required by current NuGet.Protocol. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Regenerate the Polish CLI localization after replaying the source resource changes and align the template search help approval with the current System.CommandLine output. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
4fb118e to
ce689b9
Compare
Evangelink
left a comment
There was a problem hiding this comment.
Note
This review was generated with AI assistance. Each finding was checked against the current PR head and reproduced before posting.
Five confirmed issues remain: configured credentials are discarded by explicit source overrides, tool-search terms are no longer URL-escaped, discovery bypasses the insecure-HTTP source policy, source deduplication conflates case-sensitive URI paths, and the new workload update gate suppresses supported feature-band fallback. I have not approved the PR.
Verification used head ce689b9948e46379c0d8c609951f38f221425798 and NuGet.Protocol 8.1.0-rc.52403:
- Ran the assembled managed SDK against loopback NuGet V3 feeds for both
dotnet tool searchanddotnet new search, including Basic authentication, explicit source overrides, and HTTP sources without opt-in. Tool search withC# --skip 3 --take 4sent only/search?q=C. - Executed the source loader with two HTTPS addresses differing only in path case; it selected one source although the URI values are distinct.
- Ran focused checks through
scripts\RunTests.cs: 212 existing tests passed and 2 were skipped across tool/workload, shared source configuration, template search, and managed AOT-parser coverage. - Added a review-only workload regression probe: direct advertising update successfully uses the installed manifest's fallback band, but background advertising update downloads nothing. That probe failed as expected. Its source was preserved outside the checkout and its TRX under
artifacts/log/test-runs; the checkout was left unchanged. - The managed validation layout builds with
/p:PublishAot=false /p:_ShouldPublishDotnetAot=false /p:UseSharedCompilation=false. Native publish/run, native parity, and binary-size measurement were not completed because the local Windows C++ linker is unavailable; the AOT-parser results above are managed executions, not native evidence.
Preserve configured source metadata, validate insecure feeds, encode search terms, and align workload advertising fallback checks. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Use RuntimeInformation for the OS-specific path comparer so Microsoft.DotNet.Cli.Utils continues to compile for net472. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
marcpopMSFT
left a comment
There was a problem hiding this comment.
🤖 > [!NOTE]
This review was generated with AI assistance and verified against the checked-out PR branch.
Two issues found: template source discovery semantics and Native AOT runtime coverage.
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
|
🤖 Copilot source-review finding: versionless template results bypass package source mapping Verified at head For example, with an enabled This needs a production-code correction plus mapping-aware regression coverage, not just a test expectation update: apply full-package-ID mapping/source eligibility before the versionless compatibility shortcut, excluding IDs with no eligible selected/enabled source. Preserve the existing behavior for eligible versionless entries, mapping-disabled configurations, and explicit source overrides. A coordinator-level test should assert that a disallowed versionless hit is absent from both results and the install example, and that an all-disallowed search does not return success. This is a search-result consistency issue, not an installation or NuGet-cache bypass: installation still enforces its own PSM. It can be handled as a focused follow-up if keeping this PR's scope unchanged. |
I don't think this is a valid finding, since there are no custom search catalog files (we construct the only one) and our constructed file always has versions. In addition, search is best-effort - any security application like Package Source Mapping is independently handled by |
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dbbc31f-4199-4ea5-a54e-a458bbae4cdc
Fixes #55792
Summary
Package discovery now uses enabled feeds from the effective NuGet configuration instead of hard-binding to nuget.org. Commands that expose
--sourceuse it as an exclusive override,--add-sourceappends feeds, and--configfileselects the NuGet configuration. Source order is preserved and duplicate feeds are removed. Template search intentionally does not expose--source, because its results come from the fixed Microsoft template catalog rather than arbitrary NuGet feeds. Nullable analysis is also enabled in every C# file touched by this change.Tool search
PackageSearchResourcerather than manually reading the service index or issuing HTTP/JSON requests.Template search
--add-sourcefeeds.FindPackageByIdResource, handles feeds that do not support it, and applies package source mapping.--add-sourceand--configfilecontrols todotnet new search; it does not add--source, because arbitrary-feed template discovery is unsupported.Workload advertising
PackageSourceLocationinto advertising-manifest latest-version checks.Validation
dotnet new searchhelp approval tests