(GH-1529) Add whatIf support for SSHD config resources#1586
Merged
tgauth merged 10 commits intoJun 30, 2026
Conversation
Gijsreyn
force-pushed
the
gh-1529/main/add-whatif-sshdconfig
branch
from
June 22, 2026 15:24
81cb475 to
9363b57
Compare
Gijsreyn
force-pushed
the
gh-1529/main/add-whatif-sshdconfig
branch
from
June 26, 2026 06:03
9363b57 to
dfc95ce
Compare
Gijsreyn
marked this pull request as ready for review
June 26, 2026 06:10
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds --what-if support for the built-in OpenSSH SSHD config resources by wiring a new --what-if flag through the sshdconfig CLI, updating resource manifests to advertise what-if support, and adding Pester coverage to validate both manifest metadata and non-mutating what-if behavior.
Changes:
- Add a
--what-ifflag tosshdconfig setand plumb it into set handlers to return predicted state without applying changes. - Update SSHD-related resource manifests to include
whatIfArgandwhatIfReturns. - Add Pester tests validating manifest what-if declarations and verifying no file/registry writes during what-if runs.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/sshdconfig/tests/sshdconfig.whatif.tests.ps1 | Adds Pester coverage for manifest what-if metadata and what-if “no side effects” behavior. |
| resources/sshdconfig/sshd-windows.dsc.resource.json | Declares what-if support for the Windows global SSHD settings resource. |
| resources/sshdconfig/sshd-subsystemList.dsc.resource.json | Declares what-if support for the SubsystemList resource. |
| resources/sshdconfig/sshd-subsystem.dsc.resource.json | Declares what-if support for the Subsystem resource. |
| resources/sshdconfig/sshd_config.dsc.resource.json | Declares what-if support for the sshd_config resource. |
| resources/sshdconfig/src/set.rs | Implements what-if behavior in set paths and returns predicted state when requested. |
| resources/sshdconfig/src/main.rs | Wires the what_if flag from CLI parsing into invoke_set. |
| resources/sshdconfig/src/args.rs | Adds --what-if/-w flag to the set subcommand. |
| resources/sshdconfig/locales/en-us.toml | Adds localized help text for the new what-if flag. |
Comments suppressed due to low confidence (1)
resources/sshdconfig/src/set.rs:107
- In
--what-ifmode,get_existing_config(cmd_info)?can indirectly seed/copy a defaultsshd_configviaensure_sshd_config_exists(...)(seeget_existing_configimplementation). That would be a side effect during what-if for repeat-keyword operations when the target config file doesn’t exist yet.
let (keyword, entry_value) = extract_single_keyword(keyword_input.additional_properties)?;
let mut existing_config = get_existing_config(cmd_info)?;
Collaborator
Author
|
@tgauth, do you mind doing a review on this one? |
Gijsreyn
force-pushed
the
gh-1529/main/add-whatif-sshdconfig
branch
from
June 28, 2026 05:44
e2cbea1 to
1ba1564
Compare
tgauth
reviewed
Jun 29, 2026
Gijsreyn
force-pushed
the
gh-1529/main/add-whatif-sshdconfig
branch
from
June 30, 2026 03:15
1ba1564 to
b6b90a4
Compare
…//github.com/Gijsreyn/operation-methods into PowerShellgh-1529/main/add-whatif-sshdconfig
Collaborator
Author
|
@tgauth - newline added and rebased. Ready for merge :) |
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
Add whatIf support for SSHD config resources.
PR Context
Partially addresses #1529.