Skip to content

Add support to pass resource version to adapter#1645

Merged
SteveL-MSFT merged 5 commits into
PowerShell:mainfrom
SteveL-MSFT:adapter-single-version
Jul 24, 2026
Merged

Add support to pass resource version to adapter#1645
SteveL-MSFT merged 5 commits into
PowerShell:mainfrom
SteveL-MSFT:adapter-single-version

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

PR Summary

  • Add new resourceVersionArg to ArgKind for get, set, test, and export operations for an adapter
  • Update the Test/Adapter adapter to use this new ArgKind
  • Added tests to cover positive and negative cases for all operations

PSAdapter 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

Copilot AI review requested due to automatic review settings July 23, 2026 20:51
@SteveL-MSFT SteveL-MSFT added this to the 3.3-Approved milestone Jul 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ResourceVersion arg kind across manifest argument enums and wired it into command argument construction.
  • Updated the dsctest adapter CLI + manifest wiring to accept/forward --resource-version.
  • Added Pester coverage to validate success/failure when requireVersion is specified for adapted resources across get/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.

Comment thread tools/dsctest/src/adapter.rs
Copilot AI review requested due to automatic review settings July 23, 2026 21:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread tools/dsctest/dsctest.dsc.manifests.json
Comment thread dsc/tests/dsc_adapter.tests.ps1
Copilot AI review requested due to automatic review settings July 23, 2026 21:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@Gijsreyn Gijsreyn added Schema-Impact Change requires updating a canonical schema for configs or manifests Doc-Impact labels Jul 24, 2026
@SteveL-MSFT
SteveL-MSFT added this pull request to the merge queue Jul 24, 2026
Merged via the queue into PowerShell:main with commit 2d37234 Jul 24, 2026
20 checks passed
@SteveL-MSFT
SteveL-MSFT deleted the adapter-single-version branch July 24, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-Needed Doc-Impact Schema-Impact Change requires updating a canonical schema for configs or manifests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need to pass resource version to adapter single mode

4 participants