feat(Segment Membership): Seed organisations too large for the task processor - #8517
matthewelwell wants to merge 1 commit into
Conversation
…rocessor A seed that outlives its 4h task timeout is marked failed while its thread keeps running, retried alongside that thread, and re-enqueued hourly once the retries are exhausted. A management command calls the task inline instead, so it can run as a standalone ECS task that no deployment interrupts and nothing retries. `--ignore-feature-flag` populates ClickHouse before an organisation is given the feature, so the first membership counts it sees are complete. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughWalkthroughThe pull request adds a Django management command for synchronous organisation identity seeding. The command accepts an organisation ID and an optional feature-flag override. The seeding task now supports this override while retaining the default feature-flag check. Unit tests cover command execution and override behaviour. The events catalogue updates source line references for segment-membership events. Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to Operators consulting the event catalogue may look for this skipped-seed event at the wrong log level. Correct the documentation before merge. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Docker builds report
|
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #20423 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-16 — run #20423 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #20423 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #20423 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: ad4098e1-173e-46e4-b963-3a4bc54c4b0e
📒 Files selected for processing (7)
api/segment_membership/management/__init__.pyapi/segment_membership/management/commands/__init__.pyapi/segment_membership/management/commands/seed_segment_membership.pyapi/segment_membership/tasks.pyapi/tests/unit/segment_membership/test_unit_segment_membership_commands.pyapi/tests/unit/segment_membership/test_unit_segment_membership_tasks.pydocs/docs/deployment-self-hosting/observability/_events-catalogue.md
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Visual Regression19 screenshots compared. See report for details. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8517 +/- ##
=======================================
Coverage 98.82% 98.82%
=======================================
Files 1622 1624 +2
Lines 66727 66768 +41
=======================================
+ Hits 65942 65983 +41
Misses 785 785 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
A seed that outlives its 4h task timeout is marked failed while its thread keeps running, retried alongside that thread, and re-enqueued hourly once the retries are exhausted. Adds a
seed_segment_membershipmanagement command that calls the task inline instead, so an organisation too large to finish inside the timeout can be seeded as a standalone ECS task that no deployment interrupts and nothing retries.--ignore-feature-flagseeds an organisation that doesn't havesegment_membership_inspectionyet, so ClickHouse can be populated before the feature is exposed and the first counts shown are complete.How did you test this code?
Unit tests cover the command running the seed inline rather than queuing it, and the task seeding with the flag off when told to. The existing seed tests still pass unchanged.