: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): support Adobe Analytics API version 2.0 (#80083)
Tom Owers05859b28f482
diff --git a/.agents/skills/warehouse-source-new-version/SKILL.md b/.agents/skills/warehouse-source-new-version/SKILL.mdindex 007e9e110b53..1b91f880d540 100644--- a/.agents/skills/warehouse-source-new-version/SKILL.md+++ b/.agents/skills/warehouse-source-new-version/SKILL.md@@ -23,7 +23,7 @@ Use this skill when a vendor has released a new API version and an existing sour## First: does the version need to exist at all?-Spotting a new vendor label is not a reason to support it. Before touching any source file, diff the new version against the one it supersedes — the source's current `default_version`, not every entry in `supported_versions` — from the vendor's docs and changelog, area by area:+Spotting a new vendor label is not a reason to support it. Before touching any source file, diff the new version against the one it supersedes — the source's current `default_version`, not every entry in `supported_versions` — from the vendor's docs and changelog, area by area. Diff against the wire the client actually sends, not against the label: the `UNVERSIONED_API_VERSION` default (`v1`) does not mean the client targets the vendor's oldest API — a source built before it declared versions may already speak a modern wire, in which case adding that wire's real label is a declaration-only relabel-and-repin (below), not a new request path.- authentication — credential fields, token/header scheme, scopes, permission probes- base URL, version header, and the paths actually served per resourcediff --git a/products/warehouse_sources/backend/migrations/0128_repin_adobe_analytics_api_version_2_0.py b/products/warehouse_sources/backend/migrations/0128_repin_adobe_analytics_api_version_2_0.pynew file mode 100644index 000000000000..8a98a31b07f7--- /dev/null+++ b/products/warehouse_sources/backend/migrations/0128_repin_adobe_analytics_api_version_2_0.py@@ -0,0 +1,33 @@+from django.db import migrations++# Adobe deprecated its legacy 1.4 API (the framework "v1" label) with a vendor sunset of 2026-08-12+# in favor of the 2.0 REST API. This source's client has only ever spoken 2.0, so a v1 pin and a 2.0+# pin hit the exact same wire — repinning is a lossless label change with no data or schema transform.+# This moves the source-level pin only; schema-level `ExternalDataSchema.api_version` overrides are+# user-managed and intentionally left untouched.+SOURCE_TYPE = "AdobeAnalytics"+DEPRECATED_VERSION = "v1"+NEW_VERSION = "2.0"+++def repin_adobe_analytics_to_2_0(apps, schema_editor):+ ExternalDataSource = apps.get_model("warehouse_sources", "ExternalDataSource")++ # ExternalDataSource is one row per configured source (thousands, not events-scale), so a single+ # bulk update in the migration's transaction is quick. Idempotent: a second run finds no v1/NULL+ # Adobe Analytics rows. NULL pins are repinned too — they otherwise silently follow the flipped+ # default_version to 2.0, so pinning them makes the migration explicit and reviewable.+ ExternalDataSource.objects.filter(source_type=SOURCE_TYPE, api_version=DEPRECATED_VERSION).update(+ api_version=NEW_VERSION+ )+ ExternalDataSource.objects.filter(source_type=SOURCE_TYPE, api_version__isnull=True).update(api_version=NEW_VERSION)+++class Migration(migrations.Migration):+ dependencies = [("warehouse_sources", "0127_pin_qualys_vmdr_null_api_version_to_2_0")]++ operations = [+ # Reverse is a no-op: once repinned, 2.0 rows are indistinguishable from natively-created ones,+ # so a blanket downgrade would clobber legitimate 2.0 pins made after this ran.+ migrations.RunPython(repin_adobe_analytics_to_2_0, migrations.RunPython.noop, elidable=True),+ ]diff --git a/products/warehouse_sources/backend/migrations/max_migration.txt b/products/warehouse_sources/backend/migrations/max_migration.txtindex 68c5845f2cdc..d0ac491c7d6b 100644--- a/products/warehouse_sources/backend/migrations/max_migration.txt+++ b/products/warehouse_sources/backend/migrations/max_migration.txt@@ -1 +1 @@-0127_pin_qualys_vmdr_null_api_version_to_2_0+0128_repin_adobe_analytics_api_version_2_0diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/adobe_analytics.py b/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/adobe_analytics.pyindex b03af428f88a..8144900a4f4e 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/adobe_analytics.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/adobe_analytics.py@@ -21,6 +21,13 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.resfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.sync_window import SyncWindowfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.typings import SourceResponse+# Rows created before this source declared versions carry the framework default "v1", which+# maps to Adobe's legacy 1.4 API (vendor end-of-life 2026-08-12). This client has only ever+# spoken the 2.0 REST API, so both pins hit the same wire — the version is metadata for the+# deprecation warning and the repin migration, not a request input.+ADOBE_ANALYTICS_API_VERSION_V1 = "v1"+ADOBE_ANALYTICS_API_VERSION_2_0 = "2.0"+# Adobe IMS issues the access token for OAuth Server-to-Server credentials. JWT ("Service# Account") credentials were retired on 2025-06-30, so this is the only server-side grant left.IMS_TOKEN_URL = "https://ims-na1.adobelogin.com/ims/token/v3"diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/source.pyindex 3613899546f6..aa2c127eee53 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/source.py@@ -1,3 +1,4 @@+from datetime import datefrom typing import Optional, castimport structlog@@ -12,6 +13,8 @@ from posthog.schema import ()from products.warehouse_sources.backend.temporal.data_imports.sources.adobe_analytics.adobe_analytics import (+ ADOBE_ANALYTICS_API_VERSION_2_0,+ ADOBE_ANALYTICS_API_VERSION_V1,AdobeAnalyticsResumeConfig,adobe_analytics_source,validate_credentials as validate_adobe_analytics_credentials,@@ -21,7 +24,11 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.adobe_analENDPOINTS,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,)@@ -46,6 +53,13 @@ class AdobeAnalyticsSource(ResumableSource[AdobeAnalyticsSourceConfig, AdobeAnallists_tables_without_credentials = True # static endpoint catalog — safe for public docs+ supported_versions = (ADOBE_ANALYTICS_API_VERSION_V1, ADOBE_ANALYTICS_API_VERSION_2_0)+ default_version = ADOBE_ANALYTICS_API_VERSION_2_0+ # Adobe sunsets the legacy 1.4 API (the "v1" label) on 2026-08-12; the client already talks+ # 2.0, so this only lights up the generic deprecation warning and repins pins to the label+ # that matches the wire.+ deprecated_versions = (VersionDeprecation(version=ADOBE_ANALYTICS_API_VERSION_V1, sunset_at=date(2026, 8, 12)),)+@propertydef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.ADOBEANALYTICSdiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/tests/test_adobe_analytics_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/tests/test_adobe_analytics_source.pyindex 74707c0cfb35..f493a7acc069 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/tests/test_adobe_analytics_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/adobe_analytics/tests/test_adobe_analytics_source.py@@ -1,9 +1,13 @@+from datetime import date+import pytestfrom unittest import mockfrom posthog.schema import ReleaseStatus, SourceFieldInputConfig, SourceFieldInputConfigTypefrom products.warehouse_sources.backend.temporal.data_imports.sources.adobe_analytics.adobe_analytics import (+ ADOBE_ANALYTICS_API_VERSION_2_0,+ ADOBE_ANALYTICS_API_VERSION_V1,AdobeAnalyticsResumeConfig,)from products.warehouse_sources.backend.temporal.data_imports.sources.adobe_analytics.settings import (@@ -93,6 +97,19 @@ class TestAdobeAnalyticsSource:def test_non_retryable_errors_do_not_swallow_transient_or_unrelated_failures(self, other_error: str) -> None:assert not any(key in other_error for key in self.source.get_non_retryable_errors())+ def test_version_metadata_declares_v1_deprecation(self) -> None:+ # The client only ever spoke Adobe's 2.0 wire, so both pins are request-identical; the+ # metadata is what drives the deprecation banner and the source-level repin migration.+ assert self.source.supported_versions == (ADOBE_ANALYTICS_API_VERSION_V1, ADOBE_ANALYTICS_API_VERSION_2_0)+ assert self.source.default_version == ADOBE_ANALYTICS_API_VERSION_2_0++ deprecation = self.source.get_version_deprecation(ADOBE_ANALYTICS_API_VERSION_V1)+ assert deprecation is not None+ # Adobe's announced 1.4 API end-of-life; the migration and the banner both depend on it.+ assert deprecation.sunset_at == date(2026, 8, 12)+ # The current default must never be flagged deprecated.+ assert self.source.get_version_deprecation(ADOBE_ANALYTICS_API_VERSION_2_0) is None+def test_get_schemas_lists_the_endpoint_catalog(self) -> None:schemas = self.source.get_schemas(self.config, self.team_id)