-
Notifications
You must be signed in to change notification settings - Fork 22
chore: Add comparison to Value #523
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
Conversation
…e class Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
…standard2.0 Signed-off-by: André Silva <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #523 +/- ##
==========================================
+ Coverage 87.35% 87.48% +0.12%
==========================================
Files 47 47
Lines 1827 1917 +90
Branches 190 216 +26
==========================================
+ Hits 1596 1677 +81
- Misses 188 191 +3
- Partials 43 49 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| <PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(MicrosoftExtensionsVersion)" /> | ||
| <PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(MicrosoftExtensionsVersion)" /> | ||
| <PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftExtensionsVersion)" /> | ||
| <PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" /> |
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.
Great question. It is used to generate the HashCode for the IEquatable override. Check the documentation here: https://learn.microsoft.com/en-us/dotnet/api/system.hashcode?view=net-9.0
Signed-off-by: André Silva [email protected]
This PR
This pull request introduces enhancements to the
Valueclass in theOpenFeature.Modelnamespace, ensuring better equality handling, and updates dependencies to includeMicrosoft.Bcl.HashCode. The most significant changes include implementing equality comparison forValue, adding hash code generation, and updating project files to include the new dependency.Enhancements to
Valueclass:src/OpenFeature/Model/Value.cs: TheValueclass now implementsIEquatable<Value>and includes methods for equality comparison (Equals,==,!=), hash code generation (GetHashCode), and internal helpers for comparing complex types like structures and lists. This ensures more robust and consistent equality checks. [1] [2]Dependency updates:
Directory.Packages.props: AddedMicrosoft.Bcl.HashCodeas a dependency for hash code generation. Other package references were reformatted for consistency.src/OpenFeature/OpenFeature.csproj: IncludedMicrosoft.Bcl.HashCodefor specific target frameworks (net462andnetstandard2.0).Notes
This implementation is necessary for the comparison in the MultiProvider. See: #488 (comment)