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

[BREAKING] 0.4.8 hashtable properties are case-sensitive #161

Closed
f-bader opened this issue Dec 16, 2024 · 6 comments
Closed

[BREAKING] 0.4.8 hashtable properties are case-sensitive #161

f-bader opened this issue Dec 16, 2024 · 6 comments

Comments

@f-bader
Copy link

f-bader commented Dec 16, 2024

In the latest version 0.4.8 the resulting hastable is created in a way where the keys are looked-up in a case-sensitive manner. However, PowerShell is case-insensitive in nature and it is best to create hashtables with case-insensitive key look-up.

This can achieved using IEqualityComparer

If this is intentional it would be great to point it out as a breaking change

@gabriel-samfira
Copy link
Member

Hi @f-bader

This is a duplicate of:

The change was intentional (details in the above issue), and the fact that there was no warning on my part is bad, and will change in the future.

TL;DR so you don't have to read the whole issue:

  • The change has been reverted
  • A new version will be published today
  • The change will be added back after the holidays
  • A new release "protocol" will be created with pre-releases before a final release (if possible please help test out future pre-releases if possible).

I will leave this open until the new release is published today.

@gabriel-samfira
Copy link
Member

gabriel-samfira commented Dec 16, 2024

Articles like this: https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/rules/useliteralinitializerforhashtable?view=ps-modules

Is why I started having gray hairs before my time. Case insensitivity was a mistake. Microsoft telling people to write code that relies on case insensitivity is mind boggling. Especially considering it can lead to data loss if the data source you're consuming is inherently case sensitive (which YAML is).

My apologies for breaking compatibility with no notice. I know this may have caused some hours of debugging. That is something I will try harder to avoid in the future.

@f-bader
Copy link
Author

f-bader commented Dec 16, 2024

HI @gabriel-samfira sorry I missed the already closed incident on this.
Thanks for the prompt reply and action.

A new release "protocol" will be created with pre-releases before a final release (if possible please help test out future pre-releases if possible).

Definitely will do. Will implement this pre-release in the testing environment.

My apologies for breaking compatibility with no notice. I know this may have caused some hours of debugging. That is something I will try harder to avoid in the future.

Thank you for your continued development and support for this important module! It's the best YAML parser out there.

@gabriel-samfira
Copy link
Member

A new version has been released: https://www.powershellgallery.com/packages/powershell-yaml/0.4.9

A new release has been generated on GitHub: https://github.com/cloudbase/powershell-yaml/releases/tag/v0.4.9

Please test it out and let me know if all is well.

@gabriel-samfira
Copy link
Member

Thank you for your continued development and support for this important module! It's the best YAML parser out there.

This humble module is a thin wrapper on top of the amazing YamlDotNet library. They deserve all the appreciation and support they can get (especially considering they are a small team).

@gabriel-samfira
Copy link
Member

Fixed in v0.4.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants