-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Workload manifest updater cleanup #35859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workload manifest updater cleanup #35859
Conversation
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Tests/dotnet-workload-list.Tests/GivenWorkloadInstallerAndWorkloadsInstalled.cs
Show resolved
Hide resolved
I haven't looked at the code changes yet, but this should probably target 8.0.2xx instead of main, since we're going to continue working on workloads in 8.0.2xx, and if we put a refactoring like this in main it will be harder to merge later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions for this change, overall I am quite happy with these improvements, so thank you :)
src/Tests/dotnet-workload-list.Tests/GivenWorkloadInstallerAndWorkloadsInstalled.cs
Show resolved
Hide resolved
src/Tests/dotnet-workload-list.Tests/GivenWorkloadInstallerAndWorkloadsInstalled.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/IWorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/IWorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Show resolved
Hide resolved
🤔 The situation is:
So, is it a problem if we merge this into 8.0.2xx and then (using /backport) also put it into main? Or should I just wait until the codeflow happens for 8.0.2xx -> main? I'd like this in main soon to do my next set of changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor things, but overall, this looks great! Thanks for making this change!
src/Cli/dotnet/commands/dotnet-workload/install/IWorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs
Outdated
Show resolved
Hide resolved
src/Tests/dotnet-workload-install.Tests/GivenDotnetWorkloadInstall.cs
Outdated
Show resolved
Hide resolved
…ted records or aliases to attempt to simplify. Ad-hoc formatting cleanup and some simplification. No functional changes should be taking place.
…a few other minor things.
…nct to eliminate duplicates.
…emarksOnThat test.
…rface that does this automatically.
3499958
to
64f8fe6
Compare
…teAdvertisingManifestAsync to match the same pattern as GetManifestPackageDownloadsAsync, since it was using the same previous pattern except with 2 bands instead of 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, this is a large improvement, thank you for making this :)
This looks good, thanks! Could / should we use a global using for |
Oh, that's a great idea! I forgot you could put aliases in those. I'll do that in a separate PR real quick. Edit: New PR here: #36092 |
Related: #22882
Summary
I was planning on working on the linked issue above, but ended up going down a rabbit hole. A majority of the changes take place in
WorkloadManifestUpdater.cs
. A lot of the cleanup is around the uses of many different ValueTuple types. I created records or aliases to attempt to simplify the situation. No functional changes should be taking place in this PR.Notable Changes
ManifestUpdateWithWorkloads
andManifestVersionWithBand
records to help with some of the tuple situation._tempDirPath
as it was unused. The value is currently part theWorkloadInstallerFactory.GetWorkloadInstaller()
, so the providedIWorkloadManifestInstaller
will contain and use this temp directory._tempDirManifestPath
was not used in the mocked version for testing, so this was removed too.WorkloadCollection
alias since a dictionary ofWorkloadId
toWorkloadDefinition
is used in multiple places in the code.GetManifestPackageDownloadsAsync
into a loop since it was a series of if-statements that did the same logic 3 times in a row.