:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore: update stale source paths in posthog backend comments (#115083)
Paul D'Ambra239091e0e739
diff --git a/bin/send-dev-metrics.sh b/bin/send-dev-metrics.shindex 7fb0c390cb1b..1ebd2f14c2ff 100755--- a/bin/send-dev-metrics.sh+++ b/bin/send-dev-metrics.sh@@ -1,6 +1,6 @@#!/usr/bin/env bash# Smoke-test the metrics ingest chain by POSTing a synthetic OTLP payload to-# capture-apm-metrics. Same shape as nodejs/src/logs-ingestion/sampling-seed-services-curl.sh.+# capture-apm-metrics. Same shape as nodejs/src/logs/sampling-seed-services-curl.sh.## Usage:# # Local dev (default — same path logs scripts use):diff --git a/posthog/api/dead_letter_queue.py b/posthog/api/dead_letter_queue.pyindex 8caf92d2accb..2230e9ce4fef 100644--- a/posthog/api/dead_letter_queue.py+++ b/posthog/api/dead_letter_queue.py@@ -8,7 +8,7 @@ from posthog.clickhouse.client import sync_executefrom posthog.permissions import IsStaffUserfrom posthog.utils import relative_date_parse-# keep in sync with posthog/frontend/src/scenes/instance/DeadLetterQueue/MetricsTab.tsx+# keep in sync with frontend/src/scenes/instance/DeadLetterQueue/MetricsTab.tsxROWS_LIMIT = 10DEAD_LETTER_QUEUE_METRICS = {diff --git a/posthog/api/test/test_utils.py b/posthog/api/test/test_utils.pyindex c741976f975b..84b3b7b8c9cc 100644--- a/posthog/api/test/test_utils.py+++ b/posthog/api/test/test_utils.py@@ -142,7 +142,7 @@ class TestUtils(BaseTest):assert query == "(id = ANY (%(named_key)s::uuid[]))"assert ids == ordered_expected_ids- # keep in sync with posthog/plugin-server/tests/utils.test.ts::safeClickhouseString+ # keep in sync with nodejs/tests/utils.test.ts::safeClickhouseStringdef test_safe_clickhouse_string_valid_strings(self):valid_strings = ["$autocapture",@@ -168,21 +168,21 @@ class TestUtils(BaseTest):for s in valid_strings:self.assertEqual(safe_clickhouse_string(s), s)- # keep in sync with posthog/plugin-server/tests/utils.test.ts::safeClickhouseString+ # keep in sync with nodejs/tests/utils.test.ts::safeClickhouseStringdef test_safe_clickhouse_string_surrogates(self):# flake8: noqaself.assertEqual(safe_clickhouse_string("foo \ud83d\ bar"), "foo \\ud83d\\ bar")self.assertEqual(safe_clickhouse_string("\ud83d\ bar"), "\\ud83d\\ bar")self.assertEqual(safe_clickhouse_string("\ud800\ \ud803\ "), "\\ud800\\ \\ud803\\ ")- # keep in sync with posthog/plugin-server/tests/utils.test.ts::safeClickhouseString+ # keep in sync with nodejs/tests/utils.test.ts::safeClickhouseStringdef test_safe_clickhouse_string_unicode_non_surrogates(self):self.assertEqual(safe_clickhouse_string("✨"), "✨")self.assertEqual(safe_clickhouse_string("foo \u2728\ bar"), "foo \u2728\ bar")self.assertEqual(safe_clickhouse_string("💜 \u1f49c\ 💜"), "💜 \u1f49c\ 💜")def test_raise_if_user_provided_url_unsafe(self):- # Sync test cases with plugin-server/src/utils/fetch.test.ts+ # Sync test cases with nodejs/src/common/utils/request.test.tsraise_if_user_provided_url_unsafe("https://google.com?q=20") # Saferaise_if_user_provided_url_unsafe("https://posthog.com") # Saferaise_if_user_provided_url_unsafe("https://posthog.com/foo/bar") # Safe, with pathdiff --git a/posthog/api/utils.py b/posthog/api/utils.pyindex 4eb91241258b..9e63cd18d430 100644--- a/posthog/api/utils.py+++ b/posthog/api/utils.py@@ -234,7 +234,7 @@ SURROGATES_SUBSTITUTED_COUNTER = Counter()-# keep in sync with posthog/plugin-server/src/utils/db/utils.ts::safeClickhouseString+# keep in sync with nodejs/src/common/utils/db/utils.ts::safeClickhouseStringdef safe_clickhouse_string(s: str, with_counter=True) -> str:matches = SURROGATE_REGEX.findall(s or "")for match in matches:diff --git a/posthog/clickhouse/preaggregation/experiment_exposures_sql.py b/posthog/clickhouse/preaggregation/experiment_exposures_sql.pyindex fc019e58cac5..670b43a69e40 100644--- a/posthog/clickhouse/preaggregation/experiment_exposures_sql.py+++ b/posthog/clickhouse/preaggregation/experiment_exposures_sql.py@@ -4,7 +4,7 @@# who was exposed to which variant, we compute this once and store it here.# Subsequent queries read from this table instead of scanning events.#-# See posthog/hogql_queries/experiments/PREAGGREGATION.md for details.+# See products/experiments/backend/hogql_queries/LAZY_COMPUTATION.md for details.from posthog.clickhouse.table_engines import Distributed, ReplacingMergeTree, ReplicationSchemediff --git a/posthog/cloud_utils.py b/posthog/cloud_utils.pyindex 24bf38161634..79edde8ecb7c 100644--- a/posthog/cloud_utils.py+++ b/posthog/cloud_utils.py@@ -27,7 +27,7 @@ def _run_mode() -> RunMode:return derive_run_mode(settings.CLOUD_DEPLOYMENT, settings.DEBUG)-# Keep this in sync with isCloud() in nodejs/src/utils/env-utils.ts.+# Keep this in sync with isCloud() in nodejs/src/common/utils/env-utils.ts.# "dev" refers to the hosted development environment, not local development (which is "local").def is_cloud() -> bool:return _run_mode().is_clouddiff --git a/posthog/dags/person_property_reconciliation.py b/posthog/dags/person_property_reconciliation.pyindex 8d814918f95a..1a948d145257 100644--- a/posthog/dags/person_property_reconciliation.py+++ b/posthog/dags/person_property_reconciliation.py@@ -100,7 +100,7 @@ class SkipReason:# Properties that should NOT trigger a person update on their own.# These change frequently but aren't valuable enough to update the person record for.-# Keep in sync with: nodejs/src/worker/ingestion/persons/person-property-utils.ts+# Keep in sync with: nodejs/src/common/persons/person-property-utils.tsFILTERED_PERSON_UPDATE_PROPERTIES = frozenset([# URL/navigation properties - change on every page viewdiff --git a/posthog/kafka_client/topics.py b/posthog/kafka_client/topics.pyindex fb59f00a966f..5a1bcd67d5b7 100644--- a/posthog/kafka_client/topics.py+++ b/posthog/kafka_client/topics.py@@ -1,4 +1,4 @@-# Keep this in sync with plugin-server/src/config/kafka-topics.ts+# Keep this in sync with nodejs/src/common/config/kafka-topics.tsfrom posthog.settings.data_stores import SUFFIXfrom posthog.settings.kafka import KAFKA_PREFIXdiff --git a/posthog/models/integration_repository_cache.py b/posthog/models/integration_repository_cache.pyindex 8c3c7ccb5338..00fec6172749 100644--- a/posthog/models/integration_repository_cache.py+++ b/posthog/models/integration_repository_cache.py@@ -172,7 +172,7 @@ class GitHubRepositoryFullCache:"""Pure-network: repo metadata + default-branch SHA. No DB I/O when token is fresh."""repo_data = self.github._gh_api_get(f"/repos/{owner}/{repo}", endpoint="/repos/{owner}/{repo}")default_branch = repo_data.get("default_branch") or "main"- # Quote the ref so branches like `release/1.0` hit the right endpoint (precedent: products/visual_review/backend/logic.py).+ # Quote the ref so branches like `release/1.0` hit the right endpoint (precedent: products/visual_review/backend/logic/github_api.py).branch_data = self.github._gh_api_get(f"/repos/{owner}/{repo}/branches/{quote(default_branch, safe='')}",endpoint="/repos/{owner}/{repo}/branches/{branch}",diff --git a/posthog/models/team/team.py b/posthog/models/team/team.pyindex b7a881c436fa..5eec38792550 100644--- a/posthog/models/team/team.py+++ b/posthog/models/team/team.py@@ -87,7 +87,6 @@ DEFAULT_CURRENCY = CurrencyCode.USD.valueASYNC_USER_PRODUCT_LIST_SYNC_THRESHOLD = 100-# keep in sync with posthog/frontend/src/scenes/project/Settings/ExtraTeamSettings.tsxclass AvailableExtraSettings:passdiff --git a/posthog/settings/ingestion.py b/posthog/settings/ingestion.pyindex 19fe6f8c8290..22d873dce765 100644--- a/posthog/settings/ingestion.py+++ b/posthog/settings/ingestion.py@@ -8,7 +8,6 @@ from posthog.utils import str_to_boolINGESTION_LAG_METRIC_TEAM_IDS = get_list(os.getenv("INGESTION_LAG_METRIC_TEAM_IDS", ""))-# KEEP IN SYNC WITH plugin-server/src/config/config.tsBUFFER_CONVERSION_SECONDS = get_from_env("BUFFER_CONVERSION_SECONDS", default=60, type_cast=int)# Whether or not random partitioning (i.e. overflow routing) should be allowed.diff --git a/posthog/tasks/plugin_server.py b/posthog/tasks/plugin_server.pyindex b7109c2d6340..bd5343aa75c6 100644--- a/posthog/tasks/plugin_server.py+++ b/posthog/tasks/plugin_server.py@@ -19,8 +19,6 @@ from products.notifications.backend.facade.enums import NotificationOnlyResourcelogger = get_logger(__name__)-# IMPORTANT - Do not modify this without also modifying plugin-server/../celery.ts-# Same goes for this file path and the task namesqueue = CeleryQueue.DEFAULT.value@@ -87,7 +85,6 @@ def _dispatch_plugin_disabled_realtime(logger.exception("fatal_plugin_error.realtime_setup_failed", plugin_config_id=plugin_config_id, error=str(e))-# Called from plugin-server/../lazy.ts@shared_task(ignore_result=True, queue=queue)def fatal_plugin_error(plugin_config_id: int,@@ -99,7 +96,6 @@ def fatal_plugin_error(_dispatch_plugin_disabled_realtime(plugin_config_id, plugin_config_updated_at, error)-# Called from plugin-server/../hog-watcher.service.ts@shared_task(ignore_result=True, queue=queue)def hog_function_state_transition(hog_function_id: str, state: int) -> None:logger.info("hog_function_state_transition (disabled)", hog_function_id=hog_function_id, state=state)