- Notifications
You must be signed in to change notification settings - Fork45
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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’smetadata
field, ignoring anyMicrosoft.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 | DefineMetadata struct for CLI |
tools/dsctest/src/main.rs | Registermetadata subcommand and serialize metadata outputs |
tools/dsctest/src/args.rs | AddMetadata 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 ignoredMicrosoft.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 {
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
beb05fb
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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