feat(api): auto-connect Flagsmith warehouse for new orgs via experimental_flags value - #8377
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe service parses experiment flag configuration and creates an active Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to The change is otherwise mergeable, but one unit test needs a database-access marker because its fixture creates database records; add that marker before merging so the test can run successfully. 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9c21f051-8fb8-4336-b794-dfb408193bd7
📒 Files selected for processing (3)
api/experimentation/services.pyapi/experimentation/views.pyfrontend/common/utils/utils.tsx
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19844 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-16 — run #19844 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #19844 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #19844 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Skipped testsfirefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss ✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19842 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #19842 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-16 — run #19842 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #19842 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19815 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #19815 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #19815 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #19815 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
619277d to
1d68bc3
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bf8bf849-c337-4470-90fd-ad91cf47dac9
📒 Files selected for processing (3)
api/experimentation/services.pyapi/tests/unit/experimentation/test_services.pyapi/tests/unit/experimentation/test_views.py
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 394e1e96-bb20-4f01-9f45-8a4965490b61
📒 Files selected for processing (1)
api/tests/unit/experimentation/test_services.py
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
docs/if required so people know about the feature.Changes
Adds auto-provisioning of Flagsmith hosted warehouse connections, controlled by the
experimental_flagsflag value.get_experiment_flag_config()reads and parses theexperimental_flagsJSON value (only when the flag is enabled for the org).ensure_flagsmith_warehouse_connection()auto-creates a Flagsmith warehouse connection on first access ifauto_connect_warehouseistrueand no connection exists. Race-safe via the existing unique constraint.Companion frontend PR: #8378
Flag configuration
Set the
experimental_flagssegment override value to:{"auto_connect_warehouse": true}Revert by setting
auto_connect_warehousetofalseor removing the value — no code deploy needed.How did you test this code?
ensure_flagsmith_warehouse_connectionis a no-op whenauto_connect_warehouseis absent/false or a connection already exists.IntegrityErrorcatch on the existingunique_active_warehouse_per_envconstraint.