-
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 remaining manifest v1.1 fields #1427
Conversation
}, | ||
"AppsAndFeaturesEntries": { | ||
"$ref": "#/definitions/AppsAndFeaturesEntries" | ||
}, | ||
"Installers": { | ||
"type": "array", |
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.
Should the length of the installers array be bumped to 1024 here, per #967? #Resolved
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, thanks for catching that!
"type": [ "boolean", "null" ], | ||
"description": "Indicates whether the installer requires an install location provided" | ||
}, | ||
"RequireExplicitUpgrade": { |
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.
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 think we need an enum for that, but I cannot remember exactly the reasoning for that. But at least at a minimum there are both elevation required installers and elevation rejecting installers. So it would be better to have an enum value that we can set ElevationBehavior
or something like that.
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.
More thoughts on values for it:
ElevationRequired // intended to indicate that the caller must be elevated because the installer will not elevate itself
ElevatesSelf
RestrictsSelf // Better word than restrict?
RestrictedRequired
Then we could add more as we find need of them. For instance ElevationRequiredForSilent
was a problem for MSI before we fixed it, but I know that for instance WebView2 falls into this category currently. It self elevates for its normal unattended pattern, but does not for a silent install (basically same as msiexec behavior).
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.
Per offline chat, we'll do an enum of elevationRequired, elevationProhibited and elevatesSelf
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.
Didn't look at REST code; letting @ashpatil-msft look at that part.
|
||
if (manifestVersion >= ManifestVer{ s_ManifestVersionV1_1 }) | ||
{ | ||
std::vector<FieldProcessInfo> fields_v1_1 = |
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 see anywhere that we are limiting what the server will accept. Letting manifests into winget-pkgs when the feature behind them has not yet been implemented will likely lead to failures. Either now because someone relies on it for a package and it doesn't actually do anything or in the future when we start using it and find that we wanted validation to prevent some case that is now already present.
It feels like we should have:
- Add new version to client to allow for local testing; full validation fails if any 1.1 fields are present even if manifest is 1.1
- As we add functionality and validation, we start allowing fields that are ready #Resolved
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.
Evaluated 1 by 1 offline and we're ok with them for now
constexpr std::string_view Markets = "Markets"sv; | ||
constexpr std::string_view AllowedMarkets = "AllowedMarkets"sv; | ||
constexpr std::string_view ExcludedMarkets = "ExcludedMarkets"sv; | ||
constexpr std::string_view ElevationRequirement = "ElevationRequirement"sv; |
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.
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, this(From comments above) and expected return codes(Flor's) are 2 new fields added after our v1.1 schema review meeting, we'll have to update the rest spec later.
installer.Markets.ExcludedMarkets = V1_0::Json::ManifestDeserializer::ConvertToManifestStringArray( | ||
JsonHelper::GetRawStringArrayFromJsonNode(marketsNode.value().get(), JsonHelper::GetUtilityString(ExcludedMarkets))); | ||
installer.Markets.AllowedMarkets = V1_0::Json::ManifestDeserializer::ConvertToManifestStringArray( | ||
JsonHelper::GetRawStringArrayFromJsonNode(marketsNode.value().get(), JsonHelper::GetUtilityString(AllowedMarkets))); |
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.
Do we throw error if both are given?
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, it's in the manifestvalidation.cpp
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.
Related to #1243 |
Change
Validation
Added unit tests and also tested manually.
Microsoft Reviewers: Open in CodeFlow