Skip to content

Commit

Permalink
chore(data-warehouse): Split team by workspace (#18313)
Browse files Browse the repository at this point in the history
* create airbyte source api

* comment test

* rename and add connection

* comment out test

* frontend updates and additional API calls on airbyte

* some more UI and retrieve endpoint

* restore lock file

* connecting the dots

* add destination logic

* make destinatino parquet

* ui updates

* rename data

* more renaming

* migration

* remove test

* rename

* Update UI snapshots for `chromium` (2)

* missing file

* typing

* remove unneeded field

* add rollback deletions if one fo the related resources fails

* add feature flag

* fix error handling

* adjust warning messages

* fix external link listener

* Update UI snapshots for `chromium` (2)

* format

* add model

* add api call

* remove unnecessary env var

* remove env var

* adjustments

* add more env vars

* update vars

* fix import

* wrong migration name

* add cleanup

* working workspaces

* simplify workspace id storage

* Update query snapshots

* logging

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
EDsCODE and github-actions[bot] authored Nov 3, 2023
1 parent 70b9c33 commit 74da172
Show file tree
Hide file tree
Showing 24 changed files with 356 additions and 220 deletions.
2 changes: 1 addition & 1 deletion latest_migrations.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ contenttypes: 0002_remove_content_type_name
ee: 0015_add_verified_properties
otp_static: 0002_throttling
otp_totp: 0002_auto_20190420_0723
posthog: 0358_externaldatasource
posthog: 0359_team_external_data_workspace_id
sessions: 0001_initial
social_django: 0010_uid_db_index
two_factor: 0007_auto_20201201_1019
9 changes: 6 additions & 3 deletions posthog/api/test/__snapshots__/test_action.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_actions-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/actions/%3F%24'*/
Expand Down Expand Up @@ -222,7 +223,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_actions-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/actions/%3F%24'*/
Expand Down Expand Up @@ -546,7 +548,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_actions-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/actions/%3F%24'*/
Expand Down
9 changes: 6 additions & 3 deletions posthog/api/test/__snapshots__/test_annotation.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_annotations-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/annotations/%3F%24'*/
Expand Down Expand Up @@ -146,7 +147,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_annotations-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/annotations/%3F%24'*/
Expand Down Expand Up @@ -468,7 +470,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_annotations-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/annotations/%3F%24'*/
Expand Down
12 changes: 8 additions & 4 deletions posthog/api/test/__snapshots__/test_decide.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='team-detail',route='api/projects/%28%3FP%3Cid%3E%5B%5E/.%5D%2B%29/%3F%24'*/
Expand Down Expand Up @@ -315,7 +316,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21
Expand Down Expand Up @@ -468,7 +470,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21
Expand Down Expand Up @@ -609,7 +612,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."api_token" = 'token123'
LIMIT 21
Expand Down
6 changes: 4 additions & 2 deletions posthog/api/test/__snapshots__/test_early_access_feature.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21
Expand Down Expand Up @@ -170,7 +171,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."api_token" = 'token123'
LIMIT 21 /*controller='posthog.api.early_access_feature.early_access_features',route='%5Eapi/early_access_features/%3F%28%3F%3A%5B%3F%23%5D.%2A%29%3F%24'*/
Expand Down
3 changes: 2 additions & 1 deletion posthog/api/test/__snapshots__/test_element.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='element-stats',route='api/element/stats/%3F%24'*/
Expand Down
27 changes: 19 additions & 8 deletions posthog/api/test/__snapshots__/test_insight.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
Expand Down Expand Up @@ -715,7 +716,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
Expand Down Expand Up @@ -846,7 +848,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
Expand Down Expand Up @@ -1067,7 +1070,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
Expand Down Expand Up @@ -1215,6 +1219,7 @@
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id",
"posthog_user"."id",
"posthog_user"."password",
"posthog_user"."last_login",
Expand Down Expand Up @@ -1340,6 +1345,7 @@
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id",
"posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
Expand Down Expand Up @@ -1446,6 +1452,7 @@
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id",
"posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
Expand Down Expand Up @@ -1579,7 +1586,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
Expand Down Expand Up @@ -1669,7 +1677,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
Expand Down Expand Up @@ -1751,7 +1760,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
Expand Down Expand Up @@ -1806,7 +1816,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
Expand Down
3 changes: 2 additions & 1 deletion posthog/api/test/__snapshots__/test_preflight.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
"posthog_team"."event_names_with_usage",
"posthog_team"."event_properties",
"posthog_team"."event_properties_with_usage",
"posthog_team"."event_properties_numerical"
"posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."id" = 2
LIMIT 21 /*controller='posthog.views.preflight_check',route='%5E_preflight/%3F%28%3F%3A%5B%3F%23%5D.%2A%29%3F%24'*/
Expand Down
3 changes: 2 additions & 1 deletion posthog/api/test/__snapshots__/test_survey.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"posthog_team"."primary_dashboard_id",
"posthog_team"."extra_settings",
"posthog_team"."correlation_config",
"posthog_team"."session_recording_retention_period_days"
"posthog_team"."session_recording_retention_period_days",
"posthog_team"."external_data_workspace_id"
FROM "posthog_team"
WHERE "posthog_team"."api_token" = 'token123'
LIMIT 21 /*controller='posthog.api.survey.surveys',route='%5Eapi/surveys/%3F%28%3F%3A%5B%3F%23%5D.%2A%29%3F%24'*/
Expand Down
Loading

0 comments on commit 74da172

Please sign in to comment.