Enable deprecation of resources and extensions#1398
Enable deprecation of resources and extensions#1398SteveL-MSFT merged 10 commits intoPowerShell:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds deprecation support to DSC by introducing an optional deprecationMessage field to resource, extension, and adapted resource manifests. When this field is present, a warning message is displayed to users when the resource or extension is invoked. The PR also marks the legacy PowerShell adapters (Microsoft.DSC/PowerShell and Microsoft.Windows/WindowsPowerShell) as deprecated, directing users to use the newer Microsoft.Adapters/PowerShell and Microsoft.Adapters/WindowsPowerShell adapters instead.
Changes:
- Added
deprecationMessageoptional field to resource, extension, and adapted resource manifest structures - Implemented warning emission logic across all resource and extension operations
- Applied
rename_all = "camelCase"serde attribute to manifest structs, eliminating manual field renaming - Marked old PowerShell adapters as deprecated with appropriate messages
- Added comprehensive test coverage for deprecation warnings
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/dsc-lib/src/dscresources/resource_manifest.rs | Added deprecationMessage field to ResourceManifest with proper serialization attributes |
| lib/dsc-lib/src/extensions/extension_manifest.rs | Added deprecationMessage field and applied rename_all camelCase attribute |
| lib/dsc-lib/src/dscresources/adapted_resource_manifest.rs | Added deprecationMessage field to adapted resource manifests |
| lib/dsc-lib/src/dscresources/dscresource.rs | Added deprecation warning emission to all resource operations (get, set, test, delete, validate, schema, export, resolve) |
| lib/dsc-lib/src/extensions/dscextension.rs | Added deprecationMessage field to DscExtension output struct |
| lib/dsc-lib/src/extensions/discover.rs | Added deprecation warning emission to discover operation |
| lib/dsc-lib/src/extensions/import.rs | Added deprecation warning emission to import operation |
| lib/dsc-lib/src/extensions/secret.rs | Added deprecation warning emission to secret operation |
| lib/dsc-lib/src/discovery/command_discovery.rs | Updated manifest loading to include deprecation_message field |
| lib/dsc-lib/locales/en-us.toml | Added localized deprecation warning messages for resources and extensions |
| adapters/powershell/powershell.dsc.resource.json | Marked Microsoft.DSC/PowerShell adapter as deprecated |
| adapters/powershell/windowspowershell.dsc.resource.json | Marked Microsoft.Windows/WindowsPowerShell adapter as deprecated |
| tools/dsctest/src/main.rs | Added NoOp subcommand for testing |
| tools/dsctest/src/args.rs | Added NoOp subcommand definition |
| tools/dsctest/src/adapter.rs | Added Adapted/Deprecated test resource |
| tools/dsctest/dsctest.dsc.manifests.json | Added test manifests for deprecated resources and extensions |
| tools/test_group_resource/src/main.rs | Updated to include deprecation_message field (set to None) |
| dsc/tests/dsc_resource_deprecated.tests.ps1 | New comprehensive test suite for deprecated resources |
| dsc/tests/dsc_extension_secret.tests.ps1 | Added test for deprecated extension warning in secret operations |
| dsc/tests/dsc_extension_import.tests.ps1 | New test file for deprecated extension import behavior |
| dsc/tests/dsc_extension_discover.tests.ps1 | Added tests for deprecated extension discovery behavior |
| dsc/tests/dsc_adapter.tests.ps1 | Added test for deprecated adapted resource warnings |
| adapters/powershell/Tests/win_powershellgroup.tests.ps1 | Added deprecation warning verification for WindowsPowerShell adapter |
| adapters/powershell/Tests/powershellgroup.config.tests.ps1 | Added deprecation warning verification for PowerShell adapter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… deprecate-psadapter
PR Summary
Add
deprecationMessageoptional field to resource, extension, and adapted resource manifests.If this field exists, a warning message is emitted when the resource or extension is used (but not when discovered).
Microsoft.DSC/PowerShellandMicrosoft.Windows/WindowsPowerShellmanifests have been marked as deprecated pointing users to use the new adapters instead.PR Context
Fix #1368