Skip to content

Conversation

@dmarticus
Copy link
Contributor

@dmarticus dmarticus commented Jul 10, 2025

Parity with the Node SDK changes I made here

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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_evaluation parameter (defaults to True) in posthog/client.py to optionally disable local feature flag evaluation
  • Version bump to 6.1.0 in posthog/version.py reflecting new feature addition
  • Modified poller initialization in posthog/client.py to only start when local evaluation is enabled
  • Added new test coverage in posthog/test/test_client.py for 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
Copy link
Contributor

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 (-)

Comment on lines +63 to +65
# 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
Copy link
Contributor

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

Suggested change
# 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

Copy link
Contributor Author

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

@dmarticus dmarticus requested a review from a team July 10, 2025 04:35
@dmarticus dmarticus moved this to In Review in Feature Flags Jul 10, 2025
@github-project-automation github-project-automation bot moved this from In Review to Approved in Feature Flags Jul 10, 2025
@dmarticus dmarticus merged commit c4e09cd into master Jul 10, 2025
7 checks passed
@dmarticus dmarticus deleted the feat/decouple-remote-config-decryption-from-local-evaluation branch July 10, 2025 15:03
@github-project-automation github-project-automation bot moved this from Approved to Done in Feature Flags Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants