Always provide existing version information in `dotnet workload list --machine-readable`, even if no update is available
See original GitHub issueIs your feature request related to a problem? Please describe.
From a CI perspective, we need to be able to deterministically check whether a specific version of a given workload is installed. Currently we do this by locating the appropriate WorkloadManifest.json
and verifying the version/etc from there. This is not ideal because it depends on implementation details that could change on us down the road.
Describe the solution you’d like
dotnet workload list --machine-readable
provides JSON output that could solve this problem, but right now it is focused on updater scenarios. It only shows existingManifestVersion
for a workload if there is an update available for it:
{
"installed": [
"macos",
"ios"
],
"updateAvailable": [
{
"existingManifestVersion": "12.0.101-preview.10.249",
"availableUpdateManifestVersion": "12.0.101-preview.10.251",
"description": ".NET SDK Workload for building macOS applications.",
"workloadId": "macos"
},
{
"existingManifestVersion": "15.0.101-preview.9.31",
"availableUpdateManifestVersion": "15.0.101-preview.10.251",
"description": ".NET SDK Workload for building iOS applications.",
"workloadId": "ios"
}
]
}
If no update is available, you only see something like this (no version information for macos
workload):
{
"installed": [
"macos",
"ios"
],
"updateAvailable": [
{
"existingManifestVersion": "15.0.101-preview.9.31",
"availableUpdateManifestVersion": "15.0.101-preview.10.251",
"description": ".NET SDK Workload for building iOS applications.",
"workloadId": "ios"
}
]
}
Ideally, existingManifestVersion
would have been in the installed
array, regardless of any updates. To avoid changing behavior other tools might depend on, it’s probably necessary to add a new top-level property. Maybe something like this:
{
"installed": [
"macos",
"ios"
],
"updateAvailable": [
{
"existingManifestVersion": "15.0.101-preview.9.31",
"availableUpdateManifestVersion": "15.0.101-preview.10.251",
"description": ".NET SDK Workload for building iOS applications.",
"workloadId": "ios"
}
],
"installedDetails": {
"macos": {
"manifestVersion": "12.0.101-preview.10.251"
},
"ios": {
"manifestVersion": "15.0.101-preview.9.31"
}
}
}
Additional context
https://github.com/dotnet/sdk/issues/22148 is similar, but for users, not machines.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
@joeloff @dsplaisted @marcpopMSFT this should be easy to implement, putting it in the 6.0.2xx milestone.
Playing with this again, it does not actually tell me whether the workloads are installed or not. So I need to either manually check manifests and pack directories to answer my question, or call two commands (
workload update --print-rollback
andworkload list --machine-readable
), one of which is slow because it always checks for updates, to get the information I need about what workload versions is installed (if any).EDIT: Also one command uses the long form workload name and the other uses the short form. It’s very confusing.