-
Notifications
You must be signed in to change notification settings - Fork 22
fix: Add generic to evaluation event builder #500
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
…ingly Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #500 +/- ##
==========================================
- Coverage 87.08% 86.96% -0.12%
==========================================
Files 45 45
Lines 1757 1734 -23
Branches 184 177 -7
==========================================
- Hits 1530 1508 -22
- Misses 187 190 +3
+ Partials 40 36 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR introduces a generic type parameter T to the EvaluationEventBuilder class to increase its flexibility when processing various data types for evaluation events. It updates the builder's API to be generic and converts the Build method to a static method, with corresponding adjustments made to the tests.
- Converted EvaluationEventBuilder to a generic class and updated its static Default property and Build method.
- Modified EvaluationEventBuilderTests to use the static Build method on EvaluationEventBuilder rather than an instance method.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/OpenFeature/Telemetry/EvaluationEventBuilder.cs | Updated class and methods to be generic with a static API. |
test/OpenFeature.Tests/Telemetry/EvaluationEventBuilderTests.cs | Adjusted tests to adopt the new generic static Build method. |
test/OpenFeature.Tests/Telemetry/EvaluationEventBuilderTests.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: André Silva <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [2.7.0](v2.6.0...v2.7.0) (2025-07-03) ### 🐛 Bug Fixes * Add generic to evaluation event builder ([#500](#500)) ([68af649](68af649)) * ArgumentNullException when creating a client with optional name ([#508](#508)) ([9151dcd](9151dcd)) ### ✨ New Features * Move OTEL hooks to the SDK ([#338](#338)) ([77f6e1b](77f6e1b)) ### 🧹 Chore * **deps:** update actions/attest-build-provenance action to v2.4.0 ([#495](#495)) ([349c073](349c073)) * **deps:** update actions/attest-sbom action to v2.4.0 ([#496](#496)) ([f7ca416](f7ca416)) * **deps:** update dependency benchmarkdotnet to 0.15.0 ([#481](#481)) ([714425d](714425d)) * **deps:** update dependency benchmarkdotnet to 0.15.2 ([#494](#494)) ([cab3807](cab3807)) * **deps:** update dependency microsoft.net.test.sdk to 17.14.0 ([#482](#482)) ([520d383](520d383)) * **deps:** update dependency microsoft.net.test.sdk to 17.14.1 ([#485](#485)) ([78bfdbf](78bfdbf)) * **deps:** update dependency opentelemetry.instrumentation.aspnetcore to 1.12.0 ([#505](#505)) ([241d880](241d880)) * **deps:** update dependency reqnroll.xunit to 2.4.1 ([#483](#483)) ([99f7584](99f7584)) * **deps:** update dependency system.valuetuple to 4.6.1 ([#503](#503)) ([39f884d](39f884d)) * **deps:** update github/codeql-action digest to 39edc49 ([#504](#504)) ([08ff43c](08ff43c)) * **deps:** update github/codeql-action digest to ce28f5b ([#492](#492)) ([cce224f](cce224f)) * **deps:** update github/codeql-action digest to fca7ace ([#486](#486)) ([e18ad50](e18ad50)) * **deps:** update opentelemetry-dotnet monorepo to 1.12.0 ([#506](#506)) ([69dc186](69dc186)) * **deps:** update spec digest to 1965aae ([#499](#499)) ([2e3dffd](2e3dffd)) * **deps:** update spec digest to 42340bb ([#493](#493)) ([909c51d](909c51d)) * **deps:** update spec digest to c37ac17 ([#502](#502)) ([38f63fc](38f63fc)) * **deps:** update spec digest to f014806 ([#479](#479)) ([dbe8b08](dbe8b08)) * fix sample build warning ([#498](#498)) ([08a00e1](08a00e1)) ### 📚 Documentation * add XML comment on FeatureClient ([#507](#507)) ([f923cea](f923cea)) * updated contributing link on the README ([8435bf7](8435bf7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: André Silva [email protected]
This PR
This pull request introduces a generic type parameter
T
to theEvaluationEventBuilder
class to enhance its flexibility and adaptability for different data types. Corresponding updates have been made to the test suite to accommodate this change.Updates to
EvaluationEventBuilder
:EvaluationEventBuilder
class now includes a generic type parameterT
, allowing it to handle different data types for evaluation events. This change affects its definition, theDefault
property, and theBuild
method. (src/OpenFeature/Telemetry/EvaluationEventBuilder.cs
, src/OpenFeature/Telemetry/EvaluationEventBuilder.csL9-R24)Updates to Tests:
EvaluationEventBuilderTests
class to use the genericEvaluationEventBuilder<Value>
instead of the non-generic version. (test/OpenFeature.Tests/Telemetry/EvaluationEventBuilderTests.cs
, test/OpenFeature.Tests/Telemetry/EvaluationEventBuilderTests.csL9-R9)EvaluationEventBuilderTests
to call the staticBuild
method onEvaluationEventBuilder<Value>
directly, ensuring compatibility with the new generic implementation. (test/OpenFeature.Tests/Telemetry/EvaluationEventBuilderTests.cs
, [1] [2] [3] [4] [5] [6] [7]