Skip to content

Deduplicate results from dotnet workload search version#46069

Merged
Forgind merged 2 commits intodotnet:release/9.0.3xxfrom
Forgind:fix-workload-search-uniqueness
Jan 23, 2025
Merged

Deduplicate results from dotnet workload search version#46069
Forgind merged 2 commits intodotnet:release/9.0.3xxfrom
Forgind:fix-workload-search-uniqueness

Conversation

@Forgind
Copy link
Copy Markdown
Contributor

@Forgind Forgind commented Jan 17, 2025

These results were reported:

dotnet workload search version
9.0.102
9.0.102
9.0.101.2
9.0.101.2
9.0.101.1

This should deduplicate the returned list.

Copy link
Copy Markdown
Contributor

@edvilme edvilme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

@joeloff
Copy link
Copy Markdown
Member

joeloff commented Jan 22, 2025

Do we need to care about things like package source mapping at all?

@Forgind
Copy link
Copy Markdown
Contributor Author

Forgind commented Jan 23, 2025

Do we need to care about things like package source mapping at all?

Hoo, boy, you're trying to scare me 😆 This code is used all over the place, so if we had a bug here, that'd be a Problem.

Fortunately, we do account for package source mapping already. WorkloadSearchVersionsCommand calls GetLatestPackageVersions with PackageSourceLocation: null. That means that LoadNuGetSources unconditionally calls LoadDefaultSources. That then initializes settings to Settings.LoadDefaultSettings(currentDirectory), which is passed into PackageSourceMapping.GetPackageSourceMapping and used if applicable. Unless otherwise specified, shouldUsePackageSourceMapping is set to true in WorkloadCommandBase.

Good question, though 🙂

@Forgind Forgind merged commit 4afc512 into dotnet:release/9.0.3xx Jan 23, 2025
@Forgind Forgind deleted the fix-workload-search-uniqueness branch January 23, 2025 01:18
@renovate renovate bot mentioned this pull request Jun 11, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Workloads untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants