dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.66k stars 1.06k forks source link

Provide CLI commands for investigating the contents and available workload set versions #42367

Open baronfel opened 1 month ago

baronfel commented 1 month ago

Now that we have workload sets, users have three questions about them that we can't easily answer:

We will provide CLI commands that enable users to learn the answers to all of those questions.

What workload set versions are available?

Workload sets are shipped as a specific NuGet package and are selected by users by version, either implicitly or explicitly. We should provide a command to list the top N versions of the workload set package available on the selected feeds so that users know what versions are available.

What's in workload set XYZ?

Users want to know what versions of the workloads are bundled in each workload set for a number of reasons. We'll tackle this in two parts:

As an example of what this could look like, let's take the existing output from dotnet workload list, which lists the versions of workloads that are installed locally. This output is from my local Windows desktop, which is not configured to use workload sets:

$dotnet workload list

Installed Workload Id      Manifest Version                               Installation Source
----------------------------------------------------------------------------------------------------------------
aspire                     9.0.0-preview.2.24163.9/9.0.100-preview.1      VS 17.10.35027.167, VS 17.11.35111.106
android                    34.99.0-preview.1.151/9.0.100-preview.1        VS 17.11.35111.106
maui-windows               9.0.0-preview.1.9973/9.0.100-preview.1         VS 17.11.35111.106
maccatalyst                17.2.9088-net9-p1/9.0.100-preview.1            VS 17.11.35111.106
ios                        17.2.9088-net9-p1/9.0.100-preview.1            VS 17.11.35111.106

Use `dotnet workload search` to find additional workloads to install.

The major difference that the proposed "what's in workload set X" command would have compared to this is:

What workload contains version X of component or workload Y?

AKA a reverse-lookup, inverting the previous command. Once we have the data to power the above command, we should be able to use it to look up the matching workload set version for a given workload version (e.g. Aspire 8.0.1).

This question is the least fleshed-out but we hope this gives enough of an idea to have a discussion.

Automatically install a workload set that contains a given workload version

Building on the previous 3 commands, users should be able to do something like dotnet workload install aspire@8.0.1 maui@46.8 and the tooling should find the workload set (or sets) that contains both of those and install that workload set. Potentially prompting the user to make a choice if multiple valid sets are found.

TODO: @baronfel to flesh this out more

Open questions

dsplaisted commented 1 month ago

Thanks for writing this! I'd suggest considering dotnet workload list versions instead of dotnet workload list sets, avoiding "workload sets" as a user-facing term.

JonDouglas commented 1 month ago

Looks great. Just a few thoughts on my end:

  1. The xcode@9.0 syntax seems like a great shorthand that could be a streamlined syntax if no parameter is provided for --version and --component.
  2. I have a hard time visualizing how this would look like as a table, which I think would help provide a better picture of what this does.
  3. Consider using a cheap quickpulse survey on naming challenges to get a quick signal between naming directions.
  4. Trying to wrap my head around the What is a reasonable place to store this data on the NuGet package metadata? question still. It sounds like workload metadata would go into the release notes field? That doesn't seem ideal as release notes should be used for changes to the workload itself?