: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
fix(inngest): read the webhooks table from the v1 inventory only (#95750)
Tom Owersac42386931ce
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/settings.pyindex 6a158f038905..1e2f98b8566c 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/settings.py@@ -4,11 +4,10 @@ from typing import Literal, Optionalfrom products.warehouse_sources.backend.types import IncrementalField, IncrementalFieldType# Vendor API versions. Inngest serves its REST API under URL-path-versioned prefixes-# (`/v1/...`, `/v2/...`) and the per-environment signing key authenticates both. Most resources-# live under a single version — the events walk and cancellations are v1-only, while environments-# and the key inventories are v2-only — so their paths are fixed regardless of a source's pin.-# Webhooks is served under both, so a source's pin selects which inventory it reads (see-# `version_paths` below). New sources default to v2.+# (`/v1/...`, `/v2/...`) and the per-environment signing key authenticates both. Every resource+# this source reads lives under a single version — the events walk, cancellations and webhooks are+# v1-only, while environments and the key inventories are v2-only — so their paths are fixed+# regardless of a source's pin. New sources default to v2.INNGEST_API_VERSION_V1 = "v1"INNGEST_API_VERSION_V2 = "v2"INNGEST_SUPPORTED_VERSIONS = (INNGEST_API_VERSION_V1, INNGEST_API_VERSION_V2)@@ -124,14 +123,6 @@ INNGEST_ENDPOINTS: dict[str, InngestEndpointConfig] = {primary_keys=["id"],pagination="none",redacted_fields=("url",),- # Webhooks is the one resource this source reads that Inngest serves under both versions.- # A v2-pinned source reads the v2 inventory (cursor envelope) to stay consistent with its- # other v2-native reads; v1 pins keep the original `/v1/webhooks` list path. The v2- # envelope could not be curl-verified without credentials, but `_get_v2_list_rows`- # degrades to a single page when the response carries no `page` object.- version_paths={- INNGEST_API_VERSION_V2: InngestVersionPath(path="/v2/webhooks", pagination="v2_cursor"),- },),"event_keys": InngestEndpointConfig(name="event_keys",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/tests/test_inngest.py b/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/tests/test_inngest.pyindex 30e7836e2610..1cff174b7948 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/tests/test_inngest.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/tests/test_inngest.py@@ -302,31 +302,15 @@ class TestV1Lists:class TestVersionDispatch:- @parameterized.expand([("v1", "/v1/webhooks"), ("v2", "/v2/webhooks")])- def test_webhooks_endpoint_follows_the_source_pin(self, api_version: str, expected_path: str) -> None:- # Webhooks is served under both API versions; the source pin decides which inventory a- # source reads. A v1 pin must stay on the original path (existing syncs byte-for-byte), a- # v2 pin must move to the v2 inventory. The url field is capability-bearing and dropped on- # either version.- seen_urls: list[str] = []-- def fake_fetch(session: Any, url: str, headers: dict, logger: Any, params: dict | None = None) -> Any:- seen_urls.append(url)- return {- "data": [{"id": "wh1", "name": "intake", "url": "https://inn.gs/secret"}],- "page": {"hasMore": False},- }-- rows, _ = _run_rows("webhooks", fake_fetch, api_version=api_version)- assert seen_urls[0] == f"https://api.inngest.com{expected_path}"- assert rows == [{"id": "wh1", "name": "intake"}]-@parameterized.expand([- # Cancellations only exist in v1 and the envs inventory only in v2, so a pin on the- # other version must not relocate them off their only compatible home (a 404 otherwise).+ # Cancellations and the webhooks inventory only exist in v1 and the envs inventory only+ # in v2, so a pin on the other version must not relocate them off their only compatible+ # home (a 404 otherwise).("cancellations", "v2", "/v1/cancellations"),("environments", "v1", "/v2/envs"),+ ("webhooks", "v2", "/v1/webhooks"),+ ("webhooks", "v1", "/v1/webhooks"),])def test_version_locked_endpoint_ignores_the_pin(self, endpoint: str, api_version: str, expected_path: str) -> None:diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/tests/test_inngest_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/tests/test_inngest_source.pyindex a55f2e14df88..f3e73dcb7942 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/tests/test_inngest_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/inngest/tests/test_inngest_source.py@@ -134,7 +134,7 @@ class TestInngestSource:self, _name: str, pin: Optional[str], expected: str) -> None:# A pinned source must sync under its own version, not the default — dropping the resolve- # would silently read version-mobile tables (webhooks) from the wrong API version.+ # would leave every source reading the default version's paths.config = InngestSourceConfig(signing_key="signkey-prod-test")inputs = _source_inputs("webhooks")inputs.api_version = pin