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: eval context fixes and new error types #43

Merged
merged 3 commits into from
Nov 8, 2022

Conversation

rgrassian-split
Copy link
Contributor

Signed-off-by: Robert Grassian [email protected]

This PR

  • Changes the evaluation context merge to create and return a new object rather than modify itself. This fixes a bug where the openfeature api level context was being overwritten by the client's context
  • Creates TargetingKeyMissingError and InvalidContextError, along with their error codes
  • Adds an evaluation context setter on the client

@rgrassian-split rgrassian-split changed the title eval context fixes and new error types fix: eval context fixes and new error types Nov 3, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2022

Codecov Report

Merging #43 (9da38aa) into main (df0c033) will decrease coverage by 0.81%.
The diff coverage is 78.57%.

@@            Coverage Diff             @@
##             main      #43      +/-   ##
==========================================
- Coverage   93.59%   92.78%   -0.82%     
==========================================
  Files          17       17              
  Lines         281      291      +10     
==========================================
+ Hits          263      270       +7     
- Misses         18       21       +3     
Flag Coverage Δ
unittests 92.78% <78.57%> (-0.82%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
open_feature/exception/exceptions.py 78.26% <66.66%> (-4.10%) ⬇️
open_feature/open_feature_client.py 95.77% <66.66%> (-1.33%) ⬇️
...n_feature/evaluation_context/evaluation_context.py 90.00% <100.00%> (ø)
open_feature/flag_evaluation/error_code.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rgrassian-split, totally agree with the new approach for the context merging, thanks for submitting this. I've added some comments in a few places.

open_feature/open_feature_client.py Outdated Show resolved Hide resolved
open_feature/exception/exceptions.py Outdated Show resolved Hide resolved
open_feature/exception/exceptions.py Outdated Show resolved Hide resolved
Signed-off-by: Robert Grassian <[email protected]>
Signed-off-by: Robert Grassian <[email protected]>
@beeme1mr
Copy link
Member

beeme1mr commented Nov 8, 2022

@matthewelwell @ajhelsby any concerns about merging this?

@matthewelwell matthewelwell merged commit 06d0494 into open-feature:main Nov 8, 2022
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.

5 participants