-
Notifications
You must be signed in to change notification settings - Fork 55
Update set what-if handling #1374
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR updates the handling of what-if functionality in DSC by introducing a new whatIfArg parameter within the set block of resource manifests, deprecating the standalone whatIf block, and refactoring argument processing to distinguish between get/test operations and set/delete operations.
Changes:
- Introduces
whatIfArgwithin set/delete blocks to enable native what-if support - Adds deprecation warning for resources using the legacy
whatIfblock and removesWhatIfcapability fromdsc listoutput - Splits
process_args()intoprocess_get_args()andprocess_set_delete_args()to handle different argument types
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/dsctest/dsctest.dsc.manifests.json | Adds test manifest for Test/WhatIfArgKind resource demonstrating new whatIfArg usage |
| lib/dsc-lib/src/extensions/discover.rs | Updates to use process_get_args and GetArgKind type |
| lib/dsc-lib/src/dscresources/resource_manifest.rs | Splits ArgKind into GetArgKind and SetDeleteArgKind, adds WhatIf variant to latter |
| lib/dsc-lib/src/dscresources/command_resource.rs | Refactors argument processing and updates what-if execution logic to check for native support |
| lib/dsc-lib/src/discovery/command_discovery.rs | Removes WhatIf capability from being reported in resource discovery |
| lib/dsc-lib/locales/en-us.toml | Adds deprecation warning message for legacy whatIf operation |
| dsc/tests/dsc_whatif.tests.ps1 | Adds tests for new WhatIfArgKind functionality and synthetic what-if |
| dsc/src/subcommand.rs | Removes WhatIf capability indicator from resource list output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR Summary
whatIfArgwithin set block in manifestprocess_args()intoprocess_get_args()andprocess_set_delete_args()PR Context
setanddeleteto support what-if #1361 (delete PR to follow)