Enable getting adapted resource schema#1401
Open
SteveL-MSFT wants to merge 2 commits intoPowerShell:mainfrom
Open
Enable getting adapted resource schema#1401SteveL-MSFT wants to merge 2 commits intoPowerShell:mainfrom
SteveL-MSFT wants to merge 2 commits intoPowerShell:mainfrom
Conversation
82b01a1 to
a514a25
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables retrieving schemas from adapted resources. For manifest-based adapted resources, the schema is retrieved from the embedded manifest. For non-manifest adapted resources, the adapter is invoked with the schema command, passing the resource type, and returns the schema as JSON.
Changes:
- Added
Schemaoperation to adapter operations - Modified schema retrieval to support adapted resources via adapter invocation
- Updated test cases to verify adapted resource schema retrieval
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/dsctest/src/args.rs | Added Schema variant to AdapterOperation enum |
| tools/dsctest/src/adapter.rs | Implemented schema retrieval logic for adapted test resources |
| tools/dsctest/dsctest.dsc.manifests.json | Updated manifest schemas and added schema command configuration |
| lib/dsc-lib/src/dscresources/resource_manifest.rs | Introduced SchemaArgKind enum and updated SchemaCommand to use it |
| lib/dsc-lib/src/dscresources/dscresource.rs | Added adapter-based schema invocation and updated schema retrieval logic |
| lib/dsc-lib/src/dscresources/command_resource.rs | Added process_schema_args function and updated all functions to pass target_resource |
| dsc/tests/dsc_resource_schema.tests.ps1 | Added test cases for adapted resource schema retrieval |
| dsc/tests/dsc_adapter.tests.ps1 | Updated test expectation to reflect schema structure change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Enable retrieving schema from an adapted resource.
For an adapted resource manifest based resource, it's retrieved from the manifest which must be embedded.
For a non-manifest adapted resource, the adapter is called with the
schemacommand and passed theresourceTypeand the adapter needs to return a JSONLine that represents the schema.Made
process_set_delete_args()private since it's only used within the same filePR Context
Fix #1352
Fix #872