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

fix: correct merging of contexts with targetingKey #136

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

mmito
Copy link
Contributor

@mmito mmito commented Oct 28, 2024

This PR

Corrects the behavior of EvaluationContextMerger merge() when using string targetingKey.

Related Issues

Fixes #135

Notes

Follow-up Tasks

How to test

The testEvaluationContextMergingTargetingKey test in EvaluationContextTest.php has been added. The test fails without the proposed fix, as expected.

@mmito mmito requested a review from tcarrio as a code owner October 28, 2024 11:25
@mmito mmito force-pushed the fix/incorrect-context-merge branch from 548d605 to c1429a8 Compare October 28, 2024 11:51
Signed-off-by: Tommaso Tofacchi <tofacchitommaso@gmail.com>
@mmito mmito force-pushed the fix/incorrect-context-merge branch from c1429a8 to c2375d3 Compare October 28, 2024 11:56
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

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

Project coverage is 95.71%. Comparing base (2123274) to head (c2375d3).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...c/implementation/flags/EvaluationContextMerger.php 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #136      +/-   ##
============================================
+ Coverage     95.19%   95.71%   +0.52%     
  Complexity      227      227              
============================================
  Files            40       40              
  Lines           583      584       +1     
============================================
+ Hits            555      559       +4     
+ Misses           28       25       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mmito
Copy link
Contributor Author

mmito commented Oct 28, 2024

@beeme1mr shall I add a test hitting the line that is currently missing per codecov?

@beeme1mr
Copy link
Member

I view it as optional for a change like this.

@tcarrio
Copy link
Member

tcarrio commented Oct 28, 2024

Thank you for the PR @mmito 👋 This looks good to me. I will go ahead and override the codecov, since it is still a net improvement on coverage, and merge this in

@tcarrio tcarrio merged commit 3f141d7 into open-feature:main Oct 28, 2024
9 of 10 checks passed
beeme1mr pushed a commit that referenced this pull request Oct 28, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.0.10](2.0.9...2.0.10)
(2024-10-28)


### 🐛 Bug Fixes

* correct merging of contexts with targetingKey
([#136](#136))
([3f141d7](3f141d7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

[BUG] Incorrect context merging when context is passed via get[...]Details/Value()
3 participants