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): support Simplecast API version 2.0 (#71668)

Tom Owersb6a50bcd8b05
diff --git a/.agents/skills/warehouse-source-new-version/SKILL.md b/.agents/skills/warehouse-source-new-version/SKILL.md
index a83d5e464cac..6af7c06b3c60 100644
--- a/.agents/skills/warehouse-source-new-version/SKILL.md
+++ b/.agents/skills/warehouse-source-new-version/SKILL.md
@@ -68,3 +68,4 @@ After you finish a version-update or deprecation PR using this skill, **append w
- (seed) Stripe: response shapes differ enough across date versions that canonical column hints must be gated per version; newer versions auto-infer schema instead.
- A new version label doesn't imply new paths: vendors ship a "v2" that still serves resources at `/v1/`, or replace the resource API entirely — check the docs per resource before building `/{version}/{resource}` URLs. A tell-tale in your own diff: needing a different probe/validation endpoint for the new version proves the resource sets diverge, so the sync paths need branching too.
- Grep every place the source builds a client or URL (sync, discovery, probes, error matchers, webhooks) when bumping — the ones outside the sync path silently stay on default/legacy versions.
+- Simplecast: current API (api.simplecast.com + Bearer) _is_ "2.0" and the `UNVERSIONED_API_VERSION` ("v1") pin already hit it, so both labels resolve to the same live API — adding "2.0" as the new default is a pure declaration change with no wire divergence. Header-based version selection is announced but unshipped, so don't thread a speculative version header onto requests: declare `supported_versions`/`default_version` now and defer the wire dispatch until the real header contract exists (a no-op header ships risk with no present benefit).
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/settings.py
index e23e80273446..c6b9eec7d439 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/settings.py
@@ -1,5 +1,16 @@
from dataclasses import dataclass, field
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.base import UNVERSIONED_API_VERSION
+
+# Simplecast's live REST API is labeled "2.0" (same https://api.simplecast.com host and Bearer
+# auth the client already uses). UNVERSIONED_API_VERSION ("v1") is the framework placeholder that
+# pre-versioning source rows carry; both labels resolve to the one available API, so no request
+# branches on the version yet. Simplecast has announced but not shipped header-based version
+# selection, so wiring the version onto requests is deferred until that contract is known.
+SIMPLECAST_API_VERSION_2_0 = "2.0"
+SUPPORTED_VERSIONS = (UNVERSIONED_API_VERSION, SIMPLECAST_API_VERSION_2_0)
+DEFAULT_VERSION = SIMPLECAST_API_VERSION_2_0
+
@dataclass
class SimpleCastEndpointConfig:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/source.py
index 2dce2c2883be..ece8f12fc910 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/source.py
@@ -22,8 +22,10 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.res
from products.warehouse_sources.backend.temporal.data_imports.sources.common.schema import SourceSchema
from products.warehouse_sources.backend.temporal.data_imports.sources.generated_configs import SimpleCastSourceConfig
from products.warehouse_sources.backend.temporal.data_imports.sources.simplecast.settings import (
+ DEFAULT_VERSION,
ENDPOINTS,
SIMPLECAST_ENDPOINTS,
+ SUPPORTED_VERSIONS,
)
from products.warehouse_sources.backend.temporal.data_imports.sources.simplecast.simplecast import (
SimpleCastResumeConfig,
@@ -37,6 +39,9 @@ from products.warehouse_sources.backend.types import ExternalDataSourceType
class SimpleCastSource(ResumableSource[SimpleCastSourceConfig, SimpleCastResumeConfig]):
api_docs_url = "https://apidocs.simplecast.com"
+ supported_versions = SUPPORTED_VERSIONS
+ default_version = DEFAULT_VERSION
+
lists_tables_without_credentials = True # static endpoint catalog — safe for public docs
@property
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/tests/test_simplecast_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/tests/test_simplecast_source.py
index a280fc9787a9..61c054a3129f 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/tests/test_simplecast_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/simplecast/tests/test_simplecast_source.py
@@ -5,9 +5,13 @@ from parameterized import parameterized
from posthog.schema import ReleaseStatus, SourceFieldInputConfig, SourceFieldInputConfigType
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.base import UNVERSIONED_API_VERSION
from products.warehouse_sources.backend.temporal.data_imports.sources.common.resumable import ResumableSourceManager
from products.warehouse_sources.backend.temporal.data_imports.sources.generated_configs import SimpleCastSourceConfig
-from products.warehouse_sources.backend.temporal.data_imports.sources.simplecast.settings import ENDPOINTS
+from products.warehouse_sources.backend.temporal.data_imports.sources.simplecast.settings import (
+ ENDPOINTS,
+ SIMPLECAST_API_VERSION_2_0,
+)
from products.warehouse_sources.backend.temporal.data_imports.sources.simplecast.simplecast import (
SimpleCastResumeConfig,
)
@@ -113,6 +117,12 @@ class TestSimpleCastSource:
assert isinstance(manager, ResumableSourceManager)
assert manager._data_class is SimpleCastResumeConfig
+ def test_supports_legacy_and_2_0_with_2_0_default(self) -> None:
+ # 2.0 is the live Simplecast API and the new default; the legacy placeholder stays supported
+ # so existing pinned rows keep resolving to their unchanged wire behaviour.
+ assert self.source.supported_versions == (UNVERSIONED_API_VERSION, SIMPLECAST_API_VERSION_2_0)
+ assert self.source.default_version == SIMPLECAST_API_VERSION_2_0
+
@mock.patch("products.warehouse_sources.backend.temporal.data_imports.sources.simplecast.source.simplecast_source")
def test_source_for_pipeline_plumbs_arguments(self, mock_source: mock.MagicMock) -> None:
inputs = mock.MagicMock()