Add support to pass resource version to adapter#1645
Open
SteveL-MSFT wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the DSC command-resource adapter invocation contract so an adapted resource’s selected version can be forwarded to the adapter executable, addressing the “single mode” adapter discovery/version loop scenario from #1414.
Changes:
- Added a new
ResourceVersionarg kind across manifest argument enums and wired it into command argument construction. - Updated the
dsctestadapter CLI + manifest wiring to accept/forward--resource-version. - Added Pester coverage to validate success/failure when
requireVersionis specified for adapted resources acrossget/set/test/export.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/dsctest/src/main.rs | Passes resource_version through to the adapter implementation. |
| tools/dsctest/src/args.rs | Adds --resource-version to the adapter subcommand CLI surface. |
| tools/dsctest/src/adapter.rs | Introduces fixed adapted resource versions and validates version for Get (but not yet other ops). |
| tools/dsctest/dsctest.dsc.manifests.json | Adds resourceVersionArg wiring for adapter get/set/test/export argument lists. |
| lib/dsc-lib/src/dscresources/resource_manifest.rs | Adds ResourceVersion variants to arg-kind enums (get/setDelete/schema). |
| lib/dsc-lib/src/dscresources/command_resource.rs | Appends the resource version to constructed command arguments when ResourceVersion is present. |
| dsc/tests/dsc_adapter.tests.ps1 | Adds config-level adapter tests covering valid/invalid requireVersion across operations. |
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
resourceVersionArgto ArgKind forget,set,test, andexportoperations for an adapterTest/Adapteradapter to use this new ArgKindPSAdapter was not updated to leverage this as it's a much bigger change. We can defer until we get customer feedback it's needed.
PR Context
Fix #1414