add WhatIfReturns field to resource manifest#1386
Open
tgauth wants to merge 8 commits intoPowerShell:mainfrom
Open
add WhatIfReturns field to resource manifest#1386tgauth wants to merge 8 commits intoPowerShell:mainfrom
tgauth wants to merge 8 commits intoPowerShell:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for specifying a different set return shape during what-if execution via a new whatIfReturns manifest field, and updates test/registry manifests and tests to exercise state-vs-stateAndDiff scenarios.
Changes:
- Add
whatIfReturnsto the resource manifestsetmethod and honor it duringinvoke_setwhenexecutionType=WhatIf. - Extend
dsctestwhat-if output to optionally emitstateAndDiff(two-line output) and add a new test manifest entry. - Update the Registry resource manifest to rely on
whatIfArg/whatIfReturnsinstead of a dedicatedwhatIfoperation, and add/adjust PowerShell tests.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/dsctest/src/whatif.rs | Adds fromResource field to dsctest what-if state payload. |
| tools/dsctest/src/main.rs | Adds --state-and-diff mode for dsctest what-if output (state + diff). |
| tools/dsctest/src/args.rs | Adds CLI flag to control stateAndDiff output. |
| tools/dsctest/dsctest.dsc.manifests.json | Adds Test/WhatIfReturnDiff resource manifest using whatIfReturns. |
| resources/registry/registry.dsc.resource.json | Migrates Registry manifest to whatIfArg/whatIfReturns and removes dedicated whatIf op. |
| lib/dsc-lib/src/dscresources/resource_manifest.rs | Introduces whatIfReturns on SetMethod. |
| lib/dsc-lib/src/dscresources/command_resource.rs | Uses whatIfReturns to select return parsing behavior for what-if set. |
| dsc/tests/dsc_whatif.tests.ps1 | Adds coverage for whatIfReturns=stateAndDiff behavior. |
| dsc/tests/dsc_resource_set.tests.ps1 | Adjusts assertion for changedProperties shape in what-if set test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SteveL-MSFT
requested changes
Mar 11, 2026
SteveL-MSFT
approved these changes
Mar 11, 2026
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
WhatIfReturnsfield to resource manifestWhatIfReturns(for StateAndDiff scenario)WhatIfArgandWhatIfReturns(for State scenario)PR Context
WhatIfArg, it became clear that there was no way to specify a different return between anActualand aWhatIfexecution forset