-
Notifications
You must be signed in to change notification settings - Fork 53
feat(flags): decouple local evaluation from personal API keys; support decrypting remote config payloads without relying on the feature flags poller #282
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR decouples feature flag local evaluation from personal API keys and adds remote config payload decryption without requiring the feature flags poller.
- Added
enable_local_evaluationparameter (defaults to True) inposthog/client.pyto optionally disable local feature flag evaluation - Version bump to 6.1.0 in
posthog/version.pyreflecting new feature addition - Modified poller initialization in
posthog/client.pyto only start when local evaluation is enabled - Added new test coverage in
posthog/test/test_client.pyfor remote config payload handling without local evaluation - Maintains backward compatibility while offering more efficient SDK usage when only remote config payloads are needed
5 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile
CHANGELOG.md
Outdated
| @@ -1,3 +1,7 @@ | |||
| # 6.1.0 - 2025-01-07 | |||
|
|
|||
| 1. feat: decouple feature flag local evaluation from personal API keys; support decrypting remote config payloads without relying on the feature flags poller | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Numbering list items (1.) is inconsistent with other feature entries in changelog that use dashes (-)
| # Whether to enable feature flag polling for local evaluation by default. Defaults to True. | ||
| # We recommend setting this to False if you are only using the personalApiKey for evaluating remote config payloads via `get_remote_config_payload` and not using local evaluation. | ||
| enable_local_evaluation = True # type: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: default bool settings should follow the pattern DEFAULT_ENABLE_LOCAL_EVALUATION = True to match Python conventions. Current mutable module-level variable can be modified accidentally
| # Whether to enable feature flag polling for local evaluation by default. Defaults to True. | |
| # We recommend setting this to False if you are only using the personalApiKey for evaluating remote config payloads via `get_remote_config_payload` and not using local evaluation. | |
| enable_local_evaluation = True # type: bool | |
| # Whether to enable feature flag polling for local evaluation by default. Defaults to True. | |
| # We recommend setting this to False if you are only using the personalApiKey for evaluating remote config payloads via `get_remote_config_payload` and not using local evaluation. | |
| DEFAULT_ENABLE_LOCAL_EVALUATION = True # type: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope wrong; this is a config entry you IDIOT
Parity with the Node SDK changes I made here