Skip to content

Conversation

@efahk
Copy link
Contributor

@efahk efahk commented Nov 3, 2025

  • Bumps SDK out of beta to version 5.0.0
  • Updating hash scheme with support for custom salts and salts per rollout group
  • Adds a routine to get_all_variants that doesn't track exposure events per customer requests

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

  • Added get_all_variants methods to both LocalFeatureFlagsProvider and RemoteFeatureFlagsProvider for retrieving all feature flag variants for a given user context, with manual exposure event tracking options (track_exposure_event and atrack_exposure_event) for both sync and async usage. [1] [2] [3] [4] [5]
  • Updated exposure event tracking logic to allow manual reporting and made latency reporting optional. [1] [2] [3]

Hashing logic improvements for flag assignment

  • Refined variant and rollout assignment hashing logic to include an optional hash_salt for better control and testability, and updated test helpers to support this. [1] [2] [3] [4]

Remote feature flags API improvements

  • Improved remote flag evaluation by supporting async variant retrieval (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

  • Changed request timing logs from info to debug level for less noisy logs in production. [1] [2]

Version bump

  • Bumped package version from 5.0.0b2 to 5.0.0 in mixpanel/__init__.py.

@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 93.84615% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.81%. Comparing base (c801c77) to head (0f94ab7).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
mixpanel/flags/local_feature_flags.py 84.21% 5 Missing and 1 partial ⚠️
mixpanel/flags/remote_feature_flags.py 93.75% 2 Missing and 2 partials ⚠️
mixpanel/flags/test_remote_feature_flags.py 96.49% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@msiebert msiebert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jaredmixpanel jaredmixpanel requested a review from Copilot November 4, 2025 17:49
Copy link

Copilot AI left a 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() and aget_all_variants() methods to retrieve all feature flags for a user without automatic exposure tracking
  • Adds track_exposure_event() and atrack_exposure_event() methods to manually track exposure events
  • Introduces hash_salt field to ExperimentationFlag for 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.

Copy link
Contributor

@jaredmixpanel jaredmixpanel left a 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

@efahk efahk merged commit 7a86004 into master Nov 4, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants