Skip to content

Make SearchFilter.PackageType singular rather than plural#7469

Merged
zivkan merged 9 commits into
devfrom
dev-zivkan-PackageSearch-PackageType-follow-ups
Jun 24, 2026
Merged

Make SearchFilter.PackageType singular rather than plural#7469
zivkan merged 9 commits into
devfrom
dev-zivkan-PackageSearch-PackageType-follow-ups

Conversation

@zivkan

@zivkan zivkan commented Jun 10, 2026

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14941
Fixes: NuGet/Home#14936
also follow up of #7395

Description

We had a community contribution recently: #7395
In the PR, I made two comments about things that I think should be improved, so I implemented it myself, in addition to some additional changes:

  • BREAKING CHANGE Remove the old IEnumerable<string> PackageTypes property, and add a new string PackageType property to SearchFilter. See the linked issue for more information.
  • Add a SupportsPackageTypeFiltering property to PackageSearchResource, so callers can check whether the feed supports package type filtering before calling SearchAsync, given SearchAsync will throw if PackageType is not null or empty on feeds that don't support it.
  • Remove a log message added in the community PR. While the log might be interesting while developing and testing the package type filtering feature specifically, I believe the message would not provide value in the general sense (when customers are using NuGet normally).
  • Several minor perf improvements (reducing unnecessary allocations).

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests Almost entirely a refactoring, not adding new functionality or fixing bugs.
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. N/A

@zivkan zivkan added the Breaking-change Label for .NET SDK breaking changes. label Jun 10, 2026
@zivkan zivkan requested a review from a team as a code owner June 10, 2026 07:45
@zivkan zivkan requested review from jebriede and kartheekp-ms June 10, 2026 07:45
Comment thread src/NuGet.Core/NuGet.Protocol/Resources/PackageSearchResourceV3.cs
Comment thread src/NuGet.Core/NuGet.Protocol/Resources/PackageSearchResourceV3.cs
@zivkan zivkan merged commit 796a1b6 into dev Jun 24, 2026
20 of 21 checks passed
@zivkan zivkan deleted the dev-zivkan-PackageSearch-PackageType-follow-ups branch June 24, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking-change Label for .NET SDK breaking changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SearchFilter changing PackageTypes to PackageType Capability discovery for SearchFilter.PackageTypes across PackageSearchResource implementations

4 participants