Actions - #1734
Draft
Steve Lee (SteveL-MSFT) wants to merge 5 commits into
Draft
Actions#1734Steve Lee (SteveL-MSFT) wants to merge 5 commits into
Steve Lee (SteveL-MSFT) wants to merge 5 commits into
Conversation
Steve Lee (SteveL-MSFT)
requested review from
Mikey Lombardi (He/Him) (michaeltlombardi) and
Tess Gauthier (tgauth)
and
a lite review from Copilot
September 25, 2026 22:43
Copilot started reviewing on behalf of
Steve Lee (SteveL-MSFT)
September 25, 2026 22:44
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved moderate issues affect MCP contracts, input validation, configuration behavior, and discovery caching.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 6
Open (7)
Action tool contract omits the advertised operation field and Delete variant · New Action tool metadata incorrectly describes listing DSC resources · New Missing action input bypasses schema validation · New Action test path checks Set instead of the executed operation · New Resource discovery incorrectly relies on the action cache · New Action lookup lacks independent per-type discovery readiness · New Action table uses hard-coded untranslated status strings · New
What changed in this PR
Adds DSC action manifests, discovery, configuration support, CLI listing, MCP APIs, schemas, and test coverage.
Changes:
- Adds action discovery, caching, invocation, and validation.
- Adds
dsc action listand MCP action tools. - Integrates actions with configuration and resource dispatch.
- Adds fixtures, tests, localization, and stable Cargo configuration.
| File | Summary |
|---|---|
tools/dsctest/src/main.rs |
Adds action test support and schemas. |
tools/dsctest/src/args.rs |
Adds action arguments. |
tools/dsctest/src/action.rs |
Implements test action input/output. |
tools/dsctest/dsctest.dsc.manifests.json |
Adds action manifests. |
tools/dsctest/dsctest.dsc.action.json |
Adds an action fixture. |
tools/dsctest/.project.data.json |
Includes the action fixture. |
lib/dsc-lib/src/lib.rs |
Exposes action support and resource kinds. |
lib/dsc-lib/src/extensions/dscextension.rs |
Corrects directory documentation. |
lib/dsc-lib/src/extensions/discover.rs |
Discovers action extensions. |
lib/dsc-lib/src/dscresources/dscresource.rs |
Handles resource/action distinctions. |
lib/dsc-lib/src/dscresources/command_resource.rs |
Adds action security validation. |
lib/dsc-lib/src/discovery/mod.rs |
Adds action caching and lookup; cache readiness needs correction. |
lib/dsc-lib/src/discovery/discovery_trait.rs |
Extends discovery APIs for actions. |
lib/dsc-lib/src/discovery/command_discovery.rs |
Loads action manifests; resource cache guarding needs correction. |
lib/dsc-lib/src/configure/mod.rs |
Executes actions during configuration; test/set operation selection needs correction. |
lib/dsc-lib/src/actions/mod.rs |
Registers action modules. |
lib/dsc-lib/src/actions/dscaction.rs |
Implements action loading and invocation; missing inputs can bypass validation. |
lib/dsc-lib/src/actions/action_manifest.rs |
Defines action schemas; schema transforms need alignment with resource manifests. |
lib/dsc-lib/locales/en-us.toml |
Adds action messages. |
dsc/tests/dsc_server.tests.ps1 |
Tests MCP action tools. |
dsc/tests/dsc_actions.tests.ps1 |
Tests action CLI and configuration behavior. |
dsc/src/subcommand.rs |
Adds action listing and validation; required null inputs and localization need correction. |
dsc/src/server/show_dsc_resource.rs |
Separates actions from resources. |
dsc/src/server/show_dsc_action.rs |
Adds action details API. |
dsc/src/server/mod.rs |
Registers action server modules. |
dsc/src/server/mcp_server.rs |
Registers action tool routers. |
dsc/src/server/list_dsc_resources.rs |
Restricts listing to resources. |
dsc/src/server/list_dsc_actions.rs |
Adds action listing; metadata incorrectly describes resources. |
dsc/src/server/invoke_dsc_resource.rs |
Restricts invocation to resources. |
dsc/src/server/invoke_dsc_action.rs |
Adds action invocation; metadata does not match the request contract. |
dsc/src/resource_command.rs |
Separates action and resource CLI operations. |
dsc/src/main.rs |
Dispatches the action subcommand. |
dsc/src/args.rs |
Defines action CLI arguments. |
dsc/locales/en-us.toml |
Adds CLI action strings. |
dsc-bicep-ext/src/main.rs |
Rejects actions in Bicep resource operations. |
.cargo/config.toml |
Removes obsolete unstable Cargo configuration. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+39
to
+41
| description = "Invoke a DSC action operation (Get, Set, Test, Export, Delete) with specified properties in JSON format. Set 'what_if' to true to preview a Set or Delete without applying changes.", | ||
| annotations( | ||
| title = "Invoke a DSC action operation (Get, Set, Test, Export, Delete) with specified properties in JSON format and what-if support", |
Comment on lines
+43
to
+45
| description = "List summary of all DSC resources available on the local machine", | ||
| annotations( | ||
| title = "Enumerate all available DSC resources on the local machine returning name, kind, and description.", |
Comment on lines
+90
to
+97
| if let Some(input) = input { | ||
| let Some(input_schema) = &self.input_schema else { | ||
| error!("{}", t!("actions.dscaction.inputSchemaNotAvailable", type_name = self.type_name.to_string())); | ||
| return Err(DscError::SchemaNotAvailable(self.type_name.to_string())); | ||
| }; | ||
|
|
||
| validate_json(input, input_schema)?; | ||
| } |
| results.push(serde_json::to_value(&result.result)?); | ||
| let (test_result, execution_information, metadata) = match dsc_resource { | ||
| DscResourceKind::Action(dsc_action) => { | ||
| let result = if dsc_action.supported_operations.contains(&SupportedOperations::Set) { |
| #[allow(clippy::too_many_lines)] | ||
| fn discover(&mut self, kind: &DiscoveryKind, filter: &TypeNameFilter) -> Result<(), DscError> { | ||
| if self.discovery_mode == ResourceDiscoveryMode::PreDeployment && !locked_is_empty!(RESOURCES) { | ||
| if self.discovery_mode == ResourceDiscoveryMode::PreDeployment && kind == &DiscoveryKind::Resource && (!locked_is_empty!(RESOURCES) || !locked_is_empty!(ACTIONS)) { |
Comment on lines
+154
to
+158
| } else if let Some(actions) = self.actions.get(type_name) { | ||
| if let Some(version_req) = filter.require_version() { | ||
| for action in actions { | ||
| if version_req.matches(&ResourceVersion::Semantic(action.version.clone())) { | ||
| return Ok(Some(DscResourceKind::Action(Box::new(action.clone())))); |
Comment on lines
+697
to
+701
| let has_input = if action.invoke.input_schema.is_some() { | ||
| "Yes" | ||
| } else { | ||
| "No" | ||
| }; |
Steve Lee (SteveL-MSFT)
marked this pull request as draft
September 26, 2026 00:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


PR Summary
DscResourceKindthat encapulatesDscResourceandDscAction, this resulted in many changes that formally only expected aDscResourcedsc action listto list actions, did not implementdsc action invokesince expectation is apps use the server apisinvoke_dsc_action(),list_dsc_actions(), andshow_dsc_action()server APIsPR Context
Fix #1470