feat(data-warehouse): link sync warnings to source management page#60640
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR makes data-warehouse sync warnings in the SQL editor actionable by attaching a source identifier to each warning (when applicable) and rendering a “Manage source” link that navigates users directly to the relevant source management page.
Changes:
- Added optional
source_idto theDataWarehouseSyncWarningschema/type and regenerated query schema outputs. - Populated
source_idwhen building sync warnings on the backend. - Updated the SQL editor output warnings banner to show a “Manage source” link when
source_idis present.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| products/data_warehouse/backend/test/test_sync_status.py | Extends sync warning test assertions to include source_id. |
| products/data_warehouse/backend/sync_status.py | Plumbs schema.source_id through to DataWarehouseSyncWarning.source_id. |
| posthog/schema.py | Adds source_id: str | None to DataWarehouseSyncWarning with a default of None. |
| frontend/src/scenes/data-warehouse/editor/OutputPane.tsx | Renders a “Manage source” link for warnings that include source_id. |
| frontend/src/queries/schema/schema-general.ts | Updates generated TS types to include optional source_id. |
| frontend/src/queries/schema.json | Updates generated JSON schema to include source_id. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Size Change: 0 B Total Size: 80.9 MB ℹ️ View Unchanged
|
|
🎭 Playwright report · View test results →
These issues are not necessarily caused by your changes. |
Adds a source_id field to DataWarehouseSyncWarning so the editor's sync-warning banner can link directly to the managed source's management page. Plumbed through the backend warning builder, query schema, generated API types, and the OutputPane banner UI. Generated-By: PostHog Code Task-Id: d57307e0-2685-4b4a-9737-8dbf455ac109
9f4128b to
f3593fc
Compare
…ync warning tests The stale-running and should-not-sync (treated-as-paused) warning paths weren't asserting the new source_id field. Add assertions so the field is verified on those branches, matching the parameterized problem-status test. Generated-By: PostHog Code Task-Id: d57307e0-2685-4b4a-9737-8dbf455ac109
|
Addressed the greptile suggestion: added |
|
👋 Visual changes detected for this PR. Review and approve in PostHog Visual Review If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix. |
Status updateMerge conflict resolved. The branch was 266 commits behind master, and master had relocated the CI is green for all functional checks (Django, Jest, lint, typecheck, builds). The earlier Visual review is red, but not because of this PR. The run reports The remaining |
Problem
When a SQL editor query reads from a data warehouse table whose source is failing, paused, hit a billing limit, or is stale, we surface a warning banner. But the banner was a dead end — users had no quick way to get to the source to diagnose or fix the underlying sync issue.
Changes
source_idtoDataWarehouseSyncWarning(the schema query type), populated from the responsibleExternalDataSchema's source. It'snullfor self-managed tables.source_idis present, linking to the source's management page (opens in a new tab).How did you test this code?
I'm an agent (Claude Code). Automated checks I actually ran locally:
schema.json/schema.py) viapnpm schema:build.test_sync_status.pyto assertsource_id. I could not complete a full backend test run locally because the ClickHouse test-database setup timed out in my environment — the backend change is a single-field passthrough, so please confirmproducts/data_warehouse/backend/test/test_sync_status.pyis green in CI.🤖 Agent context
Authored by Claude Code at the request of the human author.
table_name,schema_name,source_type,status, andmessagebut no identifier to build a source link from. Addedsource_idrather than a fully-formed URL so URL construction stays in the frontend (urls.dataWarehouseSource), consistent with how the connection selector links to sources (managed-${id}prefix).