-
Notifications
You must be signed in to change notification settings - Fork 538
feat(Segment Membership): Seed identities on Beta opt-in #7899
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
Merged
+587
−124
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
25d229c
test(Segment Membership): Add red tests for opt-in seed and reconciler
khvn26 2d42d27
test(Segment Membership): Apply review feedback to opt-in seed tests
khvn26 a24e80d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 71a4c86
test(Segment Membership): Assert admin re-seed enqueues the seed task
khvn26 d4ebaf1
test(Segment Membership): Drop section-divider comments from seed tests
khvn26 5249a76
test(Segment Membership): Restore bare Given/When/Then markers
khvn26 8347f86
test(Segment Membership): Rename fixture loop var to trait_value
khvn26 af267d4
test(Segment Membership): Assert the full seed.environment.failed event
khvn26 a20708e
feat(Segment Membership): Seed identities per organisation on Beta op…
khvn26 7816c36
docs(Segment Membership): Regenerate events catalogue for seed events
khvn26 33cb498
test(Segment Membership): Split mapper test GWT markers onto separate…
khvn26 6c9bb4c
fix(Segment Membership): Defer task import in admin so startup doesn'…
khvn26 07fa649
chore(Segment Membership): Surface segment_membership logs via APPLIC…
khvn26 dd242ad
fix(Segment Membership): Warn when a seed skips on missing ClickHouse…
khvn26 ef149a3
refactor(Segment Membership): Select an org's live-segment projects w…
khvn26 94cc2dd
chore(Segment Membership): Mark the seed reconciler for retirement at…
khvn26 b2e6d4b
docs(Segment Membership): Trim the refresh_all_segment_counts docstring
khvn26 18ade33
build(deps): Bump flagsmith-sql-flag-engine to 0.1.2
khvn26 8540a29
Merge remote-tracking branch 'origin/main' into feat/segment-membersh…
khvn26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| from django.contrib import admin | ||
| from django.db.models import QuerySet | ||
| from django.http import HttpRequest | ||
|
|
||
| from segment_membership.models import SegmentMembershipSeed | ||
|
|
||
|
|
||
| @admin.register(SegmentMembershipSeed) | ||
| class SegmentMembershipSeedAdmin(admin.ModelAdmin[SegmentMembershipSeed]): | ||
| actions = ["force_reseed"] | ||
| list_display = ("organisation", "seeded_at") | ||
| readonly_fields = ("seeded_at",) | ||
| autocomplete_fields = ("organisation",) | ||
|
|
||
| @admin.action(description="Force re-seed (clears the marker)") | ||
| def force_reseed( | ||
| self, | ||
| request: HttpRequest, | ||
| queryset: QuerySet[SegmentMembershipSeed], | ||
| ) -> None: | ||
| from segment_membership.tasks import seed_organisation_identities | ||
|
|
||
| queryset.update(seeded_at=None) | ||
| for seed in queryset: | ||
| seed_organisation_identities.delay(args=(seed.organisation_id,)) |
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
38 changes: 38 additions & 0 deletions
38
api/segment_membership/migrations/0002_segment_membership_seed.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Generated by Django 5.2.15 on 2026-06-27 18:51 | ||
|
|
||
| import django.db.models.deletion | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("organisations", "0058_update_audit_and_history_limits_in_sub_cache"), | ||
| ("segment_membership", "0001_initial"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name="SegmentMembershipSeed", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| models.AutoField( | ||
| auto_created=True, | ||
| primary_key=True, | ||
| serialize=False, | ||
| verbose_name="ID", | ||
| ), | ||
| ), | ||
| ("seeded_at", models.DateTimeField(null=True)), | ||
| ( | ||
| "organisation", | ||
| models.OneToOneField( | ||
| on_delete=django.db.models.deletion.CASCADE, | ||
| related_name="+", | ||
| to="organisations.organisation", | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ] |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.