-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add support for RequireExplicitUpgrade
manifest element
#1795
Conversation
@@ -52,7 +103,8 @@ namespace AppInstaller::CLI | |||
Argument::ForType(Args::Type::AcceptSourceAgreements), | |||
Argument::ForType(Execution::Args::Type::CustomHeader), | |||
Argument{ "all", Argument::NoAlias, Args::Type::All, Resource::String::UpdateAllArgumentDescription, ArgumentType::Flag }, | |||
Argument{ "include-unknown", Argument::NoAlias, Args::Type::IncludeUnknown, Resource::String::IncludeUnknownArgumentDescription, ArgumentType::Flag } | |||
Argument{ "include-unknown", Argument::NoAlias, Args::Type::IncludeUnknown, Resource::String::IncludeUnknownArgumentDescription, ArgumentType::Flag }, | |||
Argument{ "include-explicit", Argument::NoAlias, Args::Type::IncludeExplicit, Resource::String::IncludeExplicitArgumentDescription, ArgumentType::Flag }, |
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.
@denelon Is this argument name okay?
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 know of anything better. Can you think of a better term for something that represents packages that update themselves?
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.
--include-pinned
? I'd imagine this argument would be used for user pinned packages later, no? And UpgradeRequireExplicitCount
uses the word "pinned" to describe packages which use RequireExplicitUpgrade
in the manifest.
@@ -52,7 +103,8 @@ namespace AppInstaller::CLI | |||
Argument::ForType(Args::Type::AcceptSourceAgreements), | |||
Argument::ForType(Execution::Args::Type::CustomHeader), | |||
Argument{ "all", Argument::NoAlias, Args::Type::All, Resource::String::UpdateAllArgumentDescription, ArgumentType::Flag }, | |||
Argument{ "include-unknown", Argument::NoAlias, Args::Type::IncludeUnknown, Resource::String::IncludeUnknownArgumentDescription, ArgumentType::Flag } | |||
Argument{ "include-unknown", Argument::NoAlias, Args::Type::IncludeUnknown, Resource::String::IncludeUnknownArgumentDescription, ArgumentType::Flag }, | |||
Argument{ "include-explicit", Argument::NoAlias, Args::Type::IncludeExplicit, Resource::String::IncludeExplicitArgumentDescription, ArgumentType::Flag }, |
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.
--include-pinned
? I'd imagine this argument would be used for user pinned packages later, no? And UpgradeRequireExplicitCount
uses the word "pinned" to describe packages which use RequireExplicitUpgrade
in the manifest.
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.
The determination of whether explicit upgrade is required needs to be sorted out. I would lean towards using the tracking catalog because it makes the delta to having user driven pinning very small. The drawback being that if the package isn't installed through us, or was installed prior to this feature, or an update to the manifest changes it, we won't have the correct information. But I think those are acceptable, and even recoverable by the user with pinning, situations.
Is there an issue to fix this that I can follow? I usually use |
I believe We were thinking that "pin" would exclude packages from being upgraded even if an upgrade was available unless you unpinned them. Users would explicitly pin things they don't want upgraded. The "Unknown" version problem is being handled slightly differently. We're adding additional arguments to be able to display packages that don't report a version to Windows Apps & Features, and to go ahead and "try" to upgrade them. We still wouldn't know if it was an upgrade, so it would be more like just running |
I understood @lechacon's description to mean that It might be useful to have the option to filter those out. For example, if VSC or WebView2 will be upgraded separately, you don't necessarily need to see them listed as requiring an upgrade. They could still be listed by default though, but perhaps it should indicate which packages require an explicit upgrade, so that you can at least mentally ignore them when looking at the list. |
I agree with @glen-84 , we should still show them by default with
|
We should add another table for "pinned" packages along with that feature. |
I would prefer to treat manually pinned and default pinned through |
I think of "pinning" an explicit request made by a user. They are saying "don't" upgrade this package. If the package updates itself as specified in the manifest which is what this is covering, the user wouldn't be able to "pin" it since we couldn't guarantee to honor the request. Visual Studio Code is the example for this. It doesn't make sense to have users upgrade it with the Windows Package Manager since the program will update itself the next time they launch. There may be some confusion in using the term "pin" in the description. |
We don't know or control what happens after installation begins. We can't honor any request to pin because of this. Thus, semantically these are the same thing; don't attempt to upgrade this package unless the user explicitly tells us to. But I agree that we shouldn't use the term "pin" in our usage anywhere except the command as a verb. You pin a package, but it is not necessarily pinned. It could just as well be:
|
6290869
to
aaf60a9
Compare
Reviving this PR with changes per the comments..
|
We don't have pinning, and this isn't the same thing. I would use --include-pinned in this use case. |
@@ -1272,6 +1272,17 @@ Please specify one of them using the `--source` option to proceed.</value> | |||
<value>package has a version number that cannot be determined. Using "--include-unknown" may show more results.</value> | |||
<comment>{Locked="--include-unknown"} This string is preceded by a (integer) number of packages that do not have notated versions.</comment> | |||
</data> | |||
<data name="UpgradeUnknownVersionCount" xml:space="preserve"> | |||
<value>package(s) have version numbers that cannot be determined. Use "--include-unknown" to see all results.</value> |
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.
@AmelBawa-msft is working to fix our lack of placeholders in localization strings. This family of strings will need to be updated and this comment is mostly a note for him.
src/AppInstallerRepositoryCore/Public/winget/RepositorySearch.h
Outdated
Show resolved
Hide resolved
I assume you meant "I would not use...". But the manifest entry is implicit pinning, and I don't think we want to create a parallel feature. Adding end-user controlled pinning should simply allow the default to be overridden. The default is currently "not pinned ever", this PR enables the default to be package/installer specific. |
@JohnMcPMS you are correct. I think the confusion would come from using "--include-pinned" for |
The example packages I was thinking about are Visual Studio Code and Edge Web View 2 Runtime. These packages upgrade themselves and may not work and play well when manually upgraded. I'm sure there are others. I've also seen some cases with other browsers and tools that have more than one package being upgraded with automatic updates. |
I disagree, manually pinned packages should be able to be explicitly upgraded. I don't see pinning as setting read-only on the package, just moving to a separate list to prevent normal flow from upgrading it. We could make an additional level of pinning that prevents any modifying interaction, but how far does that guarantee need to go? I don't think it is actually necessary. Back to |
Adding support for skipping packages marked as
RequireExplicitUpgrade
during anupgrade --all
, and an argument--include-explicit
to upgrade these packages. This is similar to what #1765 did for unknown installed versions.--manifest
with--header
) and allow some that should work together (e.g.winget upgrade
with--accept-source-agreements
). This is related to what I mentioned in Implement better validation of how CLI arguments are used together #1788, but other commands probably still accept weird combinations.upgrade --all
to skip packages marked as requiring explicit upgrade unless the argument was specified. Did not do the same forupgrade
(list available) as this requires having identified the installer to use, which we don't currently do in that flow.--include-explicit
argument.Closes #1163
Microsoft Reviewers: Open in CodeFlow