-
Notifications
You must be signed in to change notification settings - Fork 58
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
[dotnet-core-uninstall] Allow preview version removal #269
base: main
Are you sure you want to change the base?
Conversation
@@ -133,6 +133,10 @@ internal static class CommandLineConfigs | |||
RuntimeInfo.RunningOnWindows ? LocalizableStrings.ForceOptionDescriptionWindows | |||
: LocalizableStrings.ForceOptionDescriptionMac); | |||
|
|||
public static readonly Option IgnoreUpperLimitOption = new Option( | |||
"--ignore-upper-limit", |
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.
cc @Forgind |
@baronfel per our chat earlier about removing the upper limit. This PR provides an alternative option for customers though is not exacty what we were talking about. |
cf82982
to
91342c4
Compare
I reworked this to use the |
@@ -103,7 +104,9 @@ public static IEnumerable<Bundle> GetUninstallableBundles(IEnumerable<Bundle> bu | |||
{ | |||
var (bundlesByDivisions, remainingBundles) = ApplyVersionDivisions(allBundles); | |||
|
|||
var bundlesAboveUpperLimit = remainingBundles.Where(bundle => bundle.Version.SemVer >= UpperLimit); | |||
var bundlesAboveUpperLimit = CommandLineConfigs.CommandLineParseResult.ForceArgumentProvided() |
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.
I don't think this does what you might expect? I think this just changes a string, which shouldn't really matter for uninstallation purposes. If the user specifies force (or however we decide they should be able to request uninstalling versions above the upper limit), I think we should instead add an extra version division [UpperLimit, infinity) and treat it the same as the rest.
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.
Thanks, this was left over from some of my initial changes and I forgot to back it out.
With respect to the extra version division suggestion, are you suggesting that we remove the "force argument provided" check around CommandBundleFilter.FilterRequiredBundles and instead check if this param is provided and update the version groups created in VisualStudioSafeVersionsExtractor.ApplyWindowsVersionDivisions / VisualStudioSafeVersionsExtractor.ApplyMacVersionDivisions accordingly?
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.
Yes; that's what I was thinking. I haven't spent that much time with cli-lab, though, so it would probably be good to get signoff from someone else who's commented on this PR.
Updates the uninstall tool to ignore the upper version check and uninstallation restriction when the `--force` parameter is provided.
Context: #265
Updates the uninstall tool to ignore the upper version check and
uninstallation restriction when the
--force
parameter is provided.Local testing output: