From a71e89960526701ecbdd01b32d3a209def0bb7b6 Mon Sep 17 00:00:00 2001 From: Eric Duong Date: Tue, 18 Jan 2022 14:32:28 -0500 Subject: [PATCH] Yeetcode (#7830) * remove django query tests * remove funnel and caching check * remove ee available var * remove is_clickhouse_enabled * remove abstract tests * change primary db * missing func * unnecessary test * try new e2e ci * func arg * remove param * ci * remove plugins in docker * background * change ur; * add kafka url * add step * update docker * primary docker file * mount volumes correctly * one more * remove postgres tests * remove foss * remove all is_clickhouse_neabled * remove irrelelvant test * remove extra arg * remove var * arg * add foss comment * add foss comment * plugin server config * Update posthog/utils.py Co-authored-by: Karl-Aksel Puulmann * migrate commands * comment * add clickhouse to pg tests * change script * change ordering * deepsource * restore foss tests * test remove KAFKA_ENABLED from CI * always wait * up proper resources * use one conftest * restore * remove unnecessary tests * remove more pg * log event tests * fix more tests * more tests * type * fix more tests * last test * typing * account for shared class setup * temp test cloud * restore cloud master checkout * adjust contexts * backwards Co-authored-by: Karl-Aksel Puulmann Co-authored-by: yakkomajuri --- .devcontainer/docker-compose.yml | 6 +- .github/workflows/benchmark.yml | 3 +- .github/workflows/ci-backend.yml | 18 +- .github/workflows/ci-plugin-server.yml | 28 +- .github/workflows/e2e.yml | 19 +- .../workflows/foss-release-image-publish.yml | 9 +- .github/workflows/foss-sync.yml | 11 +- bin/docker | 2 +- bin/docker-migrate | 2 +- bin/e2e-test-runner | 4 +- conftest.py | 137 ++++++++ cypress/fixtures/_preflight.json | 1 - ...e.ch.arm64.yml => docker-compose.arm64.yml | 17 +- docker-compose.dev.yml | 80 ++++- docker-compose.e2e.yml | 34 -- docker-compose.hobby.yml | 1 - ...ose.ch.test.yml => docker-compose.test.yml | 5 +- docker-compose.yml | 40 +++ ee/clickhouse/middleware.py | 7 +- ee/clickhouse/models/person.py | 3 +- ee/clickhouse/models/test/test_filters.py | 12 - ee/clickhouse/queries/funnels/base.py | 20 +- .../queries/trends/test/test_formula.py | 3 +- ee/conftest.py | 57 ++-- ee/docker-compose.ch.yml | 104 ------ .../commands/setup_test_environment.py | 45 ++- ee/tasks/test/test_org_usage_report.py | 2 +- .../__stories__/navigation.initial.json | 1 - frontend/src/lib/api.mock.ts | 2 +- .../components/ChartFilter/ChartFilter.tsx | 39 +-- .../lib/introductions/groupsAccessLogic.ts | 14 +- frontend/src/scenes/PreflightCheck/logic.ts | 3 - frontend/src/scenes/actions/Action.tsx | 39 +-- .../billing/billing-subscribed-failed.json | 1 - .../billing/billing-subscribed-success.json | 1 - .../src/scenes/cohorts/CohortDetailsRow.tsx | 15 +- .../MatchCriteriaSelector.tsx | 37 +-- .../dashboard/__stories__/dashboard.json | 54 --- .../src/scenes/events/__stories__/events.json | 107 ------ .../src/scenes/funnels/FunnelBarGraph.tsx | 18 +- .../src/scenes/funnels/FunnelCanvasLabel.tsx | 8 +- .../src/scenes/funnels/funnelLogic.test.ts | 17 - frontend/src/scenes/funnels/funnelLogic.ts | 24 +- .../ingestion/__stories__/ingestion.json | 1 - .../ActionFilterRow/ActionFilterRow.tsx | 8 +- .../insights/EmptyStates/EmptyStates.tsx | 8 +- .../dashboard-insight-empty-state.json | 1 - .../insights/EmptyStates/empty-state.json | 1 - .../insights/EmptyStates/error-state.json | 1 - .../funnel-invalid-exclusion-state.json | 1 - .../EmptyStates/funnel-single-step-state.json | 1 - .../insights/EmptyStates/timeout-state.json | 1 - .../src/scenes/insights/InsightContainer.tsx | 4 - .../InsightTabs/FunnelTab/FunnelTab.tsx | 84 +---- .../FunnelTab/ToggleButtonChartFilter.tsx | 6 +- .../insights/InsightTabs/RetentionTab.tsx | 5 +- .../InsightTabs/TrendTab/TrendTab.tsx | 4 +- .../insights/__stories__/Funnels.stories.tsx | 1 - .../__stories__/Retention.stories.tsx | 1 - .../__stories__/funnelsWithCorrelation.json | 7 - .../insights/__stories__/lifecycle.json | 7 - .../scenes/insights/__stories__/paths.json | 7 - .../insights/__stories__/retention.json | 7 - .../insights/__stories__/stickiness.json | 7 - .../scenes/insights/__stories__/trends.json | 7 - frontend/src/scenes/insights/insightLogic.tsx | 5 - .../__stories__/saved-insights-card.json | 11 - .../__stories__/saved-insights-list.json | 11 - .../SessionRecordingsTable.tsx | 4 +- .../__stories__/recordings.json | 7 - frontend/src/scenes/trends/PersonsModal.tsx | 38 +-- .../src/scenes/trends/personsModalLogic.tsx | 5 - frontend/src/types.ts | 4 - package.json | 14 +- plugin-server/package.json | 6 +- posthog/api/__init__.py | 86 ++--- posthog/api/action.py | 3 - posthog/api/capture.py | 171 +++++----- posthog/api/cohort.py | 13 +- posthog/api/instance_status.py | 59 +--- posthog/api/test/test_action.py | 5 - posthog/api/test/test_action_people.py | 34 +- posthog/api/test/test_capture.py | 231 ++++++------- posthog/api/test/test_cohort.py | 6 +- posthog/api/test/test_element.py | 4 - posthog/api/test/test_event.py | 45 +-- posthog/api/test/test_insight.py | 27 +- posthog/api/test/test_person.py | 6 - posthog/api/test/test_preflight.py | 16 +- posthog/api/test/test_retention.py | 106 +----- posthog/api/test/test_session_recordings.py | 4 - posthog/api/test/test_signup.py | 8 - posthog/api/test/test_stickiness.py | 17 +- posthog/api/test/test_utils.py | 2 +- posthog/api/utils.py | 14 +- posthog/async_migrations/setup.py | 8 +- posthog/celery.py | 203 +++++------ posthog/demo/__init__.py | 11 +- posthog/demo/data_generator.py | 34 +- posthog/models/cohort.py | 54 +-- posthog/models/filters/mixins/simplify.py | 7 +- posthog/models/filters/utils.py | 9 +- posthog/models/person.py | 30 +- posthog/models/plugin.py | 70 ++-- posthog/models/team.py | 3 +- posthog/models/user.py | 7 +- posthog/queries/abstract_test/__init__.py | 0 .../abstract_test/test_breakdown_filtering.py | 19 -- posthog/queries/abstract_test/test_compare.py | 7 - .../queries/abstract_test/test_graph_type.py | 23 -- .../queries/abstract_test/test_interval.py | 23 -- .../abstract_test/test_property_filtering.py | 27 -- .../queries/abstract_test/test_timerange.py | 55 --- posthog/queries/funnel.py | 314 ------------------ .../test/test_session_recording_list.py | 10 - posthog/queries/test/test_funnel.py | 57 +--- posthog/queries/test/test_paths.py | 21 -- posthog/queries/test/test_retention.py | 16 +- posthog/queries/test/test_trends.py | 31 +- posthog/settings/__init__.py | 4 +- posthog/settings/celery.py | 3 +- posthog/settings/data_stores.py | 7 +- posthog/settings/ee.py | 8 - posthog/settings/web.py | 8 +- posthog/tasks/__init__.py | 1 - posthog/tasks/calculate_action.py | 34 -- posthog/tasks/calculate_cohort.py | 21 +- .../tasks/calculate_event_property_usage.py | 14 +- posthog/tasks/delete_clickhouse_data.py | 6 +- posthog/tasks/org_usage_report.py | 5 +- posthog/tasks/status_report.py | 87 ++--- posthog/tasks/test/test_calculate_cohort.py | 4 - .../test_calculate_event_property_usage.py | 4 - posthog/tasks/test/test_org_usage_report.py | 3 +- posthog/tasks/test/test_status_report.py | 24 +- posthog/tasks/test/test_update_cache.py | 39 +-- posthog/tasks/update_cache.py | 77 ++--- posthog/test/test_cohort_model.py | 45 +-- posthog/test/test_demo.py | 7 +- posthog/test/test_event_model.py | 1 - posthog/test/test_feature_flag.py | 16 +- posthog/test/test_plugin_log_entry.py | 4 - posthog/test/test_user_model.py | 8 +- posthog/urls.py | 7 +- posthog/utils.py | 12 +- posthog/views.py | 3 - 146 files changed, 1042 insertions(+), 2631 deletions(-) mode change 100755 => 100644 bin/docker-migrate rename ee/docker-compose.ch.arm64.yml => docker-compose.arm64.yml (86%) delete mode 100644 docker-compose.e2e.yml rename ee/docker-compose.ch.test.yml => docker-compose.test.yml (90%) delete mode 100644 ee/docker-compose.ch.yml delete mode 100644 posthog/queries/abstract_test/__init__.py delete mode 100644 posthog/queries/abstract_test/test_breakdown_filtering.py delete mode 100644 posthog/queries/abstract_test/test_compare.py delete mode 100644 posthog/queries/abstract_test/test_graph_type.py delete mode 100644 posthog/queries/abstract_test/test_interval.py delete mode 100644 posthog/queries/abstract_test/test_property_filtering.py delete mode 100644 posthog/queries/abstract_test/test_timerange.py delete mode 100644 posthog/queries/funnel.py delete mode 100644 posthog/settings/ee.py delete mode 100644 posthog/tasks/calculate_action.py diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 5bb71c38afc..8b6c5db7065 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -59,9 +59,9 @@ services: - '9009:9009' volumes: - ../ee/idl:/idl - - ../docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - - ../docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml - - ../docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml + - ./docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + - ./docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml + - ./docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml - clickhouse-data:/var/lib/clickhouse/data # Needed for 1. clickhouse distributed queries 2. kafka replication diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index bbf10871dd0..130d68ec772 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -22,7 +22,6 @@ jobs: SAML_DISABLED: '1' DATABASE_URL: 'postgres://posthog:posthog@localhost:5432/posthog_test' REDIS_URL: 'redis://localhost' - PRIMARY_DB: 'clickhouse' DEBUG: '1' CLICKHOUSE_DATABASE: posthog CLICKHOUSE_HOST: ${{ secrets.BENCHMARKS_CLICKHOUSE_HOST }} @@ -91,7 +90,7 @@ jobs: - name: Set up PostHog run: | - ./bin/docker-migrate & wait + python manage.py migrate & wait python manage.py setup_dev --no-data - name: Configure benchmarks diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml index 25ff04a10c3..59f1382dcce 100644 --- a/.github/workflows/ci-backend.yml +++ b/.github/workflows/ci-backend.yml @@ -156,8 +156,8 @@ jobs: - name: Start stack with Docker Compose run: | - docker-compose -f ee/docker-compose.ch.yml down - docker-compose -f ee/docker-compose.ch.yml up -d ${{ matrix.foss && 'db' || 'db clickhouse zookeeper kafka' }} & + docker-compose -f docker-compose.dev.yml down + docker-compose -f docker-compose.dev.yml up -d db clickhouse zookeeper kafka & - name: Set up Python uses: actions/setup-python@v2 @@ -209,26 +209,20 @@ jobs: touch frontend/dist/shared_dashboard.html - name: Wait for Clickhouse & Kafka - if: ${{ !matrix.foss }} run: bin/check_kafka_clickhouse_up - name: Run FOSS tests if: ${{ matrix.foss }} run: | - rm -rf ee/ pytest -m "not ee" posthog/ --cov --cov-report=xml:coverage-postgres.xml - name: Run SAML tests if: ${{ matrix.saml }} - env: - PRIMARY_DB: 'clickhouse' run: | pytest ee -m "saml_only" - name: Run ee/ tests if: ${{ matrix.ee }} - env: - PRIMARY_DB: 'clickhouse' run: | pytest ee -m "not saml_only" \ --splits ${{ matrix.concurrency }} \ @@ -239,8 +233,6 @@ jobs: - name: Run pytest.mark.ee tests if: ${{ matrix.ee && matrix.group == '1' }} - env: - PRIMARY_DB: 'clickhouse' run: | pytest posthog -m "ee" @@ -282,8 +274,8 @@ jobs: cat requirements.txt >> deploy/requirements.txt - name: Start stack with Docker Compose run: | - docker-compose -f deploy/ee/docker-compose.ch.yml down - docker-compose -f deploy/ee/docker-compose.ch.yml up -d db clickhouse zookeeper kafka & + docker-compose -f deploy/docker-compose.dev.yml down + docker-compose -f deploy/docker-compose.dev.yml up -d db clickhouse zookeeper kafka & - name: Set up Python 3.8 uses: actions/setup-python@v2 with: @@ -351,8 +343,6 @@ jobs: touch frontend/dist/shared_dashboard.html - name: Run cloud tests (posthog-cloud) - env: - PRIMARY_DB: 'clickhouse' run: | source .env.template cd deploy diff --git a/.github/workflows/ci-plugin-server.yml b/.github/workflows/ci-plugin-server.yml index 3669f7d17ce..e523ec9460b 100644 --- a/.github/workflows/ci-plugin-server.yml +++ b/.github/workflows/ci-plugin-server.yml @@ -60,11 +60,22 @@ jobs: --health-retries 5 env: REDIS_URL: 'redis://localhost' + CLICKHOUSE_HOST: 'localhost' + CLICKHOUSE_DATABASE: 'posthog_test' + KAFKA_HOSTS: 'kafka:9092' steps: - name: Check out Django server for database setup uses: actions/checkout@v2 + - name: Fix Kafka Hostname + run: | + sudo bash -c 'echo "127.0.0.1 kafka zookeeper" >> /etc/hosts' + ping -c 1 kafka + ping -c 1 zookeeper + - name: Start Kafka, ClickHouse, Zookeeper + run: docker-compose -f docker-compose.dev.yml up -d zookeeper kafka clickhouse + - name: Set up Python uses: actions/setup-python@v2 with: @@ -130,11 +141,22 @@ jobs: --health-retries 5 env: REDIS_URL: 'redis://localhost' + CLICKHOUSE_HOST: 'localhost' + CLICKHOUSE_DATABASE: 'posthog_test' + KAFKA_HOSTS: 'kafka:9092' steps: - name: Check out Django server for database setup uses: actions/checkout@v2 + - name: Fix Kafka Hostname + run: | + sudo bash -c 'echo "127.0.0.1 kafka zookeeper" >> /etc/hosts' + ping -c 1 kafka + ping -c 1 zookeeper + - name: Start Kafka, ClickHouse, Zookeeper + run: docker-compose -f docker-compose.dev.yml up -d zookeeper kafka clickhouse + - name: Set up Python uses: actions/setup-python@v2 with: @@ -215,7 +237,7 @@ jobs: ping -c 1 kafka ping -c 1 zookeeper - name: Start Kafka, ClickHouse, Zookeeper - run: docker-compose -f ee/docker-compose.ch.yml up -d zookeeper kafka clickhouse + run: docker-compose -f docker-compose.dev.yml up -d zookeeper kafka clickhouse - name: Set up Python uses: actions/setup-python@v2 @@ -245,7 +267,6 @@ jobs: env: SECRET_KEY: 'abcdef' # unsafe - for testing only DATABASE_URL: 'postgres://postgres:postgres@localhost:5432/posthog' - PRIMARY_DB: 'clickhouse' TEST: 'true' run: python manage.py setup_test_environment @@ -298,7 +319,7 @@ jobs: ping -c 1 kafka ping -c 1 zookeeper - name: Start Kafka, ClickHouse, Zookeeper - run: docker-compose -f ee/docker-compose.ch.yml up -d zookeeper kafka clickhouse + run: docker-compose -f docker-compose.dev.yml up -d zookeeper kafka clickhouse - name: Set up Python uses: actions/setup-python@v2 @@ -328,7 +349,6 @@ jobs: env: SECRET_KEY: 'abcdef' # unsafe - for testing only DATABASE_URL: 'postgres://postgres:postgres@localhost:5432/posthog' - PRIMARY_DB: 'clickhouse' TEST: 'true' run: python manage.py setup_test_environment diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 0d28cb90575..e03819ef588 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -17,7 +17,6 @@ env: EMAIL_HOST: 'email.test.posthog.net' # used to test password resets SITE_URL: 'test.posthog.net' # used to test password resets NO_RESTART_LOOP: 1 - PRIMARY_DB: clickhouse CLICKHOUSE_SECURE: 0 jobs: @@ -50,10 +49,9 @@ jobs: yarn add cypress@6.7.0 cypress-terminal-report@2.1.0 @cypress/react@4.16.4 @cypress/webpack-preprocessor@5.7.0 cd plugin-server yarn install --frozen-lockfile - cypress: name: Cypress E2E tests (${{ strategy.job-index }}) - if: ${{ github.ref != 'refs/heads/master' }} # Don't run on master, we only cace about node_modules cache + if: ${{ github.ref != 'refs/heads/master' }} # Don't run on master, we only cace about node_modules cache runs-on: ubuntu-18.04 needs: [cypress_prep] @@ -70,9 +68,8 @@ jobs: - name: Start stack with Docker Compose run: | - docker-compose -f ee/docker-compose.ch.yml down - docker-compose -f ee/docker-compose.ch.yml up -d db clickhouse zookeeper kafka redis & - + docker-compose -f docker-compose.dev.yml down + docker-compose -f docker-compose.dev.yml up -d db clickhouse zookeeper kafka redis & - name: Add kafka host to /etc/hosts for kafka connectivity run: sudo echo "127.0.0.1 kafka" | sudo tee -a /etc/hosts @@ -107,8 +104,8 @@ jobs: ${{ runner.os }}-cypress-node-modules-3- - name: Yarn install deps # NOTE: we always try to run yarn install, as we're using a cache - # from the prep phase that hasn't been proven to be correct. We - # should still get some cache benefits. + # from the prep phase that hasn't been proven to be correct. We + # should still get some cache benefits. run: | yarn install --frozen-lockfile yarn add cypress@6.7.0 cypress-terminal-report@2.1.0 @cypress/react@4.16.4 @cypress/webpack-preprocessor@5.7.0 @@ -123,11 +120,9 @@ jobs: yarn build - name: Boot PostHog run: | - python manage.py collectstatic --noinput & - ./bin/docker-migrate & - wait + python manage.py collectstatic --noinput bin/check_kafka_clickhouse_up - python manage.py migrate_clickhouse + ./bin/migrate python manage.py setup_dev mkdir -p /tmp/logs ./bin/docker-worker &> /tmp/logs/worker.txt & diff --git a/.github/workflows/foss-release-image-publish.yml b/.github/workflows/foss-release-image-publish.yml index 026b0ea60b6..bfa84cf23bb 100644 --- a/.github/workflows/foss-release-image-publish.yml +++ b/.github/workflows/foss-release-image-publish.yml @@ -3,10 +3,11 @@ name: Docker FOSS release image -on: - push: - tags: - - '*.**' +# TODO: Don't sync until ee code relocation is done +# on: +# push: +# tags: +# - '*.**' jobs: build-push: diff --git a/.github/workflows/foss-sync.yml b/.github/workflows/foss-sync.yml index d4fc537b3e9..3fbf677d1e7 100644 --- a/.github/workflows/foss-sync.yml +++ b/.github/workflows/foss-sync.yml @@ -1,10 +1,11 @@ name: Sync PostHog FOSS -on: - push: - branches: - - master - - main +# TODO: Don't sync until the ee code relocation is done +# on: +# push: +# branches: +# - master +# - main jobs: repo-sync: diff --git a/bin/docker b/bin/docker index c0fec9ef363..8e4148ad96e 100755 --- a/bin/docker +++ b/bin/docker @@ -1,6 +1,6 @@ #!/bin/bash set -e -./bin/docker-migrate +./bin/migrate ./bin/docker-worker & ./bin/docker-server diff --git a/bin/docker-migrate b/bin/docker-migrate old mode 100755 new mode 100644 index 6649980b1ac..f387c04d715 --- a/bin/docker-migrate +++ b/bin/docker-migrate @@ -1,4 +1,4 @@ #!/bin/bash set -e -python manage.py migrate +python manage.py migrate \ No newline at end of file diff --git a/bin/e2e-test-runner b/bin/e2e-test-runner index 0f3bc778e67..f2c76ded2d3 100755 --- a/bin/e2e-test-runner +++ b/bin/e2e-test-runner @@ -25,8 +25,8 @@ export PGPASSWORD="${PGPASSWORD:=posthog}" export PGPORT="${PGPORT:=5432}" export DATABASE_URL="postgres://${PGUSER}:${PGPASSWORD}@${PGHOST}:${PGPORT}/${DATABASE}" -nc -z localhost 9092 || ( echo -e "\033[0;31mKafka isn't running. Please run\n\tdocker compose -f ee/docker-compose.ch.arm64.yml up zookeeper kafka clickhouse db redis\nI'll wait while you do that.\033[0m" ; bin/check_kafka_clickhouse_up ) -wget -nv -t1 --spider 'http://localhost:8123/' || ( echo -e "\033[0;31mClickhouse isn't running. Please run\n\tdocker compose -f ee/docker-compose.ch.arm64.yml up zookeeper kafka clickhouse db redis.\nI'll wait while you do that.\033[0m" ; bin/check_kafka_clickhouse_up ) +nc -z localhost 9092 || ( echo -e "\033[0;31mKafka isn't running. Please run\n\tdocker compose -f docker-compose.arm64.yml up zookeeper kafka clickhouse db redis\nI'll wait while you do that.\033[0m" ; bin/check_kafka_clickhouse_up ) +wget -nv -t1 --spider 'http://localhost:8123/' || ( echo -e "\033[0;31mClickhouse isn't running. Please run\n\tdocker compose -f docker-compose.arm64.yml up zookeeper kafka clickhouse db redis.\nI'll wait while you do that.\033[0m" ; bin/check_kafka_clickhouse_up ) trap "trap - SIGTERM && yarn remove cypress cypress-terminal-report @cypress/react @cypress/webpack-preprocessor && kill -- -$$" SIGINT SIGTERM EXIT diff --git a/conftest.py b/conftest.py index b8359bbefbb..41dfdb12620 100644 --- a/conftest.py +++ b/conftest.py @@ -1,4 +1,141 @@ import pytest +from infi.clickhouse_orm import Database + +from ee.clickhouse.client import sync_execute +from ee.clickhouse.sql.dead_letter_queue import ( + DEAD_LETTER_QUEUE_TABLE_MV_SQL, + KAFKA_DEAD_LETTER_QUEUE_TABLE_SQL, + TRUNCATE_DEAD_LETTER_QUEUE_TABLE_MV_SQL, +) +from posthog.settings import ( + CLICKHOUSE_DATABASE, + CLICKHOUSE_HTTP_URL, + CLICKHOUSE_PASSWORD, + CLICKHOUSE_USER, + CLICKHOUSE_VERIFY, +) +from posthog.test.base import TestMixin + + +def create_clickhouse_tables(num_tables: int): + # Reset clickhouse tables to default before running test + # Mostly so that test runs locally work correctly + from ee.clickhouse.sql.cohort import CREATE_COHORTPEOPLE_TABLE_SQL + from ee.clickhouse.sql.dead_letter_queue import DEAD_LETTER_QUEUE_TABLE_SQL + from ee.clickhouse.sql.events import EVENTS_TABLE_SQL + from ee.clickhouse.sql.groups import GROUPS_TABLE_SQL + from ee.clickhouse.sql.person import ( + PERSON_DISTINCT_ID2_TABLE_SQL, + PERSON_STATIC_COHORT_TABLE_SQL, + PERSONS_DISTINCT_ID_TABLE_SQL, + PERSONS_TABLE_SQL, + ) + from ee.clickhouse.sql.plugin_log_entries import PLUGIN_LOG_ENTRIES_TABLE_SQL + from ee.clickhouse.sql.session_recording_events import SESSION_RECORDING_EVENTS_TABLE_SQL + + # REMEMBER TO ADD ANY NEW CLICKHOUSE TABLES TO THIS ARRAY! + TABLES_TO_CREATE_DROP = [ + EVENTS_TABLE_SQL(), + PERSONS_TABLE_SQL(), + PERSONS_DISTINCT_ID_TABLE_SQL(), + PERSON_DISTINCT_ID2_TABLE_SQL(), + PERSON_STATIC_COHORT_TABLE_SQL(), + SESSION_RECORDING_EVENTS_TABLE_SQL(), + PLUGIN_LOG_ENTRIES_TABLE_SQL(), + CREATE_COHORTPEOPLE_TABLE_SQL(), + KAFKA_DEAD_LETTER_QUEUE_TABLE_SQL, + DEAD_LETTER_QUEUE_TABLE_SQL(), + DEAD_LETTER_QUEUE_TABLE_MV_SQL, + GROUPS_TABLE_SQL(), + ] + + if num_tables == len(TABLES_TO_CREATE_DROP): + return + + for item in TABLES_TO_CREATE_DROP: + sync_execute(item) + + +def reset_clickhouse_tables(): + # Reset clickhouse tables to default before running test + # Mostly so that test runs locally work correctly + from ee.clickhouse.sql.cohort import TRUNCATE_COHORTPEOPLE_TABLE_SQL + from ee.clickhouse.sql.dead_letter_queue import TRUNCATE_DEAD_LETTER_QUEUE_TABLE_SQL + from ee.clickhouse.sql.events import TRUNCATE_EVENTS_TABLE_SQL + from ee.clickhouse.sql.groups import TRUNCATE_GROUPS_TABLE_SQL + from ee.clickhouse.sql.person import ( + TRUNCATE_PERSON_DISTINCT_ID2_TABLE_SQL, + TRUNCATE_PERSON_DISTINCT_ID_TABLE_SQL, + TRUNCATE_PERSON_STATIC_COHORT_TABLE_SQL, + TRUNCATE_PERSON_TABLE_SQL, + ) + from ee.clickhouse.sql.plugin_log_entries import TRUNCATE_PLUGIN_LOG_ENTRIES_TABLE_SQL + from ee.clickhouse.sql.session_recording_events import TRUNCATE_SESSION_RECORDING_EVENTS_TABLE_SQL + + # REMEMBER TO ADD ANY NEW CLICKHOUSE TABLES TO THIS ARRAY! + TABLES_TO_CREATE_DROP = [ + TRUNCATE_EVENTS_TABLE_SQL, + TRUNCATE_PERSON_TABLE_SQL, + TRUNCATE_PERSON_DISTINCT_ID_TABLE_SQL, + TRUNCATE_PERSON_DISTINCT_ID2_TABLE_SQL, + TRUNCATE_PERSON_STATIC_COHORT_TABLE_SQL, + TRUNCATE_SESSION_RECORDING_EVENTS_TABLE_SQL, + TRUNCATE_PLUGIN_LOG_ENTRIES_TABLE_SQL, + TRUNCATE_COHORTPEOPLE_TABLE_SQL, + TRUNCATE_DEAD_LETTER_QUEUE_TABLE_SQL, + TRUNCATE_DEAD_LETTER_QUEUE_TABLE_MV_SQL, + TRUNCATE_GROUPS_TABLE_SQL, + ] + + for item in TABLES_TO_CREATE_DROP: + sync_execute(item) + + +@pytest.fixture(scope="package") +def django_db_setup(django_db_setup, django_db_keepdb): + database = Database( + CLICKHOUSE_DATABASE, + db_url=CLICKHOUSE_HTTP_URL, + username=CLICKHOUSE_USER, + password=CLICKHOUSE_PASSWORD, + verify_ssl_cert=CLICKHOUSE_VERIFY, + ) + + if not django_db_keepdb: + try: + database.drop_database() + except: + pass + + database.create_database() # Create database if it doesn't exist + table_count = sync_execute( + "SELECT count() FROM system.tables WHERE database = %(database)s", {"database": CLICKHOUSE_DATABASE} + )[0][0] + create_clickhouse_tables(table_count) + + yield + + if django_db_keepdb: + reset_clickhouse_tables() + else: + try: + database.drop_database() + except: + pass + + +@pytest.fixture +def base_test_mixin_fixture(): + kls = TestMixin() + kls.setUp() + kls.setUpTestData() + + return kls + + +@pytest.fixture +def team(base_test_mixin_fixture): + return base_test_mixin_fixture.team # :TRICKY: Integrate syrupy with unittest test cases diff --git a/cypress/fixtures/_preflight.json b/cypress/fixtures/_preflight.json index e915f451e32..1428014c966 100644 --- a/cypress/fixtures/_preflight.json +++ b/cypress/fixtures/_preflight.json @@ -8,7 +8,6 @@ "cloud": false, "available_social_auth_providers": { "google-oauth2": false, "github": false, "gitlab": false }, "ee_available": true, - "is_clickhouse_enabled": false, "db_backend": "postgres", "available_timezones": { "Africa/Abidjan": 0.0, diff --git a/ee/docker-compose.ch.arm64.yml b/docker-compose.arm64.yml similarity index 86% rename from ee/docker-compose.ch.arm64.yml rename to docker-compose.arm64.yml index 69a0c740817..9433fec843d 100644 --- a/ee/docker-compose.ch.arm64.yml +++ b/docker-compose.arm64.yml @@ -25,10 +25,10 @@ services: - '9440:9440' - '9009:9009' volumes: - - ./idl:/idl - - ../docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - - ../docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml - - ../docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml + - ./ee/idl:/idl + - ./docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + - ./docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml + - ./docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml zookeeper: image: zookeeper restart: always @@ -43,11 +43,11 @@ services: KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 worker: &worker build: - context: ../ + context: . dockerfile: dev.Dockerfile command: ./bin/docker-worker-celery --with-scheduler volumes: - - ..:/code + - .:/code environment: DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog' CLICKHOUSE_HOST: 'clickhouse' @@ -58,7 +58,6 @@ services: REDIS_URL: 'redis://redis:6379/' SECRET_KEY: 'alsdfjiosdajfklalsdjkf' DEBUG: 'true' - PRIMARY_DB: 'clickhouse' PGHOST: db PGUSER: posthog PGPASSWORD: posthog @@ -80,11 +79,11 @@ services: - '8234:8234' plugins: build: - context: ../ + context: . dockerfile: dev.Dockerfile command: ./bin/plugin-server --no-restart-loop volumes: - - ..:/code + - .:/code restart: on-failure environment: DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog' diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 9075adae40e..e333a303a4a 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -3,7 +3,6 @@ version: '3' services: db: image: postgres:12-alpine - container_name: posthog_db environment: POSTGRES_USER: posthog POSTGRES_DB: posthog @@ -11,21 +10,53 @@ services: ports: - '5432:5432' redis: - image: 'redis:5-alpine' - container_name: posthog_redis + image: 'redis:alpine' ports: - '6379:6379' - backend: &backend + clickhouse: + # KEEP CLICKHOUSE-SERVER VERSION IN SYNC WITH + # https://github.com/PostHog/charts-clickhouse/blob/main/charts/posthog/templates/clickhouse_instance.yaml#L88 + image: yandex/clickhouse-server:21.6.5 + depends_on: + - kafka + - zookeeper + ports: + - '8123:8123' + - '9000:9000' + - '9440:9440' + - '9009:9009' + volumes: + - ./ee/idl:/idl + - ./docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + - ./docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml + - ./docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml + zookeeper: + image: wurstmeister/zookeeper + kafka: + image: wurstmeister/kafka + depends_on: + - zookeeper + ports: + - '9092:9092' + environment: + KAFKA_ADVERTISED_HOST_NAME: kafka + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + worker: &worker build: context: . dockerfile: dev.Dockerfile - command: ./bin/docker-backend + command: ./bin/docker-worker-celery --with-scheduler volumes: - .:/code environment: DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog' + CLICKHOUSE_HOST: 'clickhouse' + CLICKHOUSE_DATABASE: 'posthog' + CLICKHOUSE_SECURE: 'false' + CLICKHOUSE_VERIFY: 'false' + KAFKA_URL: 'kafka://kafka' REDIS_URL: 'redis://redis:6379/' - SECRET_KEY: '' + SECRET_KEY: 'alsdfjiosdajfklalsdjkf' DEBUG: 'true' PGHOST: db PGUSER: posthog @@ -33,21 +64,40 @@ services: depends_on: - db - redis + - clickhouse + - kafka links: - db:db - redis:redis + - clickhouse:clickhouse + - kafka:kafka + web: + <<: *worker + command: '${CH_WEB_SCRIPT:-./ee/bin/docker-ch-dev-web}' ports: - '8000:8000' - frontend: - <<: *backend - command: ./bin/docker-frontend - ports: - '8234:8234' - worker: - <<: *backend - command: ./bin/docker-worker - ports: [] + plugins: + build: + context: . + dockerfile: dev.Dockerfile + command: ./bin/plugin-server --no-restart-loop + volumes: + - .:/code + restart: on-failure + environment: + DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog' + KAFKA_ENABLED: 'true' + KAFKA_HOSTS: 'kafka:9092' + REDIS_URL: 'redis://redis:6379/' + CLICKHOUSE_HOST: 'clickhouse' depends_on: - db - redis - - backend + - clickhouse + - kafka + links: + - db:db + - redis:redis + - clickhouse:clickhouse + - kafka:kafka diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml deleted file mode 100644 index a4ae03bbe63..00000000000 --- a/docker-compose.e2e.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: '3' - -services: - db: - image: postgres:alpine - container_name: posthog_db - environment: - POSTGRES_USER: posthog - POSTGRES_DB: posthog - POSTGRES_PASSWORD: posthog - redis: - image: 'redis:alpine' - container_name: posthog_redis - web: - container_name: posthog_server - build: - context: . - dockerfile: production.Dockerfile - command: ./bin/docker & tail -f /dev/null - ports: - - '8000:8000' - environment: - DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog' - REDIS_URL: 'redis://redis:6379/' - SECRET_KEY: '' - DEBUG: 1 - DISABLE_SECURE_SSL_REDIRECT: 1 - OPT_OUT_CAPTURE: 1 - depends_on: - - db - - redis - links: - - db:db - - redis:redis diff --git a/docker-compose.hobby.yml b/docker-compose.hobby.yml index d58435eb97a..acdaa7b0cdd 100644 --- a/docker-compose.hobby.yml +++ b/docker-compose.hobby.yml @@ -61,7 +61,6 @@ services: KAFKA_URL: 'kafka://kafka' REDIS_URL: 'redis://redis:6379/' SECRET_KEY: ${POSTHOG_SECRET} - PRIMARY_DB: 'clickhouse' PGHOST: db PGUSER: posthog PGPASSWORD: posthog diff --git a/ee/docker-compose.ch.test.yml b/docker-compose.test.yml similarity index 90% rename from ee/docker-compose.ch.test.yml rename to docker-compose.test.yml index c10b601113e..807eb3b463a 100644 --- a/ee/docker-compose.ch.test.yml +++ b/docker-compose.test.yml @@ -3,11 +3,11 @@ version: '3' services: test: build: - context: ../ + context: . dockerfile: dev.Dockerfile command: ./ee/bin/docker-ch-test volumes: - - ..:/code + - .:/code environment: DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog' CLICKHOUSE_HOST: 'clickhouse' @@ -17,7 +17,6 @@ services: REDIS_URL: 'redis://redis:6379/' SECRET_KEY: 'alsdfjiosdajfklalsdjkf' DEBUG: 'true' - PRIMARY_DB: 'clickhouse' TEST: 'true' depends_on: - db diff --git a/docker-compose.yml b/docker-compose.yml index 0352059687f..738f5b79ebf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,19 +11,59 @@ services: redis: container_name: posthog_redis image: redis:6-alpine + clickhouse: + # KEEP CLICKHOUSE-SERVER VERSION IN SYNC WITH + # https://github.com/PostHog/charts-clickhouse/blob/main/charts/posthog/templates/clickhouse_instance.yaml#L88 + image: yandex/clickhouse-server:21.6.5 + depends_on: + - kafka + - zookeeper + ports: + - '8123:8123' + - '9000:9000' + - '9440:9440' + - '9009:9009' + volumes: + - ./ee/idl:/idl + - ./docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + - ./docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml + - ./docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml + zookeeper: + image: wurstmeister/zookeeper + kafka: + image: wurstmeister/kafka + depends_on: + - zookeeper + ports: + - '9092:9092' + environment: + KAFKA_ADVERTISED_HOST_NAME: kafka + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 web: container_name: posthog_web depends_on: - db - redis + - clickhouse + - kafka environment: DATABASE_URL: postgres://posthog:posthog@db:5432/posthog REDIS_URL: redis://redis:6379/ + KAFKA_URL: 'kafka://kafka' + CLICKHOUSE_HOST: 'clickhouse' + CLICKHOUSE_DATABASE: 'posthog' + CLICKHOUSE_SECURE: 'false' + CLICKHOUSE_VERIFY: 'false' SECRET_KEY: + PGHOST: db + PGUSER: posthog + PGPASSWORD: posthog image: posthog/posthog:latest links: - db:db - redis:redis + - clickhouse:clickhouse + - kafka:kafka ports: - 8000:8000 - 80:8000 diff --git a/ee/clickhouse/middleware.py b/ee/clickhouse/middleware.py index a200c6304b5..ebc077c4ad1 100644 --- a/ee/clickhouse/middleware.py +++ b/ee/clickhouse/middleware.py @@ -4,7 +4,6 @@ from django.urls.base import resolve from loginas.utils import is_impersonated_session from posthog.internal_metrics import incr -from posthog.utils import is_clickhouse_enabled class CHQueries(object): @@ -23,11 +22,7 @@ class CHQueries(object): route = resolve(request.path) route_id = f"{route.route} ({route.func.__name__})" client._request_information = { - "save": ( - is_clickhouse_enabled() - and request.user.pk - and (request.user.is_staff or is_impersonated_session(request) or settings.DEBUG) - ), + "save": (request.user.pk and (request.user.is_staff or is_impersonated_session(request) or settings.DEBUG)), "user_id": request.user.pk, "kind": "request", "id": route_id, diff --git a/ee/clickhouse/models/person.py b/ee/clickhouse/models/person.py index 7fd8bde5bd7..a25e2fc3fe8 100644 --- a/ee/clickhouse/models/person.py +++ b/ee/clickhouse/models/person.py @@ -22,9 +22,8 @@ from ee.kafka_client.topics import KAFKA_PERSON, KAFKA_PERSON_DISTINCT_ID, KAFKA from posthog.models.person import Person, PersonDistinctId from posthog.models.utils import UUIDT from posthog.settings import TEST -from posthog.utils import is_clickhouse_enabled -if is_clickhouse_enabled() and TEST: +if TEST: # :KLUDGE: Hooks are kept around for tests. All other code goes through plugin-server or the other methods explicitly @receiver(post_save, sender=Person) diff --git a/ee/clickhouse/models/test/test_filters.py b/ee/clickhouse/models/test/test_filters.py index 5f42c519564..c93d76e06a3 100644 --- a/ee/clickhouse/models/test/test_filters.py +++ b/ee/clickhouse/models/test/test_filters.py @@ -68,18 +68,6 @@ class TestFilters(PGTestFilters): {"properties": [{"type": "precalculated-cohort", "key": "id", "value": cohort.pk, "operator": None},]}, ) - def test_simplify_not_ee(self): - cohort = Cohort.objects.create( - team=self.team, - groups=[{"properties": [{"key": "email", "operator": "icontains", "value": ".com", "type": "person"}]}], - ) - filter = Filter(data={"properties": [{"type": "cohort", "key": "id", "value": cohort.pk}]}) - - self.assertEqual( - filter.simplify(self.team, is_clickhouse_enabled=False).properties_to_dict(), - {"properties": [{"type": "cohort", "key": "id", "value": cohort.pk, "operator": None}]}, - ) - def test_simplify_static_cohort(self): cohort = Cohort.objects.create(team=self.team, groups=[], is_static=True) filter = Filter(data={"properties": [{"type": "cohort", "key": "id", "value": cohort.pk}]}) diff --git a/ee/clickhouse/queries/funnels/base.py b/ee/clickhouse/queries/funnels/base.py index 1e8b2a57f2e..762296c899a 100644 --- a/ee/clickhouse/queries/funnels/base.py +++ b/ee/clickhouse/queries/funnels/base.py @@ -1,5 +1,5 @@ -import json import urllib.parse +import uuid from abc import ABC from typing import Any, Dict, List, Optional, Tuple, Union, cast @@ -26,11 +26,10 @@ from posthog.constants import ( TREND_FILTER_TYPE_ACTIONS, ) from posthog.models import Entity, Filter, Team -from posthog.queries.funnel import Funnel from posthog.utils import relative_date_parse -class ClickhouseFunnelBase(ABC, Funnel): +class ClickhouseFunnelBase(ABC): _filter: Filter _team: Team _include_timestamp: Optional[bool] @@ -81,6 +80,21 @@ class ClickhouseFunnelBase(ABC, Funnel): results = self._exec_query() return self._format_results(results) + def _serialize_step(self, step: Entity, count: int, people: Optional[List[uuid.UUID]] = None) -> Dict[str, Any]: + if step.type == TREND_FILTER_TYPE_ACTIONS: + name = step.get_action().name + else: + name = step.id + return { + "action_id": step.id, + "name": name, + "custom_name": step.custom_name, + "order": step.order, + "people": people if people else [], + "count": count, + "type": step.type, + } + def _update_filters(self): # format default dates data: Dict[str, Any] = {} diff --git a/ee/clickhouse/queries/trends/test/test_formula.py b/ee/clickhouse/queries/trends/test/test_formula.py index 147ed1c954d..b24831e361e 100644 --- a/ee/clickhouse/queries/trends/test/test_formula.py +++ b/ee/clickhouse/queries/trends/test/test_formula.py @@ -8,7 +8,6 @@ from ee.clickhouse.queries.trends.clickhouse_trends import ClickhouseTrends from posthog.constants import TRENDS_CUMULATIVE, TRENDS_PIE from posthog.models import Cohort, Person from posthog.models.filters.filter import Filter -from posthog.queries.abstract_test.test_interval import AbstractIntervalTest from posthog.test.base import APIBaseTest @@ -17,7 +16,7 @@ def _create_event(**kwargs): create_event(**kwargs) -class TestFormula(AbstractIntervalTest, APIBaseTest): +class TestFormula(APIBaseTest): CLASS_DATA_LEVEL_SETUP = False def setUp(self): diff --git a/ee/conftest.py b/ee/conftest.py index d30c97289d8..41dfdb12620 100644 --- a/ee/conftest.py +++ b/ee/conftest.py @@ -15,7 +15,6 @@ from posthog.settings import ( CLICKHOUSE_VERIFY, ) from posthog.test.base import TestMixin -from posthog.utils import is_clickhouse_enabled def create_clickhouse_tables(num_tables: int): @@ -92,39 +91,37 @@ def reset_clickhouse_tables(): sync_execute(item) -if is_clickhouse_enabled(): +@pytest.fixture(scope="package") +def django_db_setup(django_db_setup, django_db_keepdb): + database = Database( + CLICKHOUSE_DATABASE, + db_url=CLICKHOUSE_HTTP_URL, + username=CLICKHOUSE_USER, + password=CLICKHOUSE_PASSWORD, + verify_ssl_cert=CLICKHOUSE_VERIFY, + ) - @pytest.fixture(scope="package") - def django_db_setup(django_db_setup, django_db_keepdb): - database = Database( - CLICKHOUSE_DATABASE, - db_url=CLICKHOUSE_HTTP_URL, - username=CLICKHOUSE_USER, - password=CLICKHOUSE_PASSWORD, - verify_ssl_cert=CLICKHOUSE_VERIFY, - ) + if not django_db_keepdb: + try: + database.drop_database() + except: + pass - if not django_db_keepdb: - try: - database.drop_database() - except: - pass + database.create_database() # Create database if it doesn't exist + table_count = sync_execute( + "SELECT count() FROM system.tables WHERE database = %(database)s", {"database": CLICKHOUSE_DATABASE} + )[0][0] + create_clickhouse_tables(table_count) - database.create_database() # Create database if it doesn't exist - table_count = sync_execute( - "SELECT count() FROM system.tables WHERE database = %(database)s", {"database": CLICKHOUSE_DATABASE} - )[0][0] - create_clickhouse_tables(table_count) + yield - yield - - if django_db_keepdb: - reset_clickhouse_tables() - else: - try: - database.drop_database() - except: - pass + if django_db_keepdb: + reset_clickhouse_tables() + else: + try: + database.drop_database() + except: + pass @pytest.fixture diff --git a/ee/docker-compose.ch.yml b/ee/docker-compose.ch.yml deleted file mode 100644 index 552549e3cdf..00000000000 --- a/ee/docker-compose.ch.yml +++ /dev/null @@ -1,104 +0,0 @@ -version: '3' - -services: - db: - image: postgres:12-alpine - environment: - POSTGRES_USER: posthog - POSTGRES_DB: posthog - POSTGRES_PASSWORD: posthog - ports: - - '5432:5432' - redis: - image: 'redis:alpine' - ports: - - '6379:6379' - clickhouse: - # KEEP CLICKHOUSE-SERVER VERSION IN SYNC WITH - # https://github.com/PostHog/charts-clickhouse/blob/main/charts/posthog/templates/clickhouse_instance.yaml#L88 - image: yandex/clickhouse-server:21.6.5 - depends_on: - - kafka - - zookeeper - ports: - - '8123:8123' - - '9000:9000' - - '9440:9440' - - '9009:9009' - volumes: - - ./idl:/idl - - ../docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - - ../docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml - - ../docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml - zookeeper: - image: wurstmeister/zookeeper - kafka: - image: wurstmeister/kafka - depends_on: - - zookeeper - ports: - - '9092:9092' - environment: - KAFKA_ADVERTISED_HOST_NAME: kafka - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - worker: &worker - build: - context: ../ - dockerfile: dev.Dockerfile - command: ./bin/docker-worker-celery --with-scheduler - volumes: - - ..:/code - environment: - DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog' - CLICKHOUSE_HOST: 'clickhouse' - CLICKHOUSE_DATABASE: 'posthog' - CLICKHOUSE_SECURE: 'false' - CLICKHOUSE_VERIFY: 'false' - KAFKA_URL: 'kafka://kafka' - REDIS_URL: 'redis://redis:6379/' - SECRET_KEY: 'alsdfjiosdajfklalsdjkf' - DEBUG: 'true' - PRIMARY_DB: 'clickhouse' - PGHOST: db - PGUSER: posthog - PGPASSWORD: posthog - depends_on: - - db - - redis - - clickhouse - - kafka - links: - - db:db - - redis:redis - - clickhouse:clickhouse - - kafka:kafka - web: - <<: *worker - command: '${CH_WEB_SCRIPT:-./ee/bin/docker-ch-dev-web}' - ports: - - '8000:8000' - - '8234:8234' - plugins: - build: - context: ../ - dockerfile: dev.Dockerfile - command: ./bin/plugin-server --no-restart-loop - volumes: - - ..:/code - restart: on-failure - environment: - DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog' - KAFKA_ENABLED: 'true' - KAFKA_HOSTS: 'kafka:9092' - REDIS_URL: 'redis://redis:6379/' - CLICKHOUSE_HOST: 'clickhouse' - depends_on: - - db - - redis - - clickhouse - - kafka - links: - - db:db - - redis:redis - - clickhouse:clickhouse - - kafka:kafka diff --git a/ee/management/commands/setup_test_environment.py b/ee/management/commands/setup_test_environment.py index c3b7e2180d1..8a68fd2d663 100644 --- a/ee/management/commands/setup_test_environment.py +++ b/ee/management/commands/setup_test_environment.py @@ -1,7 +1,5 @@ from django.core.management.base import BaseCommand -from posthog.utils import is_clickhouse_enabled - class Command(BaseCommand): help = "Set up databases for non-Python tests that depend on the Django server" @@ -13,28 +11,27 @@ class Command(BaseCommand): test_runner.setup_databases() test_runner.setup_test_environment() - if is_clickhouse_enabled(): - from infi.clickhouse_orm import Database + from infi.clickhouse_orm import Database - from posthog.settings import ( - CLICKHOUSE_DATABASE, - CLICKHOUSE_HTTP_URL, - CLICKHOUSE_PASSWORD, - CLICKHOUSE_REPLICATION, - CLICKHOUSE_USER, - CLICKHOUSE_VERIFY, - ) + from posthog.settings import ( + CLICKHOUSE_DATABASE, + CLICKHOUSE_HTTP_URL, + CLICKHOUSE_PASSWORD, + CLICKHOUSE_REPLICATION, + CLICKHOUSE_USER, + CLICKHOUSE_VERIFY, + ) - database = Database( - CLICKHOUSE_DATABASE, - db_url=CLICKHOUSE_HTTP_URL, - username=CLICKHOUSE_USER, - password=CLICKHOUSE_PASSWORD, - verify_ssl_cert=CLICKHOUSE_VERIFY, - ) + database = Database( + CLICKHOUSE_DATABASE, + db_url=CLICKHOUSE_HTTP_URL, + username=CLICKHOUSE_USER, + password=CLICKHOUSE_PASSWORD, + verify_ssl_cert=CLICKHOUSE_VERIFY, + ) - try: - database.create_database() - except: - pass - database.migrate("ee.clickhouse.migrations", replicated=CLICKHOUSE_REPLICATION) + try: + database.create_database() + except: + pass + database.migrate("ee.clickhouse.migrations", replicated=CLICKHOUSE_REPLICATION) diff --git a/ee/tasks/test/test_org_usage_report.py b/ee/tasks/test/test_org_usage_report.py index 273596255d9..006e1efd324 100644 --- a/ee/tasks/test/test_org_usage_report.py +++ b/ee/tasks/test/test_org_usage_report.py @@ -30,7 +30,7 @@ def create_event_clickhouse( ) -class TestOrganizationUsageReport(ClickhouseTestMixin, factory_org_usage_report(create_person, create_event_clickhouse, send_all_org_usage_reports, {"EE_AVAILABLE": True, "USE_TZ": False, "PRIMARY_DB": AnalyticsDBMS.CLICKHOUSE})): # type: ignore +class TestOrganizationUsageReport(ClickhouseTestMixin, factory_org_usage_report(create_person, create_event_clickhouse, send_all_org_usage_reports, {"USE_TZ": False, "PRIMARY_DB": AnalyticsDBMS.CLICKHOUSE})): # type: ignore def test_groups_usage(self): GroupTypeMapping.objects.create(team=self.team, group_type="organization", group_type_index=0) GroupTypeMapping.objects.create(team=self.team, group_type="company", group_type_index=1) diff --git a/frontend/src/layout/navigation/__stories__/navigation.initial.json b/frontend/src/layout/navigation/__stories__/navigation.initial.json index 62889cd0131..735f4507d8b 100644 --- a/frontend/src/layout/navigation/__stories__/navigation.initial.json +++ b/frontend/src/layout/navigation/__stories__/navigation.initial.json @@ -106,7 +106,6 @@ }, "can_create_org": false, "ee_available": true, - "is_clickhouse_enabled": false, "db_backend": "postgres", "available_timezones": {}, "opt_out_capture": false, diff --git a/frontend/src/lib/api.mock.ts b/frontend/src/lib/api.mock.ts index 43f6c874a17..172524290b6 100644 --- a/frontend/src/lib/api.mock.ts +++ b/frontend/src/lib/api.mock.ts @@ -77,7 +77,7 @@ export const mockAPI = ( export function defaultAPIMocks({ pathname, searchParams }: APIRoute, availableFeatures: AvailableFeature[] = []): any { const organization = { ...MOCK_DEFAULT_ORGANIZATION, available_features: availableFeatures } if (pathname === '_preflight/') { - return { is_clickhouse_enabled: true } + return {} } else if (pathname === 'api/users/@me/') { return { organization, diff --git a/frontend/src/lib/components/ChartFilter/ChartFilter.tsx b/frontend/src/lib/components/ChartFilter/ChartFilter.tsx index c9786ae3322..896ba2ad283 100644 --- a/frontend/src/lib/components/ChartFilter/ChartFilter.tsx +++ b/frontend/src/lib/components/ChartFilter/ChartFilter.tsx @@ -11,7 +11,6 @@ import { TableOutlined, } from '@ant-design/icons' import { ChartDisplayType, FilterType, FunnelVizType, InsightType } from '~/types' -import { preflightLogic } from 'scenes/PreflightCheck/logic' import { ANTD_TOOLTIP_PLACEMENTS } from 'lib/utils' import { insightLogic } from 'scenes/insights/insightLogic' @@ -25,7 +24,6 @@ export function ChartFilter({ filters, onChange, disabled }: ChartFilterProps): const { insightProps } = useValues(insightLogic) const { chartFilter } = useValues(chartFilterLogic(insightProps)) const { setChartFilter } = useActions(chartFilterLogic(insightProps)) - const { preflight } = useValues(preflightLogic) const cumulativeDisabled = filters.insight === InsightType.STICKINESS || filters.insight === InsightType.RETENTION const tableDisabled = false @@ -58,28 +56,21 @@ export function ChartFilter({ filters, onChange, disabled }: ChartFilterProps): const options = filters.insight === InsightType.FUNNELS - ? preflight?.is_clickhouse_enabled - ? [ - { - value: FunnelVizType.Steps, - label: , - }, - { - value: FunnelVizType.Trends, - label: ( - - ), - }, - ] - : [ - { - value: FunnelVizType.Steps, - label: , - }, - ] + ? [ + { + value: FunnelVizType.Steps, + label: , + }, + { + value: FunnelVizType.Trends, + label: ( + + ), + }, + ] : [ { label: 'Line Chart', diff --git a/frontend/src/lib/introductions/groupsAccessLogic.ts b/frontend/src/lib/introductions/groupsAccessLogic.ts index 47948e27740..9eacd803421 100644 --- a/frontend/src/lib/introductions/groupsAccessLogic.ts +++ b/frontend/src/lib/introductions/groupsAccessLogic.ts @@ -20,24 +20,22 @@ export const groupsAccessLogic = kea>( teamLogic, ['currentTeam'], preflightLogic, - ['clickhouseEnabled', 'preflight'], + ['preflight'], userLogic, ['hasAvailableFeature', 'upgradeLink'], ], }, selectors: { - groupsCanBeEnabled: [(s) => [s.clickhouseEnabled], (clickhouseEnabled) => clickhouseEnabled], groupsEnabled: [ - (s) => [s.groupsCanBeEnabled, s.hasAvailableFeature], - (groupsCanBeEnabled, hasAvailableFeature) => - groupsCanBeEnabled && hasAvailableFeature(AvailableFeature.GROUP_ANALYTICS), + (s) => [s.hasAvailableFeature], + (hasAvailableFeature) => hasAvailableFeature(AvailableFeature.GROUP_ANALYTICS), ], // Used to toggle various introduction views related to groups groupsAccessStatus: [ - (s) => [s.groupsCanBeEnabled, s.groupsEnabled, s.currentTeam, s.preflight], - (canBeEnabled, isEnabled, currentTeam, preflight): GroupsAccessStatus => { + (s) => [s.groupsEnabled, s.currentTeam, s.preflight], + (isEnabled, currentTeam, preflight): GroupsAccessStatus => { const hasGroups = currentTeam?.has_group_types - if (!canBeEnabled || preflight?.instance_preferences?.disable_paid_fs) { + if (preflight?.instance_preferences?.disable_paid_fs) { return GroupsAccessStatus.Hidden } else if (isEnabled && hasGroups) { return GroupsAccessStatus.AlreadyUsing diff --git a/frontend/src/scenes/PreflightCheck/logic.ts b/frontend/src/scenes/PreflightCheck/logic.ts index c5df5527128..680835d900c 100644 --- a/frontend/src/scenes/PreflightCheck/logic.ts +++ b/frontend/src/scenes/PreflightCheck/logic.ts @@ -35,7 +35,6 @@ export const preflightLogic = kea>({ (preflight): boolean => Boolean(preflight && Object.values(preflight.available_social_auth_providers).filter((i) => i).length), ], - clickhouseEnabled: [(s) => [s.preflight], (preflight): boolean => !!preflight?.is_clickhouse_enabled], realm: [ (s) => [s.preflight], (preflight): Realm | null => { @@ -82,8 +81,6 @@ export const preflightLogic = kea>({ posthog.register({ posthog_version: values.preflight.posthog_version, realm: values.realm, - is_clickhouse_enabled: values.preflight.is_clickhouse_enabled, - ee_available: values.preflight.ee_available, email_service_available: values.preflight.email_service_available, }) diff --git a/frontend/src/scenes/actions/Action.tsx b/frontend/src/scenes/actions/Action.tsx index 2ddec5e8617..7a2c62de2dd 100644 --- a/frontend/src/scenes/actions/Action.tsx +++ b/frontend/src/scenes/actions/Action.tsx @@ -5,7 +5,6 @@ import { router } from 'kea-router' import { eventsTableLogic } from 'scenes/events/eventsTableLogic' import { EventsTable } from 'scenes/events' import { urls } from 'scenes/urls' -import { preflightLogic } from 'scenes/PreflightCheck/logic' import { ActionType } from '~/types' import { dayjs } from 'lib/dayjs' import { Spinner } from 'lib/components/Spinner/Spinner' @@ -33,8 +32,6 @@ export function Action({ id }: { id?: ActionType['id'] } = {}): JSX.Element { ) const { action, isComplete } = useValues(actionLogic({ id, onComplete: fetchEvents })) const { loadAction } = useActions(actionLogic({ id, onComplete: fetchEvents })) - const { preflight } = useValues(preflightLogic) - const isClickHouseEnabled = !!preflight?.is_clickhouse_enabled return (
@@ -61,25 +58,23 @@ export function Action({ id }: { id?: ActionType['id'] } = {}): JSX.Element { )} {isComplete && (
- {!isClickHouseEnabled ? ( - <> -

Event List

-

- List of the events that match this action.{' '} - {action && ( - <> - This list was{' '} - - calculated{' '} - {action.last_calculated_at - ? dayjs(action.last_calculated_at).fromNow() - : 'a while ago'} - - - )} -

{' '} - - ) : null} + <> +

Event List

+

+ List of the events that match this action.{' '} + {action && ( + <> + This list was{' '} + + calculated{' '} + {action.last_calculated_at + ? dayjs(action.last_calculated_at).fromNow() + : 'a while ago'} + + + )} +

{' '} + {id && ( <> @@ -21,13 +18,11 @@ export function CohortDetailsRow({ cohort }: { cohort: CohortType }): JSX.Elemen
- {!preflight?.is_clickhouse_enabled && ( - - + + -
{cohort.last_calculation ? dayjs(cohort.last_calculation).fromNow() : 'in progress'}
- - )} +
{cohort.last_calculation ? dayjs(cohort.last_calculation).fromNow() : 'in progress'}
+ ) } diff --git a/frontend/src/scenes/cohorts/CohortMatchingCriteriaSection/MatchCriteriaSelector.tsx b/frontend/src/scenes/cohorts/CohortMatchingCriteriaSection/MatchCriteriaSelector.tsx index ab437eb5317..085633def96 100644 --- a/frontend/src/scenes/cohorts/CohortMatchingCriteriaSection/MatchCriteriaSelector.tsx +++ b/frontend/src/scenes/cohorts/CohortMatchingCriteriaSection/MatchCriteriaSelector.tsx @@ -8,8 +8,6 @@ import { ACTION_TYPE, ENTITY_MATCH_TYPE, EVENT_TYPE, PROPERTY_MATCH_TYPE } from import { PropertyFilters } from 'lib/components/PropertyFilters/PropertyFilters' import { DeleteOutlined } from '@ant-design/icons' import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types' -import { useValues } from 'kea' -import { preflightLogic } from 'scenes/PreflightCheck/logic' const { Option } = Select @@ -155,9 +153,6 @@ function EntityCriteriaRow({ setOpen(false) } - const { preflight } = useValues(preflightLogic) - const COUNT_ENABLED = preflight?.is_clickhouse_enabled - return (
@@ -177,24 +172,20 @@ function EntityCriteriaRow({ - {COUNT_ENABLED && ( - <> - - - - - onEntityCountChange(parseInt(e.target.value))} - placeholder="1" - type="number" - /> - - - )} - {COUNT_ENABLED && 'times '}in the last + + + + + onEntityCountChange(parseInt(e.target.value))} + placeholder="1" + type="number" + /> + + times in the last diff --git a/frontend/src/scenes/dashboard/__stories__/dashboard.json b/frontend/src/scenes/dashboard/__stories__/dashboard.json index 6253bb69d15..3aec913d1cb 100644 --- a/frontend/src/scenes/dashboard/__stories__/dashboard.json +++ b/frontend/src/scenes/dashboard/__stories__/dashboard.json @@ -239,7 +239,6 @@ "can_create_org": false, "email_service_available": false, "ee_available": true, - "is_clickhouse_enabled": true, "db_backend": "clickhouse", "available_timezones": { "Africa/Abidjan": 0, @@ -3234,7 +3233,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -3359,7 +3357,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -3630,7 +3627,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -3778,7 +3774,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -3907,7 +3902,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -4038,7 +4032,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -4163,7 +4156,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -4462,7 +4454,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -4895,7 +4886,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -5041,7 +5031,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -5170,7 +5159,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -5297,7 +5285,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -5422,7 +5409,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -5549,7 +5535,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -5676,7 +5661,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -5803,7 +5787,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -5928,7 +5911,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -6054,7 +6036,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -6334,7 +6315,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -6576,7 +6556,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -6701,7 +6680,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -6989,7 +6967,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -7118,7 +7095,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -7243,7 +7219,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -7653,7 +7628,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -7778,7 +7752,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -8066,7 +8039,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -8192,7 +8164,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -8317,7 +8288,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -8651,7 +8621,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -8777,7 +8746,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -8902,7 +8870,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -9235,7 +9202,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -9360,7 +9326,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -9485,7 +9450,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -9612,7 +9576,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -9739,7 +9702,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -9891,7 +9853,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -10035,7 +9996,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -10160,7 +10120,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -10301,7 +10260,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -10426,7 +10384,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -10551,7 +10508,6 @@ "is_demo_project": true, "posthog_version": "1.29.1", "realm": "hosted-clickhouse", - "is_clickhouse_enabled": true, "ee_available": true, "email_service_available": false, "$active_feature_flags": [ @@ -18402,16 +18358,6 @@ "updated_by": null, "query_usage_30_day": 0 }, - { - "id": "017989da-7571-0001-bc1f-c48306dd7a5e", - "name": "is_clickhouse_enabled", - "description": null, - "tags": null, - "is_numerical": false, - "updated_at": null, - "updated_by": null, - "query_usage_30_day": null - }, { "id": "01791516-32bb-0000-4094-b9829f5f9651", "name": "is_demo_project", diff --git a/frontend/src/scenes/events/__stories__/events.json b/frontend/src/scenes/events/__stories__/events.json index 68109564e24..9ed1eb6ce47 100644 --- a/frontend/src/scenes/events/__stories__/events.json +++ b/frontend/src/scenes/events/__stories__/events.json @@ -104,7 +104,6 @@ }, "can_create_org": false, "ee_available": true, - "is_clickhouse_enabled": false, "db_backend": "postgres", "available_timezones": { "Africa/Abidjan": 0, @@ -854,7 +853,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -1057,7 +1055,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -1144,7 +1141,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -1233,7 +1229,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -1469,7 +1464,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -1684,7 +1678,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -1788,7 +1781,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -1885,7 +1877,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -1972,7 +1963,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -2059,7 +2049,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -2146,7 +2135,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -2235,7 +2223,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -2505,7 +2492,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -2607,7 +2593,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -2703,7 +2688,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -2790,7 +2774,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -2879,7 +2862,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -3168,7 +3150,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -3264,7 +3245,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -3351,7 +3331,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -3438,7 +3417,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -3527,7 +3505,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -3817,7 +3794,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -3920,7 +3896,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -4016,7 +3991,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -4103,7 +4077,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -4192,7 +4165,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -4494,7 +4466,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -4597,7 +4568,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -4693,7 +4663,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -4780,7 +4749,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -4867,7 +4835,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -4954,7 +4921,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -5043,7 +5009,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -5239,7 +5204,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -5539,7 +5503,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -5642,7 +5605,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": true, "$geoip_subdivision_1_code": "NSW", @@ -5738,7 +5700,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -5825,7 +5786,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -5913,7 +5873,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -6002,7 +5961,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -6091,7 +6049,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": true, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -6180,7 +6137,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -6269,7 +6225,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -6358,7 +6313,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -6447,7 +6401,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -6598,7 +6551,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -6695,7 +6647,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "phjs-xhr-response-200": 7, "phjs-batch-requests-e/": 4, "email_service_available": false, @@ -6787,7 +6738,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -6885,7 +6835,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -6981,7 +6930,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -7069,7 +7017,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -7157,7 +7104,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -7244,7 +7190,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -7333,7 +7278,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -7615,7 +7559,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -7713,7 +7656,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -7805,7 +7747,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -7892,7 +7833,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -7981,7 +7921,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -8282,7 +8221,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -8378,7 +8316,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -8475,7 +8412,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": true, "$geoip_subdivision_1_code": "NSW", @@ -8567,7 +8503,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -8655,7 +8590,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -8744,7 +8678,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": true, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -8833,7 +8766,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -8922,7 +8854,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -9011,7 +8942,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -9100,7 +9030,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -9251,7 +9180,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -9348,7 +9276,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "phjs-xhr-response-200": 7, "phjs-batch-requests-e/": 4, "email_service_available": false, @@ -9440,7 +9367,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -9538,7 +9464,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -9640,7 +9565,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -9736,7 +9660,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -9823,7 +9746,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -9912,7 +9834,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -10216,7 +10137,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -10320,7 +10240,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": false, "$geoip_subdivision_1_code": "NSW", @@ -10417,7 +10336,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -10504,7 +10422,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -10591,7 +10508,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -10678,7 +10594,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -10767,7 +10682,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -11063,7 +10977,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -11161,7 +11074,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "is_first_component_load": true, "$geoip_subdivision_1_code": "NSW", @@ -11253,7 +11165,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -11341,7 +11252,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -11430,7 +11340,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -11519,7 +11428,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": true, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -11608,7 +11516,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -11697,7 +11604,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -11786,7 +11692,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -11875,7 +11780,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -11963,7 +11867,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -12118,7 +12021,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -12206,7 +12108,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "$feature_flag_response": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", @@ -12294,7 +12195,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -12383,7 +12283,6 @@ "$active_feature_flags": ["4050-query-ui-optB"], "$geoip_continent_code": "OC", "$geoip_continent_name": "Oceania", - "is_clickhouse_enabled": false, "email_service_available": false, "$geoip_subdivision_1_code": "NSW", "$geoip_subdivision_1_name": "New South Wales", @@ -14023,12 +13922,6 @@ "is_numerical": false, "query_usage_30_day": null }, - { - "id": "0179fcb6-f7fa-0000-c78a-c7b289c94008", - "name": "is_clickhouse_enabled", - "is_numerical": false, - "query_usage_30_day": null - }, { "id": "0179fcb6-f7d6-0000-2314-06df9faddf58", "name": "is_demo_project", diff --git a/frontend/src/scenes/funnels/FunnelBarGraph.tsx b/frontend/src/scenes/funnels/FunnelBarGraph.tsx index f7f3d61cdb4..5e0fbdd58cf 100644 --- a/frontend/src/scenes/funnels/FunnelBarGraph.tsx +++ b/frontend/src/scenes/funnels/FunnelBarGraph.tsx @@ -85,9 +85,7 @@ function Bar({ const [labelPosition, setLabelPosition] = useState('inside') const [labelVisible, setLabelVisible] = useState(true) const LABEL_POSITION_OFFSET = 8 // Defined here and in SCSS - const { insightProps } = useValues(insightLogic) - const { clickhouseFeaturesEnabled } = useValues(funnelLogic(insightProps)) - const cursorType = clickhouseFeaturesEnabled && !disabled ? 'pointer' : '' + const cursorType = !disabled ? 'pointer' : '' const hasBreakdownSum = isBreakdown && typeof breakdownSumPercentage === 'number' const shouldShowLabel = !isBreakdown || (hasBreakdownSum && labelVisible) @@ -146,7 +144,7 @@ function Bar({ backgroundColor: getSeriesColor(breakdownIndex), }} onClick={() => { - if (clickhouseFeaturesEnabled && !disabled && onBarClick) { + if (!disabled && onBarClick) { onBarClick() } }} @@ -296,7 +294,6 @@ export function FunnelBarGraph({ color = 'white' }: { color?: string }): JSX.Ele visibleStepsWithConversionMetrics: steps, stepReference, barGraphLayout: layout, - clickhouseFeaturesEnabled, aggregationTargetLabel, isModalActive, } = useValues(logic) @@ -361,8 +358,7 @@ export function FunnelBarGraph({ color = 'white' }: { color?: string }): JSX.Ele )}
- {clickhouseFeaturesEnabled && - filters.funnel_order_type !== StepOrderValue.UNORDERED && + {filters.funnel_order_type !== StepOrderValue.UNORDERED && stepIndex > 0 && step.action_id === steps[stepIndex - 1].action_id && } @@ -479,9 +475,7 @@ export function FunnelBarGraph({ color = 'white' }: { color?: string }): JSX.Ele onClick={() => openPersonsModalForStep({ step, converted: false })} // dropoff value for steps is negative style={{ flex: `${1 - breakdownSum / basisStep.count} 1 0`, - cursor: `${ - clickhouseFeaturesEnabled && !dashboardItemId ? 'pointer' : '' - }`, + cursor: `${!dashboardItemId ? 'pointer' : ''}`, }} /> @@ -546,9 +540,7 @@ export function FunnelBarGraph({ color = 'white' }: { color?: string }): JSX.Ele onClick={() => openPersonsModalForStep({ step, converted: false })} // dropoff value for steps is negative style={{ flex: `${1 - step.conversionRates.fromBasisStep} 1 0`, - cursor: `${ - clickhouseFeaturesEnabled && !dashboardItemId ? 'pointer' : '' - }`, + cursor: `${!dashboardItemId ? 'pointer' : ''}`, }} /> diff --git a/frontend/src/scenes/funnels/FunnelCanvasLabel.tsx b/frontend/src/scenes/funnels/FunnelCanvasLabel.tsx index a80b889125a..07fe2d387a0 100644 --- a/frontend/src/scenes/funnels/FunnelCanvasLabel.tsx +++ b/frontend/src/scenes/funnels/FunnelCanvasLabel.tsx @@ -15,9 +15,7 @@ import { FunnelStepsPicker } from 'scenes/insights/InsightTabs/FunnelTab/FunnelS export function FunnelCanvasLabel(): JSX.Element | null { const { insightProps, filters, activeView } = useValues(insightLogic) - const { conversionMetrics, clickhouseFeaturesEnabled, aggregationTargetLabel } = useValues( - funnelLogic(insightProps) - ) + const { conversionMetrics, aggregationTargetLabel } = useValues(funnelLogic(insightProps)) const { setChartFilter } = useActions(chartFilterLogic(insightProps)) if (activeView !== InsightType.FUNNELS) { @@ -57,9 +55,7 @@ export function FunnelCanvasLabel(): JSX.Element | null { diff --git a/frontend/src/scenes/funnels/funnelLogic.test.ts b/frontend/src/scenes/funnels/funnelLogic.test.ts index 23a360c808a..409c487cb93 100644 --- a/frontend/src/scenes/funnels/funnelLogic.test.ts +++ b/frontend/src/scenes/funnels/funnelLogic.test.ts @@ -249,18 +249,6 @@ describe('funnelLogic', () => { await expectLogic(preflightLogic).toDispatchActions(['loadPreflightSuccess']) }) - it('has clickhouse enabled once preflight loads', async () => { - await expectLogic() - .toDispatchActions(preflightLogic, ['loadPreflight']) - .toMatchValues(logic, { - clickhouseFeaturesEnabled: false, - }) - .toDispatchActions(preflightLogic, ['loadPreflightSuccess']) - .toMatchValues(logic, { - clickhouseFeaturesEnabled: true, - }) - }) - it('sets filters after load if valid', async () => { await expectLogic(logic) .toDispatchActions(['loadResults']) @@ -979,11 +967,6 @@ describe('funnelLogic', () => { }) describe('is modal active', () => { - it('modal is inactive when clickhouse is not enabled', async () => { - await expectLogic().toDispatchActions(preflightLogic, ['loadPreflight']).toMatchValues(logic, { - isModalActive: false, - }) - }) it('modal is inactive when viewed on dashboard', async () => { await expectLogic(preflightLogic).toDispatchActions(['loadPreflightSuccess']) await router.actions.push(urls.dashboard('1')) diff --git a/frontend/src/scenes/funnels/funnelLogic.ts b/frontend/src/scenes/funnels/funnelLogic.ts index 50f1a77e051..c611601d566 100644 --- a/frontend/src/scenes/funnels/funnelLogic.ts +++ b/frontend/src/scenes/funnels/funnelLogic.ts @@ -37,7 +37,7 @@ import { TrendResult, } from '~/types' import { BinCountAuto, FEATURE_FLAGS, FunnelLayout } from 'lib/constants' -import { preflightLogic } from 'scenes/PreflightCheck/logic' + import { aggregateBreakdownResult, formatDisplayPercentage, @@ -485,11 +485,6 @@ export const funnelLogic = kea>({ (filters, lastFilters): boolean => !equal(cleanFilters(filters), cleanFilters(lastFilters)), ], barGraphLayout: [() => [selectors.filters], ({ layout }): FunnelLayout => layout || FunnelLayout.vertical], - clickhouseFeaturesEnabled: [ - () => [preflightLogic.selectors.preflight], - // Controls auto-calculation of results and ability to break down values - (preflight): boolean => !!preflight?.is_clickhouse_enabled, - ], histogramGraphData: [ () => [selectors.timeConversionResults], (timeConversionResults: FunnelsTimeConversionBins) => { @@ -1043,9 +1038,8 @@ export const funnelLogic = kea>({ }, ], correlationAnalysisAvailable: [ - (s) => [s.hasAvailableFeature, s.clickhouseFeaturesEnabled], - (hasAvailableFeature, clickhouseFeaturesEnabled): boolean => - clickhouseFeaturesEnabled && hasAvailableFeature(AvailableFeature.CORRELATION_ANALYSIS), + (s) => [s.hasAvailableFeature], + (hasAvailableFeature): boolean => hasAvailableFeature(AvailableFeature.CORRELATION_ANALYSIS), ], allProperties: [ (s) => [s.inversePropertyNames, s.excludedPropertyNames], @@ -1136,10 +1130,7 @@ export const funnelLogic = kea>({ return count }, ], - isModalActive: [ - (s) => [s.clickhouseFeaturesEnabled, s.isViewedOnDashboard], - (clickhouseFeaturesEnabled, isViewedOnDashboard) => clickhouseFeaturesEnabled && !isViewedOnDashboard, - ], + isModalActive: [(s) => [s.isViewedOnDashboard], (isViewedOnDashboard) => !isViewedOnDashboard], incompletenessOffsetFromEnd: [ (s) => [s.steps, s.conversionWindow], (steps, conversionWindow) => { @@ -1174,13 +1165,6 @@ export const funnelLogic = kea>({ }) }) - // load the old people table - if (!values.clickhouseFeaturesEnabled) { - if ((values.stepsWithCount[0]?.people?.length ?? 0) > 0) { - actions.loadPeople(values.stepsWithCount) - } - } - // load correlation table after funnel. Maybe parallel? if ( values.correlationAnalysisAvailable && diff --git a/frontend/src/scenes/ingestion/__stories__/ingestion.json b/frontend/src/scenes/ingestion/__stories__/ingestion.json index 7010468e1df..ad32508ddad 100644 --- a/frontend/src/scenes/ingestion/__stories__/ingestion.json +++ b/frontend/src/scenes/ingestion/__stories__/ingestion.json @@ -95,7 +95,6 @@ }, "can_create_org": false, "ee_available": true, - "is_clickhouse_enabled": false, "db_backend": "postgres", "available_timezones": { "Africa/Abidjan": 0, diff --git a/frontend/src/scenes/insights/ActionFilter/ActionFilterRow/ActionFilterRow.tsx b/frontend/src/scenes/insights/ActionFilter/ActionFilterRow/ActionFilterRow.tsx index feb791b081a..766a64b7926 100644 --- a/frontend/src/scenes/insights/ActionFilter/ActionFilterRow/ActionFilterRow.tsx +++ b/frontend/src/scenes/insights/ActionFilter/ActionFilterRow/ActionFilterRow.tsx @@ -23,7 +23,6 @@ import { } from '@ant-design/icons' import { SelectGradientOverflow } from 'lib/components/SelectGradientOverflow' import { BareEntity, entityFilterLogic } from '../entityFilterLogic' -import { preflightLogic } from 'scenes/PreflightCheck/logic' import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel' import { getEventNamesForAction, pluralize } from 'lib/utils' import { SeriesGlyph, SeriesLetter } from 'lib/components/SeriesGlyph' @@ -471,14 +470,9 @@ function MathSelector({ const numericalNotice = `This can only be used on properties that have at least one number type occurence in your events.${ areEventPropertiesNumericalAvailable ? '' : ' None have been found yet!' }` - const { preflight } = useValues(preflightLogic) const { eventMathEntries, propertyMathEntries } = useValues(mathsLogic) - let math_entries = eventMathEntries - - if (!preflight?.is_clickhouse_enabled) { - math_entries = math_entries.filter((item) => item[0] !== 'weekly_active' && item[0] !== 'monthly_active') - } + const math_entries = eventMathEntries return (