-
Notifications
You must be signed in to change notification settings - Fork 87
Updated salt support and convenience methods for flag providers #147
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
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #147 +/- ##
==========================================
+ Coverage 93.69% 93.81% +0.11%
==========================================
Files 9 9
Lines 1222 1375 +153
Branches 81 91 +10
==========================================
+ Hits 1145 1290 +145
- Misses 48 52 +4
- Partials 29 33 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
LGTM
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.
Pull Request Overview
This PR adds new feature flag functionality and updates the library version to 5.0.0. The key changes introduce methods to retrieve all flag variants at once and manually track exposure events, along with improved hash salting for feature flag evaluation.
- Adds
get_all_variants()andaget_all_variants()methods to retrieve all feature flags for a user without automatic exposure tracking - Adds
track_exposure_event()andatrack_exposure_event()methods to manually track exposure events - Introduces
hash_saltfield toExperimentationFlagfor improved hash consistency - Refactors parameter order and logging levels for better usability
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mixpanel/flags/types.py | Adds optional hash_salt field to ExperimentationFlag model |
| mixpanel/flags/remote_feature_flags.py | Implements new bulk variant retrieval and manual exposure tracking methods with refactored response handling |
| mixpanel/flags/local_feature_flags.py | Implements new bulk variant retrieval, manual tracking, and updates hash calculation to use hash_salt |
| mixpanel/flags/test_remote_feature_flags.py | Adds comprehensive test coverage for new remote flag methods |
| mixpanel/flags/test_local_feature_flags.py | Adds test coverage for new local flag methods and updates test helper |
| mixpanel/init.py | Updates version from 5.0.0b2 to 5.0.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
LGTM but the Copilot review comments should be addressed
GitHub Copilot Summary
This pull request introduces new methods for retrieving all feature flag variants for a user context, improves exposure event tracking flexibility, and refines hashing logic for flag assignment. It also enhances remote flag evaluation with asynchronous support and improves logging granularity. These changes collectively make feature flag evaluation and tracking more robust, flexible, and testable.
Feature flag variant retrieval and exposure event tracking
get_all_variantsmethods to bothLocalFeatureFlagsProviderandRemoteFeatureFlagsProviderfor retrieving all feature flag variants for a given user context, with manual exposure event tracking options (track_exposure_eventandatrack_exposure_event) for both sync and async usage. [1] [2] [3] [4] [5]Hashing logic improvements for flag assignment
hash_saltfor better control and testability, and updated test helpers to support this. [1] [2] [3] [4]Remote feature flags API improvements
aget_variant), updating query parameter handling, and separating response parsing from flag lookup for better error handling and testability. [1] [2] [3] [4]Logging and diagnostics
infotodebuglevel for less noisy logs in production. [1] [2]Version bump
5.0.0b2to5.0.0inmixpanel/__init__.py.