Skip to content

Add api to find unit processors based on search path - #5386

Merged
yao-msft merged 18 commits into
microsoft:masterfrom
yao-msft:findprocessors
Apr 21, 2025
Merged

Add api to find unit processors based on search path#5386
yao-msft merged 18 commits into
microsoft:masterfrom
yao-msft:findprocessors

Conversation

@yao-msft

@yao-msft yao-msft commented Apr 14, 2025

Copy link
Copy Markdown
Contributor

Added EnvironmentVariables customization support for ProcessExecution.
Added ProcessorRunSettings to customize each processor run settings. Currently only used to change path environment variables for processor runs.
Added support to find unit processors based on search path. If search paths not provided, the api will list all unit processors that can be found.

Added e2e tests.

Microsoft Reviewers: Open in CodeFlow

@yao-msft
yao-msft requested a review from a team as a code owner April 14, 2025 21:27

@JohnMcPMS JohnMcPMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this code can find (and even execute) resources that are not on the configured PATH, we should not export any resource that isn't discoverable by a standard call to dsc.exe. If we do, the configuration won't work without special code to find them again on the apply-side.

Comment thread src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.idl Outdated
}
else
{
AICLI_LOG(Config, Warning, << "Set Processor does not support FindUnitProcessors operation");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this should be an error to indicate that the operation could not be performed. We already do similar with the GetAll* functions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant that the API should produce an error.

else
{
AICLI_LOG(Config, Warning, << "Set Processor does not support FindUnitProcessors operation");
return winrt::single_threaded_vector<IConfigurationUnitProcessorDetails>();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error as ConfigurationProcessor.

Comment thread src/AppInstallerCLICore/ExecutionReporter.cpp
Comment thread src/Microsoft.Management.Configuration.Processor/DSCv3/Helpers/ResourceDetails.cs Outdated
@yao-msft
yao-msft merged commit 248d4a0 into microsoft:master Apr 21, 2025
@yao-msft
yao-msft deleted the findprocessors branch April 21, 2025 19:11
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.

2 participants