feat: Add --what-if for Microsoft.Windows/FirewallRuleList#1530
Open
Gijsreyn wants to merge 3 commits into
Open
feat: Add --what-if for Microsoft.Windows/FirewallRuleList#1530Gijsreyn wants to merge 3 commits into
--what-if for Microsoft.Windows/FirewallRuleList#1530Gijsreyn wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class --what-if support for the built-in Microsoft.Windows/FirewallRuleList resource by wiring the manifest to pass a what-if flag through to windows_firewall set, projecting state instead of mutating, and surfacing what-if messages via _metadata.whatIf. Also extends the skill documentation with a reusable what-if implementation/testing pattern.
Changes:
- Resource manifest: add
whatIfArgandwhatIfReturnsfor thesetoperation, plus schema support for_metadata.whatIf. - Resource implementation: add
-w/--what-ifparsing and implement non-mutating projections (create/update/delete) with localized what-if messages. - Tests/docs: add a Pester suite for what-if and expand
.github/skills/create-dsc-resource/SKILL.mdwith what-if guidance.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/windows_firewall/windows_firewall.dsc.resource.json | Wires DSC what-if invocation (whatIfArg, whatIfReturns) and extends schema with _metadata.whatIf. |
| resources/windows_firewall/src/main.rs | Parses -w/--what-if and passes it into set_rules. |
| resources/windows_firewall/src/firewall.rs | Implements what-if behavior by projecting results instead of mutating and emitting _metadata.whatIf messages for create/remove. |
| resources/windows_firewall/src/types.rs | Adds _metadata model (Metadata) to the rule type for what-if message payloads. |
| resources/windows_firewall/locales/en-us.toml | Adds localized what-if strings for create/remove messages. |
| resources/windows_firewall/tests/windows_firewall_whatif.tests.ps1 | Adds Pester coverage for what-if create/update/delete/multi-rule behavior. |
| .github/skills/create-dsc-resource/SKILL.md | Documents a standardized what-if pattern for manifests, implementation, localization, and tests. |
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
This pull request adds
--what-ifsupport forMicrosoft.Windows/FirewallRuleList. It also updates theSKILL.mdfile for re-usability across other resources created.PR Context
Partially addresses #1529