Skip to content
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

Renamed field that specifies adapted type #482

Merged
merged 9 commits into from
Jul 12, 2024

Conversation

anmenaga
Copy link
Collaborator

@anmenaga anmenaga commented Jul 3, 2024

PR Summary

Previously, when an adapter process is invoked (for the dsc resource ... command) the actual resource type name is added to the input JSON bag as a special type field.
This results in collisions if resource has an actual type property. (e.g. PSDesiredStateConfiguration/File resource)

This PR renames the special field in the json to adapted_dsc_type which is less likely to cause collisions.

@anmenaga anmenaga changed the title Renamed filed that specifies adapted type Renamed field that specifies adapted type Jul 7, 2024
Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test

@anmenaga
Copy link
Collaborator Author

anmenaga commented Jul 9, 2024

Please add a test

This is already greatly covered by existing tests. Every non-List PSAdapter (and other adapters) operation uses this code path.

@SteveL-MSFT
Copy link
Member

Please add a test

This is already greatly covered by existing tests. Every non-List PSAdapter (and other adapters) operation uses this code path.

But we don't have an explicit test to verify the behavior otherwise it would have failed before this change

@anmenaga
Copy link
Collaborator Author

Added tests and a test adapter that verifies the renamed field.

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Jul 12, 2024
Merged via the queue into PowerShell:main with commit fe1a427 Jul 12, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants