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 Shopify API version 2025-10 (#95585)

Tom Owers13edfda1df7e
diff --git a/.agents/skills/warehouse-source-new-version/SKILL.md b/.agents/skills/warehouse-source-new-version/SKILL.md
index 2bb1682bebbf..1407f99c07fe 100644
--- a/.agents/skills/warehouse-source-new-version/SKILL.md
+++ b/.agents/skills/warehouse-source-new-version/SKILL.md
@@ -95,6 +95,7 @@ version sunset - confirm the version itself stops being served before deprecatin
- Don't regenerate schemas for existing customers as part of a version add; schema changes only apply to rows repinned via the (human-run) migration.
- Discovery diffs under the SOURCE pin (`sync_new_schemas`, `refresh_schemas`, bulk sync-defaults). A schema-level `api_version` override on a version whose table set differs from the source's version can be disabled/soft-deleted by that diff — keep overrides to short verification windows, not as a long-term way to hold one table on another version.
- When a versioned source sends the pin on any vendor call — discovery _or_ sync (a static endpoint catalog doesn't consume it at discovery, but `get_rows` still sends the version header) — add the vendor's version-rejection error signature (e.g. `406`/`410`) to `get_non_retryable_errors`, otherwise a retired pin turns the retry cadence into a permanent error loop with no user-facing surface.
+- A vendor that falls forward on a retired pin — serving the oldest accessible version instead of rejecting the request — has no rejection signature to add. Its sunset still needs the repin migration: the pin silently stops being honored, with no failed sync to surface it.
- A version bump can change the auth scheme, not just the wire format. Then the source config needs both credential shapes as optional fields, auth construction dispatches on the resolved version, and `validate_credentials` enforces the pair that version needs — form-level `required` can't express "depends on the pin".
- A new version can page a horizon the old one returned whole (a fixed record cap plus `next`/`prev` links). For a snapshot-polling source, keep one request per sync rather than following the links — vendors bill each page — and state the resulting horizon in each table's description, since it can be shorter than the old version's.
- A version that changes the pagination _mechanism_ (e.g. offset→cursor) also changes the resumable checkpoint's persisted shape. Add a new defaulted field to the resume-config dataclass rather than repurposing the existing one — so state persisted under the old version still decodes — and make the seed and save-checkpoint logic dispatch on the resolved version. Reusing one field across incompatible mechanisms corrupts in-flight resumes of the other version.
diff --git a/products/warehouse_sources/backend/migrations/0162_repin_shopify_api_version.py b/products/warehouse_sources/backend/migrations/0162_repin_shopify_api_version.py
new file mode 100644
index 000000000000..66e1bac4ea84
--- /dev/null
+++ b/products/warehouse_sources/backend/migrations/0162_repin_shopify_api_version.py
@@ -0,0 +1,42 @@
+from django.db import migrations
+
+# Shopify keeps each quarterly version accessible for about 12 months. "2025-10" stops being
+# accessible on 2026-10-16 15:00 UTC, after which Shopify falls forward to the oldest accessible
+# version instead of returning an error — so a pin left behind moves silently rather than failing
+# loudly, which is exactly what the pinning framework exists to prevent. This repins source-level
+# pins from "2025-10" to "2026-07" (the current default).
+#
+# No data or schema transform accompanies the repin: the source builds one shared set of GraphQL
+# documents and sends the version only as the Admin API URL segment, so a repinned source requests
+# the same fields, and produces the same columns, as a source created on "2026-07" today.
+SHOPIFY_SOURCE_TYPE = "Shopify"
+SHOPIFY_API_VERSION_2025_10 = "2025-10"
+SHOPIFY_API_VERSION_2026_07 = "2026-07"
+
+
+def repin_shopify_2025_10_to_2026_07(apps, schema_editor):
+ ExternalDataSource = apps.get_model("warehouse_sources", "ExternalDataSource")
+
+ # Source-level pin only. Schema-level `ExternalDataSchema.api_version` overrides are user-managed
+ # (a customer intentionally pinned that schema) and are left alone — the schema-level deprecation
+ # warning prompts the user to migrate those.
+ #
+ # NULL pins already resolve to the source's `default_version` ("2026-07"), so they need no update.
+ # Matching only `api_version="2025-10"` keeps this idempotent: a second run matches nothing.
+ # ExternalDataSource is one row per configured source, so a single bulk update is quick.
+ ExternalDataSource.objects.filter(source_type=SHOPIFY_SOURCE_TYPE, api_version=SHOPIFY_API_VERSION_2025_10).update(
+ api_version=SHOPIFY_API_VERSION_2026_07
+ )
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("warehouse_sources", "0161_alter_customoauth2integration_created_by_and_more"),
+ ]
+
+ operations = [
+ # Reverse is a no-op: once repinned, "2026-07" rows are indistinguishable from natively-created
+ # ones, so a blanket downgrade would clobber legitimate "2026-07" pins and move customers back
+ # onto the sunset version.
+ migrations.RunPython(repin_shopify_2025_10_to_2026_07, migrations.RunPython.noop, elidable=True),
+ ]
diff --git a/products/warehouse_sources/backend/migrations/max_migration.txt b/products/warehouse_sources/backend/migrations/max_migration.txt
index 2a3b7988e213..d26649395fc7 100644
--- a/products/warehouse_sources/backend/migrations/max_migration.txt
+++ b/products/warehouse_sources/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0161_alter_customoauth2integration_created_by_and_more
+0162_repin_shopify_api_version
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/source.py
index f08ab141fd46..f0a50c395d27 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/source.py
@@ -1,3 +1,4 @@
+from datetime import date
from typing import Optional, cast
from posthog.schema import (
@@ -11,7 +12,11 @@ from posthog.schema import (
SourceFieldSelectConfigOption,
)
-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,
)
@@ -57,6 +62,10 @@ class ShopifySource(ResumableSource[ShopifySourceConfig, ShopifyResumeConfig]):
supported_versions = (SHOPIFY_API_VERSION_2025_10, SHOPIFY_API_VERSION_2026_07)
default_version = SHOPIFY_API_VERSION_2026_07
api_docs_url = "https://shopify.dev/docs/api/release-notes"
+ # Shopify keeps each quarterly version accessible for about 12 months, then falls forward to
+ # the oldest accessible version instead of erroring — so a pin left on 2025-10 silently moves
+ # rather than failing loudly.
+ deprecated_versions = (VersionDeprecation(version=SHOPIFY_API_VERSION_2025_10, sunset_at=date(2026, 10, 16)),)
lists_tables_without_credentials = True # static endpoint catalog — safe for public docs
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/tests/test_api_version.py b/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/tests/test_api_version.py
index dfa7fea5ce57..e59e75c3606c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/tests/test_api_version.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/tests/test_api_version.py
@@ -1,8 +1,10 @@
+from datetime import date
from typing import Any
import pytest
from unittest.mock import MagicMock, patch
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.base import VersionDeprecation
from products.warehouse_sources.backend.temporal.data_imports.sources.common.resumable import ResumableSourceManager
from products.warehouse_sources.backend.temporal.data_imports.sources.generated_configs.shopify import (
ShopifyAuthMethodConfig,
@@ -33,6 +35,25 @@ class TestApiVersionResolution:
# guards that the legacy version stays declared alongside the new one.
assert set(ShopifySource.supported_versions) == {SHOPIFY_API_VERSION_2025_10, SHOPIFY_API_VERSION_2026_07}
+ def test_2025_10_is_deprecated_with_its_sunset_date(self) -> None:
+ # The in-product deprecation warning and the repin migration both key off this metadata,
+ # and the registry invariant test only checks generic invariants.
+ assert ShopifySource.deprecated_versions == (
+ VersionDeprecation(version=SHOPIFY_API_VERSION_2025_10, sunset_at=date(2026, 10, 16)),
+ )
+
+ @pytest.mark.parametrize(
+ "pin, deprecated",
+ [
+ (SHOPIFY_API_VERSION_2025_10, True),
+ (SHOPIFY_API_VERSION_2026_07, False),
+ # An unpinned source resolves to the default, which is never deprecated.
+ (None, False),
+ ],
+ )
+ def test_deprecation_lookup_per_pin(self, pin: str | None, deprecated: bool) -> None:
+ assert (ShopifySource().get_version_deprecation(pin) is not None) == deprecated
+
@pytest.mark.parametrize(
"pin, expected",
[