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

feat: spec-0.2.0 #38

Merged
merged 17 commits into from
Nov 9, 2022
Merged

feat: spec-0.2.0 #38

merged 17 commits into from
Nov 9, 2022

Conversation

ajhelsby
Copy link
Contributor

@ajhelsby ajhelsby commented Nov 2, 2022

This PR

Adds all the features required to reach compliance with spec 0.2.0

  • Have different methods for float and int
  • Remove context transformers. Add provider hooks
  • Ensure context merging behavior is correct
  • Add the ability to fetch all custom fields
  • Ensure evaluation context keys are unique
  • Ensure provider hook are correctly ordered

Related Issues

Fixes #7

Notes

"Add the ability to fetch all custom fields" and "Ensure evaluation context keys are unique" are solved implicitly. One could access ctx.attributes and the fact that they are a dict should solve the uniqueness.

Follow-up Tasks

How to test

Unit tests 💯

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 2, 2022

Codecov Report

Merging #38 (9fe8a5f) into main (df0c033) will decrease coverage by 0.23%.
The diff coverage is 94.23%.

@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
- Coverage   93.59%   93.35%   -0.24%     
==========================================
  Files          17       18       +1     
  Lines         281      316      +35     
==========================================
+ Hits          263      295      +32     
- Misses         18       21       +3     
Flag Coverage Δ
unittests 93.35% <94.23%> (-0.24%) ⬇️

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

Impacted Files Coverage Δ
open_feature/provider/provider.py 74.07% <77.77%> (-0.93%) ⬇️
open_feature/open_feature_client.py 96.38% <95.83%> (-0.72%) ⬇️
...feature/flag_evaluation/flag_evaluation_options.py 100.00% <100.00%> (ø)
open_feature/flag_evaluation/flag_type.py 100.00% <100.00%> (ø)
open_feature/provider/no_op_provider.py 100.00% <100.00%> (ø)

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

@ajhelsby ajhelsby marked this pull request as draft November 2, 2022 10:02
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
…the client

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
# Conflicts:
#	open_feature/open_feature_client.py
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
@ajhelsby ajhelsby marked this pull request as ready for review November 2, 2022 12:46
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
… order

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
…ly typed counterparts

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
Signed-off-by: Matthew Elwell <matthew.elwell@flagsmith.com>
Signed-off-by: Matthew Elwell <matthew.elwell@flagsmith.com>
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

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

Nice job! I have virtually no python experience, but I've left some comments for your consideration.

🙏

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
@matthewelwell
Copy link
Member

@toddbaert thanks for the feedback! @ajhelsby has made the changes you mentioned (that I missed 😬), I'm good to merge this now if you are happy with it?

@toddbaert toddbaert self-requested a review November 9, 2022 14:49
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

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

lgtm! Thank you!

@matthewelwell matthewelwell merged commit 311b8ee into main Nov 9, 2022
@matthewelwell matthewelwell deleted the feature/spec-0.2.0 branch November 9, 2022 15:05
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.

Update SDK to be compliant with spec v0.2.0
5 participants