[SSHDConfig] Move filepath from metadata to properties#1577
Conversation
…nfig-filepath-property # Conflicts: # resources/sshdconfig/tests/sshdconfig.set.tests.ps1
There was a problem hiding this comment.
Pull request overview
This PR updates the sshdconfig DSC resource to treat the target sshd_config path as an input property (_filepath) rather than an item under _metadata, aligning configuration shape with how the path affects resource behavior (per #1570).
Changes:
- Replace
_metadata.filepathwith_filepathacross thesshdconfigresource schemas, Rust input parsing, and most Pester tests. - Update canonical-property handling to recognize
_filepathas a first-class canonical property. - Adjust get/set code paths to read/write and echo
_filepathrather than_metadata.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/sshdconfig/tests/sshdconfigRepeatList.tests.ps1 | Updates test inputs to pass _filepath instead of _metadata.filepath (some _metadata usages remain). |
| resources/sshdconfig/tests/sshdconfigRepeat.tests.ps1 | Updates test inputs to pass _filepath instead of _metadata.filepath (some _metadata usages remain). |
| resources/sshdconfig/tests/sshdconfig.set.tests.ps1 | Updates set-path tests to use _filepath inputs. |
| resources/sshdconfig/tests/sshdconfig.get.tests.ps1 | Updates get-path tests to use _filepath inputs. |
| resources/sshdconfig/sshd-subsystemList.dsc.resource.json | Moves the file path from _metadata.filepath to _filepath in the resource schema. |
| resources/sshdconfig/sshd-subsystem.dsc.resource.json | Moves the file path from _metadata.filepath to _filepath in the resource schema. |
| resources/sshdconfig/sshd_config.dsc.resource.json | Adds _filepath to the main sshd_config resource schema properties. |
| resources/sshdconfig/src/util.rs | Changes command-info construction to extract _filepath and build CommandInfo accordingly. |
| resources/sshdconfig/src/set.rs | Switches set flows to use cmd_info.filepath rather than cmd_info.metadata.filepath. |
| resources/sshdconfig/src/repeat_keyword.rs | Updates repeat-operation input structs to accept _filepath directly. |
| resources/sshdconfig/src/inputs.rs | Removes the Metadata struct and adds filepath: Option<PathBuf> directly to CommandInfo. |
| resources/sshdconfig/src/get.rs | Reads from cmd_info.filepath and emits _filepath in results when set. |
| resources/sshdconfig/src/canonical_properties.rs | Introduces _filepath as a canonical property (and removes _metadata). |
| Cargo.lock | Updates the lockfile (currently includes a version mismatch for dsc-resource-registry). |
| metadata: | ||
| filepath: $filepath | ||
| properties: | ||
| _filepath: $filepath |
There was a problem hiding this comment.
We want to only use leading underscore properties for canonical properties, so in this case, it should just be filepath. I think with a concern about name collision with a future SSHD keyword, we should discuss in the WG whether we elevate to a canonical property _filepath particularly if such a scenario would affect many different resources which might be the case.
…th/dsc into move-filepath-to-properties
PR Summary
PR Context