Skip to content

feat(experimentation): add the bring-your-own PostgreSQL warehouse form - #8872

Merged
Zaimwa9 merged 10 commits into
mainfrom
feat/postgres-warehouse-byo-ui
Nov 4, 2026
Merged

Zaimwa9 merged 10 commits into
mainfrom
feat/postgres-warehouse-byo-ui

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Follows #8863 and #8843. Adds the bring-your-own PostgreSQL warehouse to the Warehouse tab.

  • New PostgreSQL card with the setup SQL and a connection form (host, port, database, schema, username, password, TLS), plus edit and Test connection.
  • The connected card shows the setup SQL for the configured schema and the "Send your first event" nudge until events arrive.
  • The TLS switch is shared with ClickHouse (WarehouseTlsSwitch).

How did you test this code?

Unit tests for the form config, the setup SQL and the form utils. Typecheck matches main.

@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Nov 4, 2026 2:04pm UTC
flagsmith-frontend-staging Ready Ready Preview Nov 4, 2026 2:04pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 4, 2026 2:04pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The warehouse settings now support PostgreSQL connections and a Flagsmith database option. The change adds PostgreSQL form validation, payload construction, connection testing, setup SQL and editing flows. It also updates warehouse type availability and Flagsmith database event routing. Shared warehouse forms now display API error details, and ClickHouse uses a shared TLS switch component.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: Low · up to 019fe

PostgreSQL setup retains two bounded pitfalls: reserved schema names produce invalid SQL, and users following the CREATEROLE instruction may lack permission to create the schema. Ordinary schema names and a sufficiently privileged setup role provide workarounds.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5988843c-51ef-4721-a1f0-78aa88c95b44
Commits

Reviewing files that changed from the base of the PR and between 0da02e2 and 019fea9.

Files selected for processing: 1
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseConnectionCard.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@Zaimwa9

Zaimwa9 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@themis-blindfold review

@themis-blindfold

Copy link
Copy Markdown
Contributor

⚖️ Themis review: 🟠 Fix before merge

The PostgreSQL form covers the standard connection flow, but it cannot edit an existing self-hosted Flagsmith database connection and its setup instructions do not provision a custom schema. Unit Tests and lint passed; CI was still running.

Area Score
🎯 Correctness 2/5
🧪 Test coverage 3/5
📐 Code quality 3/5
🚀 Product impact 4/5

🟠 Majors

  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/index.tsx — Existing Flagsmith database connections cannot be edited.
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/postgresSetupSql.ts — Custom schemas are not provisioned by the onboarding instructions.
📝 Walkthrough
  • Warehouse setup — adds PostgreSQL selection, connection details and setup SQL.
  • Connection management — adds PostgreSQL editing, testing and status display.
  • Shared forms — extracts the TLS switch and displays API error details.
🧪 How to verify
  1. Open a self-hosted PostgreSQL connection configured with the Flagsmith database source and edit its name.
  2. Follow onboarding with a non-default schema and verify that the dedicated user can read and insert events.
  3. Create and edit a default-schema PostgreSQL connection, including a failed connection test.
  4. Automate: add form integration tests for both PostgreSQL configuration modes and custom-schema onboarding.

Product take: Connecting an existing PostgreSQL warehouse makes experimentation accessible without a separate analytics warehouse, a meaningful capability for self-hosted and SaaS users.

🧭 Assumptions & unverified claims

No unverified assumptions or claims.

May the events find their way to the right schema · reviewed at bb6fdca

@Zaimwa9
Zaimwa9 changed the base branch from main to feat/postgres-warehouse-flagsmith-database-ui November 4, 2026 08:55
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Nov 4, 2026
gagantrivedi
gagantrivedi previously approved these changes Nov 4, 2026
Base automatically changed from feat/postgres-warehouse-flagsmith-database-ui to main November 4, 2026 13:55
@Zaimwa9
Zaimwa9 dismissed gagantrivedi’s stale review November 4, 2026 13:55

The base branch was changed.

@Zaimwa9
Zaimwa9 marked this pull request as ready for review November 4, 2026 13:55
@Zaimwa9
Zaimwa9 requested a review from a team as a code owner November 4, 2026 13:55
@Zaimwa9
Zaimwa9 removed the request for review from a team November 4, 2026 13:55
@Zaimwa9
Zaimwa9 requested a review from talissoncosta November 4, 2026 13:55
@github-actions github-actions Bot removed the feature New feature or request label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-8872 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-8872 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8872 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8872 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith:pr-8872 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-frontend:pr-8872 Finished ✅ Results ✅

@github-actions github-actions Bot added the feature New feature or request label Nov 4, 2026
khvn26
khvn26 previously approved these changes Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-16 — run #22849 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  59.1 seconds
commit  019fea9
info  🔄 Run: #22849 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22849 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  38 seconds
commit  019fea9
info  🔄 Run: #22849 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #22849 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.6 seconds
commit  019fea9
info  🔄 Run: #22849 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #22849 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  31.9 seconds
commit  019fea9
info  🔄 Run: #22849 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22847 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  1 minute, 3 seconds
commit  0da02e2
info  🔄 Run: #22847 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #22847 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  4 passed

Details

stats  4 tests across 4 suites
duration  33.9 seconds
commit  0da02e2
info  🔄 Run: #22847 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #22847 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.3 seconds
commit  0da02e2
info  🔄 Run: #22847 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #22847 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  31.9 seconds
commit  0da02e2
info  🔄 Run: #22847 (attempt 1)

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Visual Regression

24 screenshots compared. See report for details.
View full report

…se-byo-ui

# Conflicts:
#	frontend/common/types/responses.ts
#	frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseConnectionCard.tsx
#	frontend/web/components/pages/environment-settings/tabs/warehouse-tab/__tests__/warehouseTypes.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5fcb7afc-3be8-4d1b-aa32-27a015e88074
Commits

Reviewing files that changed from the base of the PR and between 51bcfc2 and 0da02e2.

Files selected for processing: 26
  • frontend/common/types/responses.ts
  • frontend/web/components/experiments/EventNameSelect/EventNameSelect.tsx
  • frontend/web/components/pages/MetricsPage.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/ClickHouseConfigForm.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/DatabricksConfigForm.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/PostgresConfigForm.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseConnectionCard.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseEventCodeHelp.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseFormActions.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseSetup.scss
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseSetup.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseTlsSwitch.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/__tests__/postgresConfig.test.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/__tests__/postgresSetupSql.test.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/__tests__/warehouseEventSnippets.test.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/__tests__/warehouseFormUtils.test.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/__tests__/warehouseTypes.test.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/index.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/postgresConfig.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/postgresSetupSql.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/sendWarehouseTestEvent.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/useWarehouseConnectionTest.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/useWarehouseFormSubmit.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/warehouseEventSnippets.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/warehouseFormUtils.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/warehouseTypes.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@Zaimwa9
Zaimwa9 merged commit af5c88f into main Nov 4, 2026
31 checks passed
@Zaimwa9
Zaimwa9 deleted the feat/postgres-warehouse-byo-ui branch November 4, 2026 14:14

This branch was successfully deployed

3 active (1 outdated) deployments
Preview – flagsmith-frontend-preview — 019fea9a Deployed Nov 4, 2026 by vercel[bot]
Preview – flagsmith-frontend-staging — 019fea9a Deployed Nov 4, 2026 by vercel[bot]
Preview – docs — bb6fdca5 Deployed Nov 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants