Fix not failing discovery when finding unsupported manifests#1445
Open
SteveL-MSFT wants to merge 4 commits intoPowerShell:mainfrom
Open
Fix not failing discovery when finding unsupported manifests#1445SteveL-MSFT wants to merge 4 commits intoPowerShell:mainfrom
SteveL-MSFT wants to merge 4 commits intoPowerShell:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts DSC resource/extension discovery so that manifests that can’t be loaded/deserialized no longer cause discovery to fail; instead they are skipped and an info-level message is emitted (to avoid showing by default), improving forward/backward compatibility when manifest schemas evolve.
Changes:
- Skip (instead of failing) when
load_manifest(...)errors during extension discovery; emit aninfolog with context. - Downgrade some discovery failure logs to
infoand add localizedfailedLoadManifestmessages. - Add PowerShell tests asserting invalid manifests don’t break overall discovery and that an info message is produced.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/dsc-lib/src/extensions/discover.rs | Handles load_manifest failures by logging at info and continuing. |
| lib/dsc-lib/src/discovery/mod.rs | Changes discovery-type failure logging from error to info. |
| lib/dsc-lib/src/discovery/command_discovery.rs | Logs manifest-load failures as localized info messages. |
| lib/dsc-lib/locales/en-us.toml | Adds failedLoadManifest localized strings for discovery and extension contexts. |
| dsc/tests/dsc_extension_discover.tests.ps1 | Adds test ensuring invalid extension-discovered manifests don’t fail overall discovery. |
| dsc/tests/dsc_discovery.tests.ps1 | Adds test ensuring invalid resource manifests generate an info message. |
💡 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
When DSC encounters a resource manifest it can't deserialize, it fails discovery completely. This was not intended. This can occur when we update the manifests with new fields that an older DSC does not understand. Instead, DSC should only support resources it can deserialize and emit
infomessages (so they don't show by default) for resources it can't use.