Skip to content

: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.

feat(warehouse_sources): deprecate Calendly API v1 (#74148)

Tom Owers0c00040031e4
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/source.py
index 56c0ba999185..dffc10640c99 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/source.py
@@ -14,6 +14,7 @@ from products.warehouse_sources.backend.temporal.data_imports.pipelines.pipeline
SourceResponse,
)
from products.warehouse_sources.backend.temporal.data_imports.sources.calendly.calendly import (
+ CALENDLY_API_VERSION_V1,
CALENDLY_API_VERSION_V2,
SUPPORTED_API_VERSIONS,
CalendlyResumeConfig,
@@ -24,7 +25,11 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.calendly.s
ENDPOINTS,
INCREMENTAL_FIELDS,
)
-from products.warehouse_sources.backend.temporal.data_imports.sources.common.base import FieldType, ResumableSource
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.base import (
+ FieldType,
+ ResumableSource,
+ VersionDeprecation,
+)
from products.warehouse_sources.backend.temporal.data_imports.sources.common.canonical_descriptions import (
CanonicalDescriptions,
)
@@ -47,6 +52,11 @@ class CalendlySource(ResumableSource[CalendlySourceConfig, CalendlyResumeConfig]
supported_versions = SUPPORTED_API_VERSIONS
default_version = CALENDLY_API_VERSION_V2
+ # The "v1" label is this source's legacy default, not Calendly's retired v1 API — both labels
+ # have always resolved to the same live host. So the vendor's 2025-08-27 v1 sunset is not a
+ # sunset for these pins: nothing stops working, and `sunset_at` stays None. The label is
+ # deprecated so the in-product banner nudges users onto v2 at their own pace.
+ deprecated_versions = (VersionDeprecation(version=CALENDLY_API_VERSION_V1, sunset_at=None),)
@property
def source_type(self) -> ExternalDataSourceType:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/tests/test_calendly_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/tests/test_calendly_source.py
index 5c24a7f19c27..1ea0bdb77449 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/tests/test_calendly_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/tests/test_calendly_source.py
@@ -163,6 +163,15 @@ class TestCalendlySource:
assert self.source.default_version == CALENDLY_API_VERSION_V2
assert set(self.source.supported_versions) == {CALENDLY_API_VERSION_V1, CALENDLY_API_VERSION_V2}
+ def test_v1_is_deprecated_without_sunset_and_v2_is_not(self):
+ # v1 is flagged so the in-product deprecation warning fires, but carries no sunset date —
+ # both labels hit the same live host, so no pin is on borrowed time. The default (v2) must
+ # never be deprecated.
+ deprecation = self.source.get_version_deprecation(CALENDLY_API_VERSION_V1)
+ assert deprecation is not None
+ assert deprecation.sunset_at is None
+ assert self.source.get_version_deprecation(CALENDLY_API_VERSION_V2) is None
+
@pytest.mark.parametrize(
"pin, expected",
[