Skip to content

Conversation

dsplaisted
Copy link
Member

@dsplaisted dsplaisted commented Sep 16, 2024

Fixes #42527.

This PR is an update to #42683, I rebased the changes so I couldn't push to @Forgind's original branch.

Sample output when SDK is in workload set update mode but no workload set is installed:

C:\SdkTesting>dotnet workload --version
9.0.100-manifests.91e63147


C:\SdkTesting>dotnet workload --info
 Workload version: 9.0.100-manifests.91e63147
 Configured to use workload sets when installing new manifests.
 Workloads are configured to install and update using workload versions, but none were found. Run "dotnet workload restore" to install a workload version.

 [aspire]
   Installation Source: SDK 9.0.100-preview.6
   Manifest Version:    9.0.0-preview.4.24456.4/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\9.0.0-preview.4.24456.4\WorkloadManifest.json
   Install Type:              Msi



C:\SdkTesting>dotnet --info
.NET SDK:
 Version:           9.0.100-preview.6.24328.19
 Commit:            b7dcdeb43c
 Workload version:  9.0.100-manifests.91e63147
 MSBuild version:   17.12.0-preview-24461-13+3b9f2e956

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100-preview.6.24328.19\

.NET workloads installed:
 [aspire]
   Installation Source: SDK 9.0.100-preview.6
   Manifest Version:    9.0.0-preview.4.24456.4/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\9.0.0-preview.4.24456.4\WorkloadManifest.json
   Install Type:              Msi

Configured to use workload sets when installing new manifests.
Workloads are configured to install and update using workload versions, but none were found. Run "dotnet workload restore" to install a workload version.

Host:
  Version:      9.0.0-rc.2.24459.11
  Architecture: x64
  Commit:       static

.NET SDKs installed:
  9.0.100-preview.6.24328.19 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.0-preview.6.24328.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.0-preview.6.24327.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-rc.2.24459.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 9.0.0-preview.6.24327.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Sample output when global.json specifies a workload set that isn't installed:

C:\SdkTesting\ConsoleApp>dotnet workload --version
9.0.100-preview.6.24352.3 (not installed)


C:\SdkTesting\ConsoleApp>dotnet workload --info
 Workload version: 9.0.100-preview.6.24352.3 (not installed)
 Configured to use loose manifests when installing new manifests.
 Workload version 9.0.100-preview.6.24352.3, which was specified in C:\SdkTesting\global.json, was not found. Run "dotnet workload restore" to install this workload version.

There are no installed workloads to display.


C:\SdkTesting\ConsoleApp>dotnet --info
.NET SDK:
 Version:           9.0.100-preview.6.24328.19
 Commit:            b7dcdeb43c
 Workload version:  9.0.100-preview.6.24352.3 (not installed)
 MSBuild version:   17.12.0-preview-24461-13+3b9f2e956

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100-preview.6.24328.19\

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.
Workload version 9.0.100-preview.6.24352.3, which was specified in C:\SdkTesting\global.json, was not found. Run "dotnet workload restore" to install this workload version.

Host:
  Version:      9.0.0-rc.2.24459.11
  Architecture: x64
  Commit:       static

.NET SDKs installed:
  9.0.100-preview.6.24328.19 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.0-preview.6.24328.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.0-preview.6.24327.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-rc.2.24459.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 9.0.0-preview.6.24327.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  C:\SdkTesting\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

@ghost ghost added Area-Workloads untriaged Request triage from a team member labels Sep 16, 2024
@dsplaisted dsplaisted requested review from baronfel and a team September 16, 2024 18:03
else
{
Reporter.WriteLine(string.Format(LocalizableStrings.WorkloadSetVersion, _workloadListHelper.WorkloadResolver.GetWorkloadVersion() ?? "unknown"));
Reporter.WriteLine(string.Format(LocalizableStrings.WorkloadSetVersion, _workloadListHelper.WorkloadResolver.GetWorkloadVersion().Version ?? "unknown"));
Copy link
Member

Choose a reason for hiding this comment

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

Should "unknown" be localized?

Copy link
Member Author

Choose a reason for hiding this comment

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

It probably should have been at one time, but by now I think that Version should never be null, so the "unknown" string should never actually be used.

Copy link
Member

@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

It looks good to me, though I added a few nit questions.

<comment>{Locked="dotnet workload restore"}</comment>
</data>
<data name="ShouldInstallAWorkloadSet" xml:space="preserve">
<value>Workloads are configured to install and update using workload versions, but none were found. Run "dotnet workload restore" to install a workload version.</value>
Copy link
Member

Choose a reason for hiding this comment

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

Would a string like this also suffice? Workload sets are enabled, but none are installed. Run "dotnet workload restore" to install a workload set version.\n

(Either way I would suggest adding a new line to separate out the workload info list.
image

I'm out of date enough to not know the differentiation between workload sets and workload versions. But after reading the issue and this message, for someone with less context, this provided more clarity, but I was also still a bit confused.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we discussed moving that message to the bottom of the output from workload --info? Though perhaps I misremembered.

Workload sets are basically workload versions, but it was decided that calling them sets was confusing, so workload version is the customer-facing phrasing.

Copy link
Member

Choose a reason for hiding this comment

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

I see. But the toggle switch (maybe internal only) uses the workload-set terminology. dotnet workload config --update-mode workload-set 😭

Copy link
Member Author

Choose a reason for hiding this comment

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

Workload sets and workload versions are the same thing. I try to use "workload versions" as the user-facing term because it can be decently understood without learning a new concept, but that didn't really work with the config setting so they both show up.

I've added an extra blank line.

{
public static AndConstraint<CommandResultAssertions> PassWithoutWarning(this CommandResultAssertions assertions)
{
return assertions.Pass()
Copy link
Member

Choose a reason for hiding this comment

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

This is a good test to have! Thank you!

<value>Workload version {0}, which was specified in {1}, was not found. Run "dotnet workload restore" to install this workload version.</value>
<comment>{Locked="dotnet workload restore"}</comment>
</data>
<data name="ShouldInstallAWorkloadSet" xml:space="preserve">
Copy link
Member

Choose a reason for hiding this comment

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

Is there any chance this would break dependents on the workload --info output? It looks like there's already text that can be prepended to it, so probably not

Copy link
Member Author

Choose a reason for hiding this comment

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

I went over this with @baronfel and if I've correctly implemented what we talked about, he felt that these changes were not likely to cause much issue with people parsing the output.

Copy link
Member

@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

The new changes also lgtm. Thank you!

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.

4 participants