Commit Graph

10 Commits

Author SHA1 Message Date
Federico Bond 633deff002
refactor: make Reason enum values instances of str (#142)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2023-07-12 14:52:07 -04:00
Federico Bond 7fe511ffe0
feat: implement api-level hooks (#139)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2023-07-10 12:56:48 -04:00
Federico Bond 571f5eb3bf
feat: implement client get_metadata for requirement 1.2.2 (#141)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2023-07-10 11:32:59 -04:00
Federico Bond 291581fbce
fix: object client methods can receive dict or list as default_value (#134)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2023-07-06 11:38:22 -04:00
James Carr c2d225e34c
feat!: EvaluationDetails.reason should be a string, Reason enum should export default reasons per spec (#126)
Signed-off-by: James Carr <james.r.carr@gmail.com>
2023-06-28 14:21:34 -04: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
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
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