Skip to content

Fix preview workload version search - #55685

Merged
marcpopMSFT merged 1 commit into
mainfrom
marcpopmsft-fix-preview-workload-version-search
Aug 10, 2026
Merged

marcpopMSFT merged 1 commit into
mainfrom
marcpopmsft-fix-preview-workload-version-search

Conversation

@marcpopMSFT

Copy link
Copy Markdown
Member

Preview workload version searches such as dotnet workload search version ios@<version> request all workload-set package versions by passing a result count of zero. The preview-inclusive NuGet query path interpreted that as Take(0), so it returned no candidates.

Treat zero as unlimited consistently for both stable and preview-inclusive queries. Add downloader-level coverage with an isolated local feed containing preview packages to verify all versions are returned in descending order.

Treat a zero NuGet result count as unlimited for preview-inclusive queries, matching stable version behavior.

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

Copilot-Session: ad8c4d3a-b669-4e52-bf34-a44016be0569
Copilot AI lite review requested due to automatic review settings August 7, 2026 22:22
@marcpopMSFT
marcpopMSFT requested a review from a team as a code owner August 7, 2026 22:22
@azure-pipelines

Copy link
Copy Markdown
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.

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.

Pull request overview

This PR fixes preview-inclusive workload version searches where a requested result count of 0 (meaning “all”) incorrectly returned zero results due to a Take(0) in the preview-inclusive query path.

Changes:

  • Treat numberOfResults == 0 as “unlimited” consistently for both stable-only and preview-inclusive version queries.
  • Add a downloader-level test that builds a local feed containing preview packages and verifies all versions are returned in descending order.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/dotnet.Tests/NuGetPackageDownloaderTests.cs Adds regression coverage for GetLatestPackageVersions(..., numberOfResults: 0, includePreview: true) using an isolated local feed.
src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs Introduces a helper to apply the “0 means all” rule consistently across stable and preview-inclusive paths.

@marcpopMSFT

Copy link
Copy Markdown
Member Author

Tested in codespace and was able to search a preview version of android

@marcpopMSFT
marcpopMSFT requested a review from nagilson August 10, 2026 21:02
@marcpopMSFT
marcpopMSFT enabled auto-merge (squash) August 10, 2026 21:23
@marcpopMSFT
marcpopMSFT merged commit 3ff3c5a into main Aug 10, 2026
26 checks passed
@marcpopMSFT
marcpopMSFT deleted the marcpopmsft-fix-preview-workload-version-search branch August 10, 2026 22:17
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 15, 2026
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