Skip to content
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

Add whatif #400

Merged
merged 15 commits into from
May 16, 2024
Merged

Add whatif #400

merged 15 commits into from
May 16, 2024

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
Collaborator

@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.

dsc_lib/src/configure/mod.rs Outdated Show resolved Hide resolved
@tgauth tgauth marked this pull request as ready for review May 2, 2024 22:01
@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

dsc_lib/src/configure/mod.rs Show resolved Hide resolved
dsc_lib/src/dscresources/command_resource.rs Outdated Show resolved Hide resolved
@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
4 checks passed
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