: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
feat(zonka_feedback): support Zonka Feedback API version v2.1 (#71675)
Tom Owers40cf3806fdc9
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/source.pyindex 912e7acd9e14..2cd78df05ec2 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/source.py@@ -29,6 +29,8 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.zonka_feed)from products.warehouse_sources.backend.temporal.data_imports.sources.zonka_feedback.zonka_feedback import (DATA_CENTER_IDS,+ ZONKA_API_VERSION_V1,+ ZONKA_API_VERSION_V2_1,ZonkaFeedbackResumeConfig,base_url,check_access,@@ -41,6 +43,9 @@ from products.warehouse_sources.backend.types import ExternalDataSourceTypeclass ZonkaFeedbackSource(ResumableSource[ZonkaFeedbackSourceConfig, ZonkaFeedbackResumeConfig]):api_docs_url = "https://apidocs.zonkafeedback.com/"+ supported_versions = (ZONKA_API_VERSION_V1, ZONKA_API_VERSION_V2_1)+ default_version = ZONKA_API_VERSION_V2_1+lists_tables_without_credentials = True # static endpoint catalog — safe for public docs@propertydiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/tests/test_zonka_feedback_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/tests/test_zonka_feedback_source.pyindex adf0095d31df..738892e962fd 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/tests/test_zonka_feedback_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/tests/test_zonka_feedback_source.py@@ -10,6 +10,8 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.generated_from products.warehouse_sources.backend.temporal.data_imports.sources.zonka_feedback.settings import ENDPOINTSfrom products.warehouse_sources.backend.temporal.data_imports.sources.zonka_feedback.source import ZonkaFeedbackSourcefrom products.warehouse_sources.backend.temporal.data_imports.sources.zonka_feedback.zonka_feedback import (+ ZONKA_API_VERSION_V1,+ ZONKA_API_VERSION_V2_1,ZonkaFeedbackResumeConfig,)from products.warehouse_sources.backend.types import ExternalDataSourceType@@ -147,6 +149,14 @@ class TestZonkaFeedbackSource:assert isinstance(manager, ResumableSourceManager)assert manager._data_class is ZonkaFeedbackResumeConfig+ def test_version_declaration_defaults_to_v2_1(self) -> None:+ # New/unpinned sources must resolve to v2.1; an existing pin is honored verbatim so sources+ # pinned to v1 keep syncing against the version they were created on.+ assert self.source.supported_versions == (ZONKA_API_VERSION_V1, ZONKA_API_VERSION_V2_1)+ assert self.source.default_version == ZONKA_API_VERSION_V2_1+ assert self.source.resolve_api_version(None) == ZONKA_API_VERSION_V2_1+ assert self.source.resolve_api_version(ZONKA_API_VERSION_V1) == ZONKA_API_VERSION_V1+@mock.patch("products.warehouse_sources.backend.temporal.data_imports.sources.zonka_feedback.source.zonka_feedback_source")diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/zonka_feedback.py b/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/zonka_feedback.pyindex 199d03d2c9cb..03afb4a2ca3d 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/zonka_feedback.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/zonka_feedback/zonka_feedback.py@@ -13,9 +13,15 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.zonka_feedZONKA_FEEDBACK_ENDPOINTS,)+# Vendor API version labels — opaque strings, never parsed or ordered. v2.1 is Zonka's current+# stable API; v1 is the legacy label PostHog first shipped against.+ZONKA_API_VERSION_V1 = "v1"+ZONKA_API_VERSION_V2_1 = "v2.1"+# Zonka Feedback hosts data per region; the account's data center is the subdomain of the API host.# US=us1, EU=e, IN=in are the documented, verifiable identifiers.DATA_CENTER_IDS: tuple[str, ...] = ("us1", "e", "in")+# The list endpoints default to 25 items per page and allow overriding the page size. We request a# larger page to cut round trips; pagination terminates on the first empty page, so the request is# correct whether or not the server honours the larger size.