feat: Add --what-if for Microsoft.Windows/UpdateList#1616
Open
Gijsreyn wants to merge 8 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds --what-if support for the built-in Microsoft.Windows/UpdateList resource by wiring the manifest to pass the what-if flag, projecting “after” state during what-if execution, and exposing what-if messages via _metadata.
Changes:
- Updated the
Microsoft.Windows/UpdateListresource manifest to declare what-if behavior forset(whatIfArg/whatIfReturns) and align with v3 manifest fields (implementsPretest). - Added projected what-if behavior in the Windows Update
setimplementation, returning_metadata.whatIfmessages instead of mutating state. - Added Pester tests covering what-if behavior for installing and already-installed updates.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/WindowsUpdate/windowsupdate.dsc.resource.json | Enables what-if for set and adds _metadata.whatIf schema support. |
| resources/WindowsUpdate/tests/windowsupdate_whatif.tests.ps1 | Adds what-if integration tests for Microsoft.Windows/UpdateList. |
| resources/WindowsUpdate/src/windows_update/types.rs | Introduces _metadata Rust types and includes them in UpdateInfo. |
| resources/WindowsUpdate/src/windows_update/set.rs | Implements what-if projection for update installation with localized what-if messages. |
| resources/WindowsUpdate/src/windows_update/export.rs | Ensures UpdateInfo construction includes metadata: None. |
| resources/WindowsUpdate/src/main.rs | Threads what-if detection into handle_set. |
| resources/WindowsUpdate/locales/en-us.toml | Adds localized what-if message template for update installation. |
6800641 to
0c5badd
Compare
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/UpdateList.PR Context
Partially addresses #1529