Skip to content
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

Merged
merged 23 commits into from Apr 8, 2024

Conversation

ryfu-msft
Copy link
Contributor

@ryfu-msft ryfu-msft commented Apr 5, 2024

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.

Microsoft Reviewers: Open in CodeFlow

@ryfu-msft ryfu-msft requested a review from a team as a code owner April 5, 2024 17:32
{
emitter << AppInstaller::YAML::Key << keyName << AppInstaller::YAML::Value << property.GetInt64();
IPropertyValue property = value.try_as<IPropertyValue>();
auto type = property.Type();
Copy link
Member

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.

Copy link
Contributor Author

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

@yao-msft yao-msft merged commit 596b1b0 into microsoft:master Apr 8, 2024
8 checks passed
yao-msft pushed a commit to yao-msft/winget-cli that referenced this pull request Apr 9, 2024
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 <johnmcp@microsoft.com>
yao-msft pushed a commit that referenced this pull request Apr 9, 2024
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 <johnmcp@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants