: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(warehouse_sources): deprecate MailerLite API version v1 (#86330)
Tom Owersa4facb679604
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/mailerlite/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/mailerlite/source.pyindex e9929c15db6e..9e6264bc7fdd 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/mailerlite/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/mailerlite/source.py@@ -13,6 +13,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.basExternalWebhookInfo,FieldType,ResumableSource,+ VersionDeprecation,WebhookCreationResult,WebhookDeletionResult,WebhookSource,@@ -42,6 +43,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.mailerliteDEFAULT_VERSION,ENDPOINTS,MAILERLITE_ENDPOINTS,+ MAILERLITE_V1,SCHEMA_TO_WEBHOOK_EVENTS,SUPPORTED_VERSIONS,WEBHOOK_RESOURCE_MAP,@@ -63,6 +65,14 @@ class MailerLiteSource(supported_versions = SUPPORTED_VERSIONSdefault_version = DEFAULT_VERSION+ # v1 sends no `X-Version` header, so connect.mailerlite.com serves whatever it treats as+ # "latest" — the drift the pin exists to stop; v2 pins the documented version date. The vendor+ # is deprecating v1 with no announced sunset date (`sunset_at=None`), so this is advisory: it+ # lights up the generic in-product banner. Existing v1 pins are left in place — the vendor still+ # serves them, and repinning would silently move a customer to a different wire — so the user+ # repins from the source config when ready.+ deprecated_versions = (VersionDeprecation(version=MAILERLITE_V1),)+lists_tables_without_credentials = True # static endpoint catalog — safe for public docs@propertydiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/mailerlite/tests/test_mailerlite_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/mailerlite/tests/test_mailerlite_source.pyindex 071437636ba2..e9a5c2b9c63f 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/mailerlite/tests/test_mailerlite_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/mailerlite/tests/test_mailerlite_source.py@@ -102,6 +102,16 @@ class TestMailerLiteSourceClass:assert set(source.supported_versions) == {MAILERLITE_V1, MAILERLITE_V2}assert source.default_version in source.supported_versions+ def test_v1_is_deprecated_without_sunset(self) -> None:+ # Guards the in-product deprecation banner: v1 must stay flagged, and with no announced+ # sunset date (a fabricated one would flip the framework into "sunsetting" behaviour and+ # invite a repin off a version MailerLite still serves).+ source = MailerLiteSource()+ deprecation = source.get_version_deprecation(MAILERLITE_V1)+ assert deprecation is not None+ assert deprecation.sunset_at is None+ assert source.get_version_deprecation(MAILERLITE_V2) is None+@pytest.mark.parametrize(("pin", "expected_version"),[(None, MAILERLITE_V2), (MAILERLITE_V1, MAILERLITE_V1), (MAILERLITE_V2, MAILERLITE_V2)],