Commit Graph

61 Commits

Author SHA1 Message Date
OpenFeature Bot 1802022994
chore(main): release 0.8.2 (#485)
Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
2025-07-30 17:29:08 -04:00
Konstantinos Koukopoulos a5b3aa9c52
fix: merge transaction context into hook context evaluation context (#521) (#523)
Signed-off-by: Konstantinos Koukopoulos <koukopoulos@gmail.com>
2025-07-23 14:27:15 +02:00
renovate[bot] d21d9db90a
chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.12.0 (#510)
* chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.12.0

* skip PLC0415

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gruebel <anton.gruebel@gmail.com>
2025-06-19 17:32:18 +00:00
Anton Grübel f95b27a25a
refactor: refine typing.Any type hints (#504)
* refine typing.Any type hints

Signed-off-by: gruebel <anton.gruebel@gmail.com>

* exclude TYPE_CHECKING from coverage

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2025-06-03 19:52:16 +02:00
renovate[bot] 87e448593d
chore(deps): update pre-commit hook pre-commit/mirrors-mypy to v1.16.0 (#503)
* chore(deps): update pre-commit hook pre-commit/mirrors-mypy to v1.16.0

* fix typing

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gruebel <anton.gruebel@gmail.com>
2025-05-30 16:35:39 +02:00
OpenFeature Bot 4006df768c
chore(main): release 0.8.1 (#445)
Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
2025-04-10 08:47:46 +02:00
Anton Grübel 3636a0d75f
fix: fix cycle dependency between api and client (#480)
* fix cycle dependency between api and client

Signed-off-by: gruebel <anton.gruebel@gmail.com>

* remove comment

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-04-09 08:39:26 +02:00
Anton Grübel e61b69bb50
refactor: replace exception raising with error flag resolution (#474)
* replace exception raising with error flag resolution

Signed-off-by: gruebel <anton.gruebel@gmail.com>

* revert spec to commit 0cd553d

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2025-04-08 19:54:41 +02:00
Anton Grübel 2d1ba85c93
feat: add OTel utility function (#451)
add OTel utility function

Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-02-22 16:50:27 +01:00
Anton Grübel 088409ea5c
fix: add passthrough init to abstract provider (#450)
Signed-off-by: gruebel <anton.gruebel@gmail.com>
2025-02-18 08:45:12 -05:00
Anton Grübel 31afa6490f
chore: improve resolve details callable type hints (#449)
improve resolve details callable type hints

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2025-02-13 21:52:41 +01:00
Leo f29c4506a6
chore: use keyword arguments, validate test (#446)
Signed-off-by: leohoare <leo@insight.co>
2025-02-13 12:06:54 -05:00
OpenFeature Bot 2951eb2982
chore(main): release 0.8.0 (#431)
Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
2025-02-11 22:20:08 +01:00
Anton Grübel bcd1a3807e
chore!: drop Python 3.8 support (#441)
* drop Python 3.8 support

Signed-off-by: gruebel <anton.gruebel@gmail.com>

* pin mypy python version to 3.9

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-02-11 22:17:37 +01:00
Leo 86e7c07112
feat: Add async functionality to providers (#413)
Signed-off-by: leohoare <leo@insight.co>
2025-02-06 12:30:54 -05:00
OpenFeature Bot c2d1402641
chore(main): release 0.7.5 (#399)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2025-01-31 11:35:08 -05:00
chrfwow 9e9bb5c626
feat: Add evaluation details to finally hook stage #403 (#423)
Signed-off-by: christian.lutnik <christian.lutnik@dynatrace.com>
Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>
2025-01-30 13:51:19 -05:00
chrfwow 8f2cabaa32
fix: Finally hooks do not get called when the provider is not ready #424 (#425)
Signed-off-by: christian.lutnik <christian.lutnik@dynatrace.com>
2025-01-29 10:57:44 -05:00
OpenFeature Bot e6ada0f413
chore(main): release 0.7.4 (#397) 2024-11-25 10:29:26 +01:00
renovate[bot] cd737a9a6a
chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.8.0 (#395)
* chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.8.0

* fix ruff issues

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gruebel <anton.gruebel@gmail.com>
2024-11-25 09:26:52 +00:00
OpenFeature Bot 398dcb04a0
chore(main): release 0.7.3 (#382) 2024-11-25 09:39:03 +01:00
Lukas Reining 9b97130908
feat: implement transaction context (#389)
* feat: implement transaction context

Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>

* fix: lint issues

Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>

* feat: add tests for context merging

Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>

* feat: fix pre-commit checks

Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>

* feat: use elipsis instead of pass

Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>

* Update openfeature/transaction_context/no_op_transaction_context_propagator.py

Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>
Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>

* feat: pr feedback

Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>

---------

Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>
2024-11-24 17:54:42 +01:00
OpenFeature Bot 05dc3be00f
chore(main): release 0.7.2 (#358) 2024-10-25 09:50:22 -04:00
github-actions[bot] 26b7114f4b
chore(main): release 0.7.1 (#328)
Co-authored-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
2024-08-02 13:33:58 -04:00
renovate[bot] fe63b64d8f
chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.5.3 (#350)
* chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.5.3

* fix linting

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gruebel <anton.gruebel@gmail.com>
2024-07-20 14:42:21 +02:00
Michael Beemer 0ed625f186
fix: remove exception logging during evaluation (#347)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-07-02 11:37:39 -04:00
Anton Grübel 5abcf3b157
fix: make global hooks thread safe (#331)
Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-06-07 10:53:51 -04:00
Anton Grübel f2389da024
ci: update release please to new GHA (#340)
update release please to new GHA

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-06-07 00:22:49 +02:00
Federico Bond 3217575f4f
fix: event handler methods are not thread-safe (#329)
The _client_handlers dictionary allowed modifications during iteration
without proper concurrency control. I added some reentrant locks to manage
concurrent access to the _global_handlers and _client_handlers data
structures.

See #326

Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-05-03 00:42:43 +10:00
Federico Bond c3ad697a80
refactor: bind providers explicitly to a registry with attach/detach (#324)
* test: make sure provider is registered in events test

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: bind providers explicitly to a registry with attach/detach

Signed-off-by: Federico Bond <federicobond@gmail.com>

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-05-02 09:13:30 +10:00
Federico Bond 96ba7938de
refactor!: move AbstractProvider to openfeature.provider (#314)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-04-12 11:19:21 +10:00
Federico Bond 34ac91c707
fix!: restrict exported names with __all__ (#306)
* fix!: restrict exported names with __all__

Signed-off-by: Federico Bond <federicobond@gmail.com>

* restrict codecov upload to Python 3.11

Signed-off-by: gruebel <anton.gruebel@gmail.com>

* disable codecov ci fail on error

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-04-09 11:15:30 +09:00
Federico Bond 9966c14e16
feat: update provider status when provider emits events (#309)
* refactor: move registry singleton to the registry module

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: make openfeature.provider.registry a private module

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: update provider status when provider emits events

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: avoid duplicate code

Signed-off-by: Federico Bond <federicobond@gmail.com>

* fix: fix provider event dispatch on initialize/shutdown

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: rename default_registry to provider_registry

Signed-off-by: Federico Bond <federicobond@gmail.com>

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-04-07 22:59:02 +10:00
Federico Bond de36b214dc
fix: remove ProviderEvent.PROVIDER_FATAL (#307)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-03-28 16:54:00 +11:00
Federico Bond 78ea3b9914
feat: populate provider and client metadata in HookContext (#302)
* feat: populate provider and client metadata in HookContext

Signed-off-by: Federico Bond <federicobond@gmail.com>

* fix: ensure provider consistency during flag evaluation

Signed-off-by: Federico Bond <federicobond@gmail.com>

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-03-25 18:15:26 +11:00
Federico Bond 4a323b0f96
refactor: mark hook_support module as private/internal (#303)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-03-25 18:02:36 +11:00
Federico Bond 679409fad2
feat: implement provider events (#278)
* feat: implement provider events

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: add error_code field to EventDetails and ProviderEventDetails

Signed-off-by: Federico Bond <federicobond@gmail.com>

* fix: replace strings with postponed evaluation of annotations

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: run handlers immediately if provider already in associated state

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: remove unused _provider from openfeature.api

Signed-off-by: Federico Bond <federicobond@gmail.com>

* test: add some comments to test cases

Signed-off-by: Federico Bond <federicobond@gmail.com>

* test: add provider event late binding test cases

Signed-off-by: Federico Bond <federicobond@gmail.com>

* fix: fix status handlers running immediately if provider already in associated state

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: reuse provider property in OpenFeatureClient

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: move _provider_status_to_event to ProviderEvent.from_provider_status

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: move EventSupport class to an internal module

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: replace EventSupport class with module-level functions

Signed-off-by: Federico Bond <federicobond@gmail.com>

* style: fix code style

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-03-22 07:45:00 +11:00
Anton Grübel 6e4eebce20
chore: update mypy and ruff (#296)
update mypy and ruff

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-03-19 06:16:16 +11:00
Federico Bond e7475441bd
fix: run error hooks if provider returns FlagResolutionDetails with non-empty error_code (#291)
* fix: run error hooks if provider returns FlagResolutionDetails with non-empty error_code

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: extract error code to exception mapping to class variable

Signed-off-by: Federico Bond <federicobond@gmail.com>

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-03-14 08:31:46 +11:00
Federico Bond 789e6e0f5f
feat: implement provider status (#288)
* feat: implement provider status

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: set provider status to fatal if initialize raises PROVIDER_FATAL error

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: add a provider status accessor to clients

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: short circuit flag resolution when provider is not ready

Signed-off-by: Federico Bond <federicobond@gmail.com>

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-03-08 09:00:32 +11:00
Anton Grübel 5acd6a6598
refactor: improve Hook Hints typing (#285)
* improve Hook Hints typing

Signed-off-by: gruebel <anton.gruebel@gmail.com>

* ignore lint issue for this line

Signed-off-by: gruebel <anton.gruebel@gmail.com>

* exclude TYPE_CHECKING from coverage report

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-03-03 00:38:14 -03:00
Federico Bond ed6a42f264
feat!: add support for domains (#271)
* feat: add support for domains

Signed-off-by: Federico Bond <federicobond@gmail.com>

* docs: update README.md

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: add clear_providers function to api

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: make _get_provider function private

Signed-off-by: Federico Bond <federicobond@gmail.com>

* fix: shutdown all providers on api.shutdown

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: move provider dict to a ProviderRegistry class

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: reset default provider on clear_providers and add tests

Signed-off-by: Federico Bond <federicobond@gmail.com>

* docs: update README.md

Signed-off-by: Federico Bond <federicobond@gmail.com>

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-02-20 19:31:22 -03:00
Federico Bond 77fbae7b1e
refactor: remove abstractmethod decorator from get_provider_hooks (#274)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-02-09 18:50:28 -03:00
Federico Bond cb1677b0a8
feat: make return value not optional in provider API functions (#270)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-02-06 11:15:49 -03:00
Federico Bond caa7f36c30
feat: add FeatureProvider protocol (#268)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-02-03 11:26:18 -03:00
Anton Grübel 3b89760d41
feat: make specific fields in HookContext immutable (#266)
make specific fields in HookContext immutable

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-01-29 13:16:10 -03:00
Matthew M. Keeler 5ef6ca1263
fix: Allow string values for `FlagEvaluationDetails.reason` and `FlagResolutionDetails.reason` (#264)
* fix: Allow string values for `FlagEvaluationDetails.reason` and ``FlagResolutionDetails.reason`

Signed-off-by: Matthew Keeler <mkeeler@launchdarkly.com>

* Remove useless test

Signed-off-by: Matthew Keeler <mkeeler@launchdarkly.com>

---------

Signed-off-by: Matthew Keeler <mkeeler@launchdarkly.com>
2024-01-29 12:42:37 -03:00
Federico Bond ccbff2c5e4
feat: improve logging setup (#261)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-01-26 23:52:33 -03:00
Anton Grübel af9d3da336
chore: enable mypy strict mode (#257)
Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: Federico Bond <federicobond@gmail.com>
2024-01-08 20:09:53 -03:00
Anton Grübel b3c67b6ab3
ci: add mypy type checking and fix/exclude minor issues (#255)
* add mypy type checking and fix/exclude minor issues

Signed-off-by: gruebel <anton.gruebel@gmail.com>

* enable explicit_package_bases for mypy

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-01-07 12:56:32 -03:00