Commit Graph

15 Commits

Author SHA1 Message Date
Tom Carrio 3a33551fdb
fix: reverse the merged before hooks (#71) 2023-01-03 21:51:08 -05:00
Thomas Poignant 85db1e0a74
fix: Get Object should return both list and dict (#64)
* Get Object should return both list and dict

Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
2022-12-19 13:14:41 -05:00
Tom Carrio 6f6186ed91
feat: process flag evaluation options in client (#31)
Signed-off-by: Tom Carrio <tom@carrio.dev>
Co-authored-by: Meg McRoberts <mmcroberts@cloudbees.com>
Co-authored-by: Matthew Elwell <mjelwell89@gmail.com>
2022-12-02 08:07:39 -05:00
Manuel Schönlaub 50f5a484a0
fix: Fix type checking (#25)
* Fix type checking within client

Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>

* Make linter happy

Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>

* Migrate Hook Hints to Mapping

Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>

* Fix type annotations in FlagEvaluationDetails

Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>

* Fix last hint typing

Signed-off-by: Manuel Schönlaub <manuel.schonlaub@prodigygame.com>

* Rework typing

Signed-off-by: Manuel Schönlaub <manuel.schonlaub@prodigygame.com>

Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>
Signed-off-by: Manuel Schönlaub <manuel.schonlaub@prodigygame.com>
2022-11-21 17:39:37 -05:00
Andrew Helsby 04a4323310
feat: specification-0.5.0 (#44)
* feature/spec-0.3.0: Update docs on merging contexts to reflect spec

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

* feature/spec-0.5.0: Ensure error message is optional and error code required when an error has been found
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.5.0: Remove returns in exception docstrings
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-11-11 11:06:22 +00:00
Andrew Helsby 311b8eef53
feat: spec-0.2.0 (#38)
* fix/unit-tests: Add float and int flag methods
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Add the ability for a provider to have hooks
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Flag evaluation options added for hook merging
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Move numeric type methods to a private method within the client
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.2.0: Add tests for new numeric methods
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.2.0: Overwrite init on FlagEvaluationOptions
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.2.0: Overwrite init on FlagEvaluationOptions
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.2.0: Remove init on FlagEvaluationOptions
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.2.0: Ensure before_hooks are evaluated in the opposite order
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.2.0: Remove number flag evaluation in favour of strongly typed counterparts
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.2.0: Check flag type after provider response
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.2.0: Remove unnecessary static method
Signed-off-by: Matthew Elwell <matthew.elwell@flagsmith.com>

* feature/spec-0.2.0: Update docstring parameter name
Signed-off-by: Matthew Elwell <matthew.elwell@flagsmith.com>

* feature/spec-0.2.0: Fix typing of int and float methods
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.2.0: Change provider methods to resolves rather than gets
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
Co-authored-by: Matthew Elwell <matthew.elwell@flagsmith.com>
2022-11-09 15:05:35 +00:00
Robert Grassian 06d0494331
fix: eval context fixes and new error types (#43)
* eval context fixes and new error types

Signed-off-by: Robert Grassian <robert.grassian@split.io>

* cleanup

Signed-off-by: Robert Grassian <robert.grassian@split.io>

* remove eval context setter

Signed-off-by: Robert Grassian <robert.grassian@split.io>

Signed-off-by: Robert Grassian <robert.grassian@split.io>
2022-11-08 16:35:56 +00:00
Andrew Helsby df0c033083
fix: Unit tests (#28)
* fix/unit-tests: Improve unit test coverage to ensure spec is followed
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Add test coverage around hooks
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Parametrize test_should_use_no_op_provider_if_none_provided
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Parametrize all flag type methods in open feature client
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Parametrize all flag type methods in open feature client
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Add fixture to clear global provider after each tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Mock hooks in tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Update docstring on clear_provider method
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: remove setup method in client tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/unit-tests: Remove invalid flag type check in private method _create_provider_evaluation and move to public method
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-11-02 16:24:16 +04:00
Andrew Helsby b44224be0d
fix: Move flag evaluation details to a dataclass (#27)
* fix/flag-error-message: Move flag evaluation details to a dataclass and add error message to the class
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/flag-error-message: Rename flag_key in FlagEvaluationDetails to match spec
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/flag-error-message: Rename flag_key in provider.py to match spec
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/flag-error-message: Rename flag_key in open_feature_client.py
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/flag-error-message: Rename flag_key in open_feature_client.py
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* fix/flag-error-message: handle error_message doesn't exist exception
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-10-18 15:23:24 +04:00
Manuel Schönlaub 059ef20d8d Remove superflous docstring
Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>
2022-10-07 10:08:26 -06:00
Manuel Schönlaub 25119766f9 Reintroduce flag_evaluation_options in client
Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>
2022-10-07 09:53:04 -06:00
Manuel Schönlaub 0ace3cd001 Remove EvaluationOptions from method signatures
Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>
2022-09-30 14:48:11 -06:00
Andrew Helsby bc58cd8932
hooks: Implementation of hooks for python OpenFeature (#6)
* hooks: Implementation of hooks for python Open Feature

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

* hooks: Fix tests broken as a result of providing hook support

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

* hooks: Add api level evaluation context support

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

* hooks: Change typing on iterables to be compatible with python 3.8

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

* hooks: Add docstring for evaluate_flag_details method

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

* hooks: Add docstring for evaluate_flag_details method

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

* hooks: docstring change requested in review

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

* hooks: add docstrings and comments to

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

* hooks: Use correct exception in error hooks in the client

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

* hooks: Set empty evaluation context in no op provider to None

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

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-09-02 12:23:15 +04:00
Andrew Helsby 6b05df774e
evaluation-context: Add evaluation context to open feature (#5)
* evaluation-context: Add evaluation context to open feature

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

* evaluation-context: Fix evaluation context tests

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

* evaluation-context: Reduce code on context merge

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

* evaluation-context: Add docstring for create_provider_evaluation

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

* evaluation-context: Add tests for merging evaluation context

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

* evaluation-context: Fix evaluation context for python 3.8

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-08-03 12:02:43 +01:00
Andrew Helsby d2b484343d
Restructure modules (#3)
restructure-modules: Rename src module to open_feature

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-06-30 21:35:41 +04:00