Fix nested diff w/ schema and schema cache miss - #1680
Open
Steve Lee (SteveL-MSFT) wants to merge 3 commits into
Open
Fix nested diff w/ schema and schema cache miss#1680Steve Lee (SteveL-MSFT) wants to merge 3 commits into
Steve Lee (SteveL-MSFT) wants to merge 3 commits into
Conversation
Steve Lee (SteveL-MSFT)
requested review from
Mikey Lombardi (He/Him) (michaeltlombardi)
and removed request for
Copilot
August 18, 2026 16:59
Mikey Lombardi (He/Him) (michaeltlombardi)
left a comment
Collaborator
There was a problem hiding this comment.
This looks pretty coherent to me. My only request would be a test to validate that it behaves as expected, particularly for the nested property with a reference.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Improves synthetic test diffing by making schema-aware comparisons work correctly for nested object properties (including referenced schemas and writeOnly handling) and by ensuring schema comparisons still work when the schema cache is cold/missed.
Changes:
- Pass the relevant nested schema into recursive diffing and resolve local
$refs so nestedwriteOnly/defaultmetadata is honored. - On schema cache miss, parse the schema returned by
get_schemaand use it immediately (with best-effort cache population). - Extend the SchemaDefault test resource/schema and add Pester coverage for nested
writeOnlyobjects and$ref-referenced nested schemas.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/dsctest/src/schema_default.rs | Extends the SchemaDefault test input model to include nested objects and defaults, aligned with camelCase JSON. |
| tools/dsctest/src/main.rs | Adjusts SchemaDefault synthetic “actual state” output to include nested objects when present in input. |
| tools/dsctest/dsctest.dsc.manifests.json | Updates the embedded schema for Test/SchemaDefault to include nested and referenced nested definitions with writeOnly secret handling. |
| lib/dsc-lib/src/dscresources/dscresource.rs | Enhances get_diff_with_schema to recurse with the correct nested schema and resolve local $refs for accurate nested comparisons. |
| lib/dsc-lib/src/dscresources/command_resource.rs | Improves synthetic test behavior on schema cache miss by parsing/using the returned schema directly and caching it best-effort. |
| dsc/tests/dsc_schema_default.tests.ps1 | Adds tests verifying nested writeOnly objects are ignored and non-writeOnly nested differences are reported (including $ref cases). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
writeOnlyproperties