Enable export operation to have own schema#1566
Open
SteveL-MSFT wants to merge 7 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements support for an optional export.schema override in resource manifests, allowing resources to validate export input using a different schema than get/set/test (including a noFiltering mode), and adds test resources + Pester coverage to validate wildcard filtering scenarios (Issue #1232).
Changes:
- Extend the resource manifest model to allow
export.schemawithcommand,embedded, ornoFiltering. - Update export invocation to validate export input against the export-specific schema (or discard input for
noFiltering). - Add
dsctestfixtures/resources and a new Pester test to validate command/embedded/noFiltering export schema behaviors.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/dsctest/src/main.rs | Wires up a new export-schema subcommand and exposes schemas used by the new test resources. |
| tools/dsctest/src/export_schema.rs | Adds a test implementation that exercises export filtering with wildcard-capable input. |
| tools/dsctest/src/args.rs | Adds CLI surface for export-schema and schema generation for export/get vs export input schemas. |
| tools/dsctest/dsctest.dsc.manifests.json | Adds three new test resources covering export schema via command, embedded schema, and noFiltering. |
| tools/dsctest/Cargo.toml | Adds regex dependency for wildcard filtering in the test helper. |
| lib/dsc-lib/src/dscresources/resource_manifest.rs | Introduces ExportSchemaKind and adds schema to the manifest export operation model. |
| lib/dsc-lib/src/dscresources/command_resource.rs | Implements export-specific schema resolution and export-input validation / noFiltering behavior. |
| lib/dsc-lib-jsonschema/.versions.json | Bumps jsonschema patch version metadata (V3_2_2). |
| dsc/tests/dsc_resource_export.tests.ps1 | Adds Pester tests validating export input behavior across the new test resources. |
| Cargo.lock | Locks the new regex dependency for dsctest. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
821fc98 to
4015602
Compare
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
Enables resources supporting
exportto optionally have separate schema fromget,set, andtest.In the resource manifest under the
exportoperation, there is now an optionalschemaproperty that can be:command- same as normal schema which runs a command that returns JSON schemaembedded- same as normal schema which has embedded JSON schemanoFiltering- this string value indicates that the resource doesn't support filtering, so any user input is discarded before calling the resourceNew test resource added to validate these scenarios particularly where the
nameproperty is an enum, but theexportallowsnameto be an arbitrary string to allow passing in wildcards.PR Context
Fix #1232