Skip to content

Add whatif#400

Merged
SteveL-MSFT merged 15 commits intoPowerShell:mainfrom
tgauth:add-whatif
May 16, 2024
Merged

Add whatif#400
SteveL-MSFT merged 15 commits intoPowerShell:mainfrom
tgauth:add-whatif

Conversation

@tgauth
Copy link
Collaborator

@tgauth tgauth commented Apr 12, 2024

PR Summary

  • add what-if flag to config set with synthetic test as a starting point, until resources can eventually implement what-if
  • if a resource does not implement its own pre-test, it returns the synthetic test output
  • if a resource implements its own pre-test then it errors, since the synthetic test output seems less valuable/accurate in this scenario? open to input here
  • delete with what-if is not a supported scenario

PR Context

  • fix Handle WhatIf #70
  • example of config set -w when actual state already matches desired state (first test in dsc_whatif.tests.ps1):
    image
  • example of config set -w when actual state does not match desired state (second test in dsc_whatif.tests.ps1):
    image

Copy link

@anmenaga anmenaga left a comment

Choose a reason for hiding this comment

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

Please add 2 examples of output to PR description for:

  1. running a resource operation in what-if mode;
  2. running a configuration operation in what-if mode.

@tgauth tgauth marked this pull request as ready for review May 2, 2024 22:01
@tgauth tgauth requested review from SteveL-MSFT and anmenaga May 2, 2024 22:02
@SteveL-MSFT
Copy link
Member

@tgauth can you address the merge conflicts?

@tgauth
Copy link
Collaborator Author

tgauth commented May 15, 2024

@tgauth can you address the merge conflicts?

done!

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

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

Some minor feedback, otherwise looks pretty good

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue May 16, 2024
Merged via the queue into PowerShell:main with commit ab558d4 May 16, 2024
@tgauth tgauth deleted the add-whatif branch August 27, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle WhatIf

3 participants