-
Notifications
You must be signed in to change notification settings - Fork 47
Enable resources to return metadata #947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Enable resources to return a _metadata
object that’s merged into the resource’s metadata
field, ignoring any Microsoft.DSC
entries (with a warning), and applied consistently across all operations.
- Add
Metadata
struct and CLI support indsctest
for emitting metadata - Enhance
configurator
to extract_metadata
intoResource*Result.metadata
and emit warnings for reserved keys - Introduce manifest, locale strings, and end-to-end tests for the new Test/Metadata resource
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tools/dsctest/src/metadata.rs | Define Metadata struct for CLI |
tools/dsctest/src/main.rs | Register metadata subcommand and serialize metadata outputs |
tools/dsctest/src/args.rs | Add Metadata variant to CLI args |
tools/dsctest/metadata.dsc.resource.json | Add manifest for Test/Metadata resource |
dsc_lib/src/configure/mod.rs | Extract _metadata and integrate into resource metadata |
dsc_lib/locales/en-us.toml | Add messages for ignored Microsoft.DSC and invalid metadata |
dsc/tests/dsc_metadata.tests.ps1 | Add tests verifying metadata extraction and warning emission |
Comments suppressed due to low confidence (2)
dsc/tests/dsc_metadata.tests.ps1:27
- [nitpick] Consider adding an assertion for
metadata.count
to ensure thecount
property is populated correctly as part of the metadata object.
$out.results[0].metadata.myNumber | Should -Be 42
tools/dsctest/src/main.rs:134
- [nitpick] The loop variable
i
is ambiguous; consider renaming it (e.g.,index
) for better readability.
for i in 0..count {
3cff2a3
to
bcb6ead
Compare
PR Summary
Enable resources to return
_metadata
object that gets populated into the resourcemetadata
field. ReservedMicrosoft.DSC
property is ignored, but a warning message is emitted. Works for all operations.Also some reordering of existing code to keep it in proper order.
PR Context
Fix #467