Skip to content

Conversation

askpt
Copy link
Member

@askpt askpt commented Jun 25, 2025

Signed-off-by: André Silva [email protected]

This PR

This pull request introduces a generic type parameter T to the EvaluationEventBuilder 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:

  • The EvaluationEventBuilder class now includes a generic type parameter T, allowing it to handle different data types for evaluation events. This change affects its definition, the Default property, and the Build method. (src/OpenFeature/Telemetry/EvaluationEventBuilder.cs, src/OpenFeature/Telemetry/EvaluationEventBuilder.csL9-R24)

Updates to Tests:

  • Updated the EvaluationEventBuilderTests class to use the generic EvaluationEventBuilder<Value> instead of the non-generic version. (test/OpenFeature.Tests/Telemetry/EvaluationEventBuilderTests.cs, test/OpenFeature.Tests/Telemetry/EvaluationEventBuilderTests.csL9-R9)
  • Modified all test cases in EvaluationEventBuilderTests to call the static Build method on EvaluationEventBuilder<Value> directly, ensuring compatibility with the new generic implementation. (test/OpenFeature.Tests/Telemetry/EvaluationEventBuilderTests.cs, [1] [2] [3] [4] [5] [6] [7]

Copy link

codecov bot commented Jun 25, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.96%. Comparing base (2e3dffd) to head (8d4eb13).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rc/OpenFeature/Telemetry/EvaluationEventBuilder.cs 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@askpt askpt changed the title fix:Add generic to evaluation event builder fix: Add generic to evaluation event builder Jun 25, 2025
@askpt askpt requested a review from Copilot June 25, 2025 16:59
Copy link
Contributor

@Copilot Copilot AI left a 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.

@askpt askpt marked this pull request as ready for review June 25, 2025 17:01
@askpt askpt requested a review from a team as a code owner June 25, 2025 17:01
@askpt askpt enabled auto-merge June 25, 2025 17:01
@beeme1mr beeme1mr disabled auto-merge June 25, 2025 17:07
@beeme1mr beeme1mr merged commit 68af649 into main Jun 25, 2025
15 of 17 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Jul 3, 2025
🤖 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]>
@askpt askpt deleted the askpt/add-generic-event-builder branch July 3, 2025 16:57
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

Successfully merging this pull request may close these issues.

2 participants