-
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
Dynamic runtime configuration support #4355
Conversation
src/AppInstallerCLICore/ConfigurationSetProcessorFactoryRemoting.cpp
Outdated
Show resolved
Hide resolved
src/AppInstallerCLICore/ConfigurationSetProcessorFactoryRemoting.cpp
Outdated
Show resolved
Hide resolved
src/Microsoft.Management.Configuration/ConfigurationSetSerializer.cpp
Outdated
Show resolved
Hide resolved
{ | ||
emitter << AppInstaller::YAML::Key << keyName << AppInstaller::YAML::Value << property.GetInt64(); | ||
IPropertyValue property = value.try_as<IPropertyValue>(); | ||
auto type = property.Type(); |
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 how strict ValueSet
is at preventing anything that isn't a ValueSet
or IPropertyValue
from getting in, so this could result in a null dereference. Either change the try_as
to just as
or check for null and throw.
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.
Changed IPropertyValue conversion to using as
src/Microsoft.Management.Configuration/ConfigurationSetSerializer.cpp
Outdated
Show resolved
Hide resolved
Credit to @JohnMcPMS for initial prototyping. For reference: `DynamicFactory` holds the same integrity level remote factory `DynamicFactory` creates `DynamicSetProcessor`, giving it a copy of the same integrity level remote factory `DynamicSetProcessor` creates more remote factories and remote set processors at other integrity levels as needed `DynamicSetProcessor` uses the appropriate remote set processor to create the unit processor Changes: Added logic to separate out units with high integrity levels and serializing those units into a yaml string. This yaml string will be passed to `CreateOutOfProcessFactory()` along with the json string containing the "path" as the limitation set in the configuration remote server and processors. Tests: I only added one test for verifying serialization and manually verified the json output for `path`. In the interest of time, I created this PR to get out the feature and will continue to work on adding more thorough E2E testing after everything is fully integrated. CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/4355) --------- Co-authored-by: John McPherson <[email protected]>
Credit to @JohnMcPMS for initial prototyping. For reference: `DynamicFactory` holds the same integrity level remote factory `DynamicFactory` creates `DynamicSetProcessor`, giving it a copy of the same integrity level remote factory `DynamicSetProcessor` creates more remote factories and remote set processors at other integrity levels as needed `DynamicSetProcessor` uses the appropriate remote set processor to create the unit processor Changes: Added logic to separate out units with high integrity levels and serializing those units into a yaml string. This yaml string will be passed to `CreateOutOfProcessFactory()` along with the json string containing the "path" as the limitation set in the configuration remote server and processors. Tests: I only added one test for verifying serialization and manually verified the json output for `path`. In the interest of time, I created this PR to get out the feature and will continue to work on adding more thorough E2E testing after everything is fully integrated. CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/4355) --------- Co-authored-by: John McPherson <[email protected]>
Credit to @JohnMcPMS for initial prototyping.
For reference:
DynamicFactory
holds the same integrity level remote factoryDynamicFactory
createsDynamicSetProcessor
, giving it a copy of the same integrity level remote factoryDynamicSetProcessor
creates more remote factories and remote set processors at other integrity levels as neededDynamicSetProcessor
uses the appropriate remote set processor to create the unit processorChanges:
Added logic to separate out units with high integrity levels and serializing those units into a yaml string. This yaml string will be passed to
CreateOutOfProcessFactory()
along with the json string containing the "path" as the limitation set in the configuration remote server and processors.Tests:
I only added one test for verifying serialization and manually verified the json output for
path
. In the interest of time, I created this PR to get out the feature and will continue to work on adding more thorough E2E testing after everything is fully integrated.Microsoft Reviewers: Open in CodeFlow