Draft
Conversation
Adds the `segment_membership` Django app — a Roaring-bitmap-backed index that lets us count, list, sample, and stream the identities matching a segment. Atoms are unary predicates over (property, operator, operand); each unique atom gets one bitmap of `Identity.id` values, and segment membership composes via Boolean ops on those bitmaps. Async maintenance runs via flagsmith-task-processor. Includes smoke tests covering the operator vocabulary end-to-end with a differential check against `is_context_in_segment`. Maintenance fires only when `settings.SEGMENT_MEMBERSHIP_ENABLED = True`, so this is dark-no-op in self-hosted and SaaS until enabled. beep boop
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs/if required so people know about the feature.Changes
Contributes to #5663.
PoC for segment membership inspection. Adds the
segment_membershipDjango app: a Roaring-bitmap-backed index that lets us count, list, sample, and stream the identities matching a segment.Atoms are unary predicates over
(property, operator, operand); each unique atom owns one bitmap ofIdentity.idvalues, and segment membership composes via Boolean ops on those bitmaps. Async maintenance runs throughflagsmith-task-processor.Maintenance fires only when
settings.SEGMENT_MEMBERSHIP_ENABLED = True, so this is a dark no-op in self-hosted and SaaS until the flag is flipped. User-facing docs and the API surface will follow in separate PRs.How did you test this code?
pytest tests/unit/segment_membership— smoke tests cover the operator vocabulary end-to-end with a differential check againstis_context_in_segment.mypy segment_membership tests/unit/segment_membershipclean in strict mode.manage.py stress_test_segment_membership.