Skip to content

Add whatif - #400

Merged
Steve Lee (SteveL-MSFT) merged 15 commits into
PowerShell:mainfrom
tgauth:add-whatif
May 16, 2024
Merged

Add whatif#400
Steve Lee (SteveL-MSFT) merged 15 commits into
PowerShell:mainfrom
tgauth:add-whatif

Conversation

@tgauth

@tgauth Tess Gauthier (tgauth) commented Apr 12, 2024

Copy link
Copy Markdown
Collaborator

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

@anmenaga Andrew (anmenaga) left a comment

Copy link
Copy Markdown

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.

Comment thread dsc_lib/src/configure/mod.rs Outdated
@SteveL-MSFT

Copy link
Copy Markdown
Member

Tess Gauthier (@tgauth) can you address the merge conflicts?

@tgauth

Copy link
Copy Markdown
Collaborator Author

Tess Gauthier (@tgauth) can you address the merge conflicts?

done!

@SteveL-MSFT Steve Lee (SteveL-MSFT) left a comment

Copy link
Copy Markdown
Member

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

Comment thread dsc_lib/src/configure/mod.rs
Comment thread dsc_lib/src/dscresources/command_resource.rs Outdated
@SteveL-MSFT
Steve Lee (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
Tess Gauthier (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