Skip to content

chore(web_analytics): move models to product app#59223

Merged
webjunkie merged 16 commits into
masterfrom
chore/move-web-analytics-models-to-product
May 22, 2026
Merged

chore(web_analytics): move models to product app#59223
webjunkie merged 16 commits into
masterfrom
chore/move-web-analytics-models-to-product

Conversation

@webjunkie
Copy link
Copy Markdown
Contributor

Problem

Web analytics models (WebAnalyticsFilterPreset, SavedHeatmap, HeatmapSnapshot) still live in the monolithic posthog/models/ directory. Moving them to products/web_analytics/backend/models/ continues the ongoing product isolation effort.

Changes

  • Add WebAnalyticsConfig AppConfig and register in INSTALLED_APPS
  • git mv the two model files into products/web_analytics/backend/models/
  • Fix ForeignKey string refs ("Team""posthog.Team", "User""posthog.User")
  • Add explicit db_table declarations so tables stay in place
  • Update all imports across 5 consuming files
  • Remove barrel re-exports from posthog/models/__init__.py
  • State-only Django migrations using SeparateDatabaseAndState — no DB changes
  • Idempotent ContentType migration to move app_label from posthogweb_analytics

How did you test this code?

I'm an agent. Automated validation only:

  • python manage.py migrate --plan — plan is clean
  • python manage.py makemigrations --check — no pending changes
  • Django setup loads without errors
  • Confirmed zero stale imports via rg

Publish to changelog?

No

🤖 Agent context

Agent-authored via Claude Code. Followed the product-model-migration skill workflow manually (small enough scope that the phased script wasn't needed). Straightforward migration — 3 models, no cross-app FK refs, no mock patches, no get_model calls.

Move WebAnalyticsFilterPreset, SavedHeatmap, and HeatmapSnapshot from
posthog/models/ into products/web_analytics/backend/models/. State-only
Django migrations with SeparateDatabaseAndState — no DB changes, tables
stay in place via explicit db_table declarations.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

🎭 Playwright didn't run on this PR — your changes touch code that could affect E2E behavior, but Playwright is opt-in via label now to keep CI cost down.

Add the run-playwright label if you want an E2E sweep before merging — CI will pick it up automatically.

Most PRs don't need this. Real regressions still get caught on master and fix-forward.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Migration SQL Changes

Hey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:

posthog/migrations/1176_migrate_web_analytics_models.py

BEGIN;
--
-- Custom state/database change combination
--
-- (no-op)
--
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL
COMMIT;

products/web_analytics/backend/migrations/0001_initial.py

BEGIN;
--
-- Custom state/database change combination
--
-- (no-op)
COMMIT;

Last updated: 2026-05-22 09:17 UTC (a53d543)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

🔍 Migration Risk Analysis

We've analyzed your migrations for potential risks.

Summary: 1 Safe | 1 Needs Review | 0 Blocked

⚠️ Needs Review

May have performance impact

posthog.1176_migrate_web_analytics_models
  └─ #1 ✅ SeparateDatabaseAndState: Only state operations (no database changes)
  └─ #2 ⚠️ RunPython: RunPython data migration needs review for performance

✅ Safe

Brief or no lock, backwards compatible

web_analytics.0001_initial
  └─ #1 ✅ SeparateDatabaseAndState: Only state operations (no database changes)

📚 How to Deploy These Changes Safely

RunPython:

Use batching for large data migrations:

  • Use .iterator() to avoid loading all rows into memory
  • Use .bulk_update() instead of saving individual objects
  • Batch size: 1,000-10,000 rows per batch
  • Add pauses between batches
  • Consider background jobs for very large updates (millions of rows)

See the migration safety guide

Last updated: 2026-05-22 09:17 UTC (a53d543)

webjunkie and others added 3 commits May 21, 2026 10:02
Co-locate web_analytics product code into the product backend:
- API: web_analytics_filter_preset.py, heatmaps_api.py, heatmaps_utils.py
- HogQL query runners: entire posthog/hogql_queries/web_analytics/ tree
- Celery task: heatmap_screenshot.py and its test
- Heatmaps API tests + snapshots

posthog/heatmaps/sql.py stays — shared ClickHouse schema used by CH migrations.

Imports rewritten with the product-model-migration skill's import_rewriter
across 58 files. Added web_analytics/backend/** to the ANN exemption in
products/ruff.toml to match other migrated products.
…ytics-models-to-product

# Conflicts:
#	posthog/migrations/max_migration.txt
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented May 21, 2026

⏭️ Skipped snapshot commit because branch advanced to 2272492 while workflow was testing 06168c1.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

webjunkie added 3 commits May 21, 2026 10:52
The import_rewriter only handles import statements — it doesn't see string
paths in unittest.mock.patch() decorators or docstring/comment references.
These caused 140 test failures in CI: "module 'posthog.hogql_queries' has
no attribute 'web_analytics'".

Updated all string references from posthog.hogql_queries.web_analytics,
posthog.heatmaps.heatmaps_api, and posthog.tasks.heatmap_screenshot to
their new products.web_analytics.backend.* paths.
…ytics-models-to-product

# Conflicts:
#	posthog/migrations/max_migration.txt
…to-product' into chore/move-web-analytics-models-to-product
@github-actions
Copy link
Copy Markdown
Contributor

MCP UI Apps size report

App JS CSS
debug 474.9 KB 139.1 KB
action 349.4 KB 139.1 KB
action-list 357.2 KB 139.1 KB
cohort 348.5 KB 139.1 KB
cohort-list 356.2 KB 139.1 KB
error-details 369.9 KB 139.1 KB
error-issue 349.2 KB 139.1 KB
error-issue-list 357.2 KB 139.1 KB
experiment 353.7 KB 139.1 KB
experiment-list 358.0 KB 139.1 KB
experiment-results 355.8 KB 139.1 KB
feature-flag 434.3 KB 139.1 KB
feature-flag-list 438.8 KB 139.1 KB
feature-flag-testing 427.2 KB 139.1 KB
insight-actors 352.3 KB 139.1 KB
llm-costs 351.9 KB 139.1 KB
session-recording 350.2 KB 139.1 KB
session-summary 356.2 KB 139.1 KB
survey 350.0 KB 139.1 KB
survey-global-stats 354.8 KB 139.1 KB
survey-list 357.9 KB 139.1 KB
survey-stats 354.8 KB 139.1 KB
trace-span 348.8 KB 139.1 KB
trace-span-list 357.1 KB 139.1 KB
workflow 348.8 KB 139.1 KB
workflow-list 356.6 KB 139.1 KB
query-results 370.6 KB 139.1 KB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Size Change: +15.5 kB (+0.01%)

Total Size: 119 MB

📦 View Changed
Filename Size Change
frontend/dist/CalendarHeatMap 9.04 kB +3.97 kB (+78.24%) 🆘
frontend/dist/SupportTicketScene 33.8 kB +7.33 kB (+27.66%) 🚨
frontend/dist/TransformationsScene 6.44 kB +4.24 kB (+193.3%) 🆘
ℹ️ View Unchanged
Filename Size Change
frontend/dist/368Hedgehogs 5.51 kB 0 B
frontend/dist/abap 14.2 kB 0 B
frontend/dist/AccountConnected 3.02 kB 0 B
frontend/dist/Action 25 kB +145 B (+0.58%)
frontend/dist/Actions 1.23 kB 0 B
frontend/dist/AdvancedActivityLogsScene 40 kB 0 B
frontend/dist/AgenticAccountMismatch 2.67 kB 0 B
frontend/dist/AgenticAuthorize 5.77 kB 0 B
frontend/dist/apex 3.99 kB 0 B
frontend/dist/ApprovalDetail 16.5 kB 0 B
frontend/dist/architecture-7EHR7CIX 372 B 0 B
frontend/dist/architectureDiagram-3BPJPVTR 151 kB 0 B
frontend/dist/array.full.es5.js 348 kB 0 B
frontend/dist/array.full.js 428 kB 0 B
frontend/dist/array.js 192 kB 0 B
frontend/dist/AsyncMigrations 13.4 kB 0 B
frontend/dist/AuthenticatedShell 175 kB 0 B
frontend/dist/AuthorizationStatus 1 kB 0 B
frontend/dist/azcli 885 B 0 B
frontend/dist/bat 1.88 kB 0 B
frontend/dist/BatchExportScene 60.8 kB 0 B
frontend/dist/bicep 2.59 kB 0 B
frontend/dist/Billing 765 B 0 B
frontend/dist/BillingSection 21 kB 0 B
frontend/dist/blockDiagram-GPEHLZMM 72.5 kB 0 B
frontend/dist/BoxPlot 5.28 kB 0 B
frontend/dist/browserAll-0QZMN1W2 37.4 kB 0 B
frontend/dist/BusinessKnowledgeScene 18.9 kB 0 B
frontend/dist/ButtonPrimitives 830 B 0 B
frontend/dist/c4Diagram-AAUBKEIU 70.9 kB 0 B
frontend/dist/cameligo 2.23 kB 0 B
frontend/dist/changeRequestsLogic 782 B -34 B (-4.17%)
frontend/dist/classDiagram-4FO5ZUOK 1.32 kB 0 B
frontend/dist/classDiagram-v2-Q7XG4LA2 1.32 kB 0 B
frontend/dist/CLIAuthorize 11.7 kB 0 B
frontend/dist/CLILive 4.29 kB 0 B
frontend/dist/clojure 9.68 kB 0 B
frontend/dist/CodeEditorInline 764 B 0 B
frontend/dist/coffee 3.63 kB 0 B
frontend/dist/Cohort 28.3 kB 0 B
frontend/dist/CohortCalculationHistory 6.5 kB 0 B
frontend/dist/Cohorts 9.7 kB 0 B
frontend/dist/ConfirmOrganization 4.8 kB 0 B
frontend/dist/conversations.js 67.3 kB 0 B
frontend/dist/cose-bilkent-S5V4N54A 82.8 kB 0 B
frontend/dist/Coupons 997 B 0 B
frontend/dist/cpp 5.33 kB 0 B
frontend/dist/Create 932 B -178 B (-16.04%) 👏
frontend/dist/CredentialReview 3.83 kB 0 B
frontend/dist/crisp-chat-integration.js 1.97 kB 0 B
frontend/dist/csharp 4.56 kB 0 B
frontend/dist/csp 1.45 kB 0 B
frontend/dist/css 4.54 kB 0 B
frontend/dist/cssMode 4.2 kB 0 B
frontend/dist/CustomCssScene 3.83 kB 0 B
frontend/dist/CustomerAnalyticsConfigurationScene 2.34 kB -35 B (-1.47%)
frontend/dist/CustomerAnalyticsScene 26.9 kB 0 B
frontend/dist/CustomerJourneyBuilderScene 2.11 kB +34 B (+1.64%)
frontend/dist/CustomerJourneyTemplatesScene 7.79 kB +35 B (+0.45%)
frontend/dist/customizations.full.js 18 kB 0 B
frontend/dist/CyclotronJobInputAssignee 1.6 kB +34 B (+2.16%)
frontend/dist/CyclotronJobInputBusinessHours 2.99 kB +34 B (+1.15%)
frontend/dist/CyclotronJobInputTicketTags 954 B 0 B
frontend/dist/cypher 3.42 kB 0 B
frontend/dist/dagre-BM42HDAG 11.9 kB 0 B
frontend/dist/dart 4.29 kB 0 B
frontend/dist/Dashboard 1.55 kB 0 B
frontend/dist/Dashboards 19.7 kB 0 B
frontend/dist/DashboardTemplateCopyScene 5.98 kB 0 B
frontend/dist/DataManagementScene 918 B 0 B
frontend/dist/DataPipelinesNewScene 2.58 kB 0 B
frontend/dist/DataWarehouseScene 46.6 kB 0 B
frontend/dist/Deactivated 1.41 kB 0 B
frontend/dist/dead-clicks-autocapture.js 14.3 kB 0 B
frontend/dist/DeadLetterQueue 5.67 kB 0 B
frontend/dist/DebugScene 20.2 kB 0 B
frontend/dist/decompressionWorker 2.85 kB 0 B
frontend/dist/decompressionWorker.js 2.85 kB 0 B
frontend/dist/DecompressionWorkerManager 329 B 0 B
frontend/dist/DefinitionEdit 17.1 kB 0 B
frontend/dist/DefinitionView 24.3 kB 0 B
frontend/dist/Deployment 3.97 kB 0 B
frontend/dist/DeploymentProject 5.5 kB +34 B (+0.62%)
frontend/dist/Deployments 9.2 kB 0 B
frontend/dist/DestinationsScene 2.95 kB 0 B
frontend/dist/diagram-2AECGRRQ 6.69 kB 0 B
frontend/dist/diagram-5GNKFQAL 3.64 kB 0 B
frontend/dist/diagram-KO2AKTUF 11.5 kB 0 B
frontend/dist/diagram-LMA3HP47 5.06 kB 0 B
frontend/dist/diagram-OG6HWLK6 11.8 kB 0 B
frontend/dist/dist 559 kB 0 B
frontend/dist/dockerfile 1.91 kB 0 B
frontend/dist/EarlyAccessFeature 1.09 kB +170 B (+18.42%) ⚠️
frontend/dist/EarlyAccessFeatures 3.13 kB -35 B (-1.1%)
frontend/dist/ecl 5.38 kB 0 B
frontend/dist/EditorScene 1.41 kB 0 B
frontend/dist/elixir 10.3 kB 0 B
frontend/dist/elk.bundled 1.44 MB 0 B
frontend/dist/EmailMFAVerify 3.29 kB 0 B
frontend/dist/EndpointScene 40 kB 0 B
frontend/dist/EndpointsScene 24 kB 0 B
frontend/dist/erDiagram-TEJ5UH35 27.8 kB 0 B
frontend/dist/ErrorTrackingIssueFingerprintsScene 7.26 kB 0 B
frontend/dist/ErrorTrackingIssueScene 101 kB 0 B
frontend/dist/ErrorTrackingScene 27 kB 0 B
frontend/dist/EvaluationTemplates 813 B -34 B (-4.01%)
frontend/dist/eventmodeling-FCH6USID 375 B 0 B
frontend/dist/EventsScene 2.84 kB 0 B
frontend/dist/exception-autocapture.js 11.8 kB 0 B
frontend/dist/Experiment 206 kB 0 B
frontend/dist/Experiments 20.3 kB 0 B
frontend/dist/exporter 19.1 kB 0 B
frontend/dist/exporter.js 19.1 kB 0 B
frontend/dist/ExporterDashboardScene 1.88 kB 0 B
frontend/dist/ExporterHeatmapScene 19.6 kB 0 B
frontend/dist/ExporterInsightScene 2.91 kB 0 B
frontend/dist/ExporterInterviewScene 309 kB 0 B
frontend/dist/ExporterNotebookScene 2.71 MB 0 B
frontend/dist/ExporterRecordingScene 1.03 kB 0 B
frontend/dist/exporterSharedChunkAnchors 1.16 kB 0 B
frontend/dist/exporterSharedChunkAnchors.js 1.16 kB 0 B
frontend/dist/ExportsScene 4.26 kB 0 B
frontend/dist/FeatureFlag 134 kB 0 B
frontend/dist/FeatureFlags 1.01 kB 0 B
frontend/dist/FeatureFlagTemplatesScene 7.28 kB -33 B (-0.45%)
frontend/dist/FlappyHog 6.02 kB 0 B
frontend/dist/flow9 1.85 kB 0 B
frontend/dist/flowDiagram-I6XJVG4X 61.7 kB 0 B
frontend/dist/freemarker2 16.7 kB 0 B
frontend/dist/fsharp 3.02 kB 0 B
frontend/dist/ganttDiagram-6RSMTGT7 50.9 kB 0 B
frontend/dist/gitGraph-WXDBUCRP 360 B 0 B
frontend/dist/gitGraphDiagram-PVQCEYII 30.2 kB 0 B
frontend/dist/go 2.69 kB 0 B
frontend/dist/graphql 2.3 kB 0 B
frontend/dist/Group 15.3 kB 0 B
frontend/dist/Groups 4.18 kB 0 B
frontend/dist/GroupsNew 7.62 kB 0 B
frontend/dist/handlebars 7.38 kB 0 B
frontend/dist/hcl 3.63 kB 0 B
frontend/dist/HealthCategoryDetailScene 7.51 kB 0 B
frontend/dist/HealthScene 12.4 kB 0 B
frontend/dist/HeatmapNewScene 5.31 kB 0 B
frontend/dist/HeatmapRecordingScene 4.2 kB 0 B
frontend/dist/HeatmapScene 6.83 kB 0 B
frontend/dist/HeatmapsScene 4.16 kB 0 B
frontend/dist/hls 394 kB 0 B
frontend/dist/HogFunctionScene 59.5 kB 0 B
frontend/dist/hogql_parser_wasm_browser 1.54 MB 0 B
frontend/dist/HogRepl 7.65 kB 0 B
frontend/dist/html 5.62 kB 0 B
frontend/dist/htmlMode 4.65 kB 0 B
frontend/dist/image-blob-reduce.esm 49.5 kB 0 B
frontend/dist/InboxScene 63.2 kB 0 B
frontend/dist/index 60.9 kB 0 B
frontend/dist/index.js 60.9 kB 0 B
frontend/dist/info-J43DQDTF 348 B 0 B
frontend/dist/infoDiagram-5YYISTIA 1.35 kB 0 B
frontend/dist/ini 1.14 kB 0 B
frontend/dist/InsightQuickStart 5.7 kB 0 B
frontend/dist/InsightScene 34.7 kB 0 B
frontend/dist/IntegrationsRedirect 1.01 kB 0 B
frontend/dist/intercom-integration.js 2.03 kB 0 B
frontend/dist/InviteSignup 15.3 kB 0 B
frontend/dist/ishikawaDiagram-YF4QCWOH 18 kB 0 B
frontend/dist/java 3.26 kB 0 B
frontend/dist/javascript 1.02 kB 0 B
frontend/dist/journeyDiagram-JHISSGLW 24 kB 0 B
frontend/dist/jsonMode 13.9 kB 0 B
frontend/dist/julia 7.26 kB 0 B
frontend/dist/kanban-definition-UN3LZRKU 21.3 kB 0 B
frontend/dist/katex 266 kB 0 B
frontend/dist/kotlin 3.44 kB 0 B
frontend/dist/lazy 146 kB 0 B
frontend/dist/LegacyPluginScene 20.9 kB 0 B
frontend/dist/LegalDocumentNewScene 59.7 kB +36 B (+0.06%)
frontend/dist/LegalDocumentsScene 5.21 kB 0 B
frontend/dist/LemonTextAreaMarkdown 740 B 0 B
frontend/dist/less 3.93 kB 0 B
frontend/dist/lexon 2.47 kB 0 B
frontend/dist/lib 2.25 kB 0 B
frontend/dist/Link 733 B 0 B
frontend/dist/LinkScene 25.1 kB +35 B (+0.14%)
frontend/dist/LinksScene 4.44 kB 0 B
frontend/dist/liquid 4.57 kB 0 B
frontend/dist/LiveDebugger 19.4 kB 0 B
frontend/dist/LiveEventsTable 5.5 kB 0 B
frontend/dist/LLMAnalyticsClusterScene 21.6 kB +37 B (+0.17%)
frontend/dist/LLMAnalyticsClustersScene 54.9 kB 0 B
frontend/dist/LLMAnalyticsDatasetScene 20.9 kB 0 B
frontend/dist/LLMAnalyticsDatasetsScene 3.52 kB 0 B
frontend/dist/LLMAnalyticsEvaluation 59.8 kB 0 B
frontend/dist/LLMAnalyticsEvaluationsScene 28 kB 0 B
frontend/dist/LLMAnalyticsPlaygroundScene 37.6 kB -33 B (-0.09%)
frontend/dist/LLMAnalyticsScene 118 kB 0 B
frontend/dist/LLMAnalyticsSessionScene 13.7 kB -40 B (-0.29%)
frontend/dist/LLMAnalyticsTag 27.4 kB 0 B
frontend/dist/LLMAnalyticsTagsScene 7.22 kB 0 B
frontend/dist/LLMAnalyticsTraceScene 130 kB 0 B
frontend/dist/LLMAnalyticsUsers 764 B -34 B (-4.26%)
frontend/dist/LLMASessionFeedbackDisplay 5.08 kB 0 B
frontend/dist/LLMPromptScene 29 kB 0 B
frontend/dist/LLMPromptsScene 4.71 kB 0 B
frontend/dist/LLMSkillScene 861 B +34 B (+4.11%)
frontend/dist/LLMSkillsScene 878 B 0 B
frontend/dist/Login 10.1 kB 0 B
frontend/dist/Login2FA 4.52 kB 0 B
frontend/dist/logs.js 38.9 kB 0 B
frontend/dist/LogsAlertDetailScene 17.2 kB 0 B
frontend/dist/LogsSamplingDetailScene 5.23 kB 0 B
frontend/dist/LogsSamplingNewScene 2.15 kB -39 B (-1.79%)
frontend/dist/LogsScene 17.7 kB 0 B
frontend/dist/lua 2.16 kB 0 B
frontend/dist/m3 2.85 kB 0 B
frontend/dist/main 819 kB 0 B
frontend/dist/ManagedMigration 14.8 kB -35 B (-0.24%)
frontend/dist/markdown 3.83 kB 0 B
frontend/dist/MarketingAnalyticsScene 40.4 kB 0 B
frontend/dist/MaterializedColumns 11.9 kB 0 B
frontend/dist/Max 922 B 0 B
frontend/dist/MCPAnalyticsScene 38.6 kB 0 B
frontend/dist/MCPAnalyticsToolDetail 18.4 kB 0 B
frontend/dist/mdx 5.43 kB 0 B
frontend/dist/memlens.lib.bundle 27.9 kB 0 B
frontend/dist/mermaid.core 28.6 kB 0 B
frontend/dist/MermaidDiagram 2.19 kB 0 B
frontend/dist/MessageTemplate 16.5 kB -69 B (-0.42%)
frontend/dist/MetricsScene 1.11 kB +34 B (+3.16%)
frontend/dist/mindmap-definition-RKZ34NQL 24.8 kB 0 B
frontend/dist/mips 2.62 kB 0 B
frontend/dist/ModelsScene 19 kB 0 B
frontend/dist/MonacoDiffEditor 471 B 0 B
frontend/dist/monacoEditorWorker 288 kB 0 B
frontend/dist/monacoEditorWorker.js 288 kB 0 B
frontend/dist/monacoJsonWorker 419 kB 0 B
frontend/dist/monacoJsonWorker.js 419 kB 0 B
frontend/dist/monacoTsWorker 7.02 MB 0 B
frontend/dist/monacoTsWorker.js 7.02 MB 0 B
frontend/dist/MoveToPostHogCloud 4.73 kB 0 B
frontend/dist/msdax 4.95 kB 0 B
frontend/dist/mysql 11.3 kB 0 B
frontend/dist/NavTabChat 7.42 kB 0 B
frontend/dist/NewSourceScene 1.01 kB 0 B
frontend/dist/NewTabScene 1.75 kB 0 B
frontend/dist/NodeDetailScene 16.9 kB 0 B
frontend/dist/NotebookCanvasScene 3.75 kB 0 B
frontend/dist/NotebookPanel 5.71 kB 0 B
frontend/dist/NotebookScene 8.95 kB 0 B
frontend/dist/NotebooksScene 7.87 kB 0 B
frontend/dist/OAuthAuthorize 912 B 0 B
frontend/dist/objective-c 2.44 kB 0 B
frontend/dist/Onboarding 790 kB 0 B
frontend/dist/OnboardingCouponRedemption 1.48 kB 0 B
frontend/dist/packet-YPE3B663 354 B 0 B
frontend/dist/pascal 3.03 kB 0 B
frontend/dist/pascaligo 2.04 kB 0 B
frontend/dist/passkeyLogic 756 B 0 B
frontend/dist/PasswordReset 4.63 kB 0 B
frontend/dist/PasswordResetComplete 3.27 kB 0 B
frontend/dist/PendingDeletion 2.38 kB 0 B
frontend/dist/perl 8.29 kB 0 B
frontend/dist/PersonScene 18.8 kB 0 B
frontend/dist/PersonsScene 6.01 kB 0 B
frontend/dist/pgsql 13.5 kB 0 B
frontend/dist/php 8.06 kB 0 B
frontend/dist/pie-LRSECV5Y 345 B 0 B
frontend/dist/pieDiagram-4H26LBE5 4.95 kB 0 B
frontend/dist/PipelineStatusScene 9.38 kB 0 B
frontend/dist/pla 1.72 kB 0 B
frontend/dist/posthog 146 kB 0 B
frontend/dist/postiats 7.9 kB 0 B
frontend/dist/powerquery 17 kB 0 B
frontend/dist/powershell 3.31 kB 0 B
frontend/dist/PreflightCheck 5.84 kB 0 B
frontend/dist/product-tours.js 115 kB 0 B
frontend/dist/ProductTour 275 kB 0 B
frontend/dist/ProductTours 4.96 kB 0 B
frontend/dist/ProjectHomepage 20 kB 0 B
frontend/dist/protobuf 9.09 kB 0 B
frontend/dist/pug 4.86 kB 0 B
frontend/dist/python 4.8 kB 0 B
frontend/dist/qsharp 3.23 kB 0 B
frontend/dist/quadrantDiagram-W4KKPZXB 34.4 kB 0 B
frontend/dist/QueryPerformance 8.89 kB 0 B
frontend/dist/r 3.16 kB 0 B
frontend/dist/radar-GUYGQ44K 351 B 0 B
frontend/dist/razor 9.38 kB 0 B
frontend/dist/react-json-view 121 kB 0 B
frontend/dist/recorder-v2.js 98.7 kB 0 B
frontend/dist/recorder.js 98.7 kB 0 B
frontend/dist/redis 3.59 kB 0 B
frontend/dist/redshift 11.8 kB 0 B
frontend/dist/RegionMap 29.7 kB 0 B
frontend/dist/render-query 27.1 MB 0 B
frontend/dist/render-query.js 27.1 MB 0 B
frontend/dist/ReplayLens 21.8 kB 0 B
frontend/dist/ReplayLensesScene 12.2 kB -35 B (-0.29%)
frontend/dist/requirementDiagram-4Y6WPE33 31.9 kB 0 B
frontend/dist/ResourceTransfer 9.45 kB 0 B
frontend/dist/restructuredtext 3.94 kB 0 B
frontend/dist/RevenueAnalyticsScene 25.9 kB +58 B (+0.22%)
frontend/dist/ruby 8.54 kB 0 B
frontend/dist/rust 4.2 kB 0 B
frontend/dist/sankeyDiagram-5OEKKPKP 24.1 kB 0 B
frontend/dist/SavedInsights 936 B 0 B
frontend/dist/sb 1.86 kB 0 B
frontend/dist/scala 7.36 kB 0 B
frontend/dist/schema 723 kB 0 B
frontend/dist/SchemaScene 24 kB +35 B (+0.15%)
frontend/dist/scheme 1.8 kB 0 B
frontend/dist/scss 6.45 kB 0 B
frontend/dist/SdkDoctorScene 9.69 kB 0 B
frontend/dist/sequenceDiagram-3UESZ5HK 117 kB 0 B
frontend/dist/SessionAttributionExplorerScene 6.9 kB 0 B
frontend/dist/SessionGroupSummariesTable 4.98 kB 0 B
frontend/dist/SessionGroupSummaryScene 19.1 kB +29 B (+0.15%)
frontend/dist/SessionProfileScene 15.3 kB 0 B
frontend/dist/SessionRecordingDetail 2.03 kB 0 B
frontend/dist/SessionRecordingFilePlaybackScene 4.74 kB 0 B
frontend/dist/SessionRecordings 1.05 kB 0 B
frontend/dist/SessionRecordingsKiosk 10.2 kB 0 B
frontend/dist/SessionRecordingsPlaylistScene 5.38 kB 0 B
frontend/dist/SessionRecordingsSettingsScene 2.24 kB 0 B
frontend/dist/SessionsScene 4.26 kB 0 B
frontend/dist/SettingsScene 3.83 kB 0 B
frontend/dist/sharedChunkAnchors 1.15 kB 0 B
frontend/dist/sharedChunkAnchors.js 1.15 kB 0 B
frontend/dist/SharedMetric 6.33 kB 0 B
frontend/dist/SharedMetrics 821 B 0 B
frontend/dist/shell 3.11 kB 0 B
frontend/dist/SignupContainer 28.5 kB 0 B
frontend/dist/Site 1.47 kB 0 B
frontend/dist/solidity 18.6 kB 0 B
frontend/dist/sophia 2.8 kB 0 B
frontend/dist/SourceScene 962 B -34 B (-3.41%)
frontend/dist/SourcesScene 6.2 kB -34 B (-0.55%)
frontend/dist/sparql 2.59 kB 0 B
frontend/dist/sql 10.3 kB 0 B
frontend/dist/SqlVariableEditScene 7.52 kB 0 B
frontend/dist/st 7.44 kB 0 B
frontend/dist/StartupProgram 21.5 kB 0 B
frontend/dist/stateDiagram-AJRCARHV 11.3 kB +5 B (+0.04%)
frontend/dist/stateDiagram-v2-BHNVJYJU 1.22 kB 0 B
frontend/dist/StripeConfirmInstall 3.81 kB 0 B
frontend/dist/SubscriptionScene 14.5 kB 0 B
frontend/dist/SubscriptionsScene 5.45 kB 0 B
frontend/dist/SupportSettingsScene 1.71 kB -35 B (-2.01%)
frontend/dist/SupportTicketsScene 971 B -34 B (-3.38%)
frontend/dist/Survey 1.29 kB 0 B
frontend/dist/SurveyFormBuilder 1.82 kB 0 B
frontend/dist/Surveys 26.6 kB 0 B
frontend/dist/surveys.js 94.7 kB 0 B
frontend/dist/SurveyWizard 72.6 kB 0 B
frontend/dist/swift 5.3 kB 0 B
frontend/dist/SystemStatus 17.3 kB 0 B
frontend/dist/systemverilog 7.65 kB 0 B
frontend/dist/TaskDetailScene 23.4 kB 0 B
frontend/dist/TaskTracker 14.5 kB 0 B
frontend/dist/tcl 3.61 kB 0 B
frontend/dist/TextCardMarkdownEditor 11.2 kB +25 B (+0.22%)
frontend/dist/timeline-definition-PNZ67QCA 31.4 kB 0 B
frontend/dist/toolbar 15.4 MB 0 B
frontend/dist/toolbar.js 15.4 MB 0 B
frontend/dist/ToolbarLaunch 2.75 kB 0 B
frontend/dist/tracing-headers.js 1.84 kB 0 B
frontend/dist/TracingScene 54 kB +38 B (+0.07%)
frontend/dist/treemap-LRROVOQU 357 B 0 B
frontend/dist/treeView-BLDUP644 360 B 0 B
frontend/dist/TrendsBarChart 6.88 kB 0 B
frontend/dist/TrendsLineChart 6.84 kB 0 B
frontend/dist/tsMode 24 kB 0 B
frontend/dist/twig 6.01 kB 0 B
frontend/dist/TwoFactorReset 4.3 kB 0 B
frontend/dist/typescript 274 B 0 B
frontend/dist/typespec 2.86 kB 0 B
frontend/dist/Unsubscribe 1.93 kB 0 B
frontend/dist/UserInterview 6.28 kB -34 B (-0.54%)
frontend/dist/UserInterviewResponse 5.6 kB 0 B
frontend/dist/UserInterviews 4.11 kB +34 B (+0.83%)
frontend/dist/vb 5.83 kB 0 B
frontend/dist/vennDiagram-CIIHVFJN 41.7 kB 0 B
frontend/dist/VercelConnect 5.27 kB 0 B
frontend/dist/VercelLinkError 2.54 kB 0 B
frontend/dist/VerifyEmail 5.05 kB 0 B
frontend/dist/vimMode 211 kB 0 B
frontend/dist/VisualReviewIndexScene 2.48 kB 0 B
frontend/dist/VisualReviewRunScene 44.6 kB +33 B (+0.07%)
frontend/dist/VisualReviewRunsScene 7.21 kB 0 B
frontend/dist/VisualReviewSettingsScene 11 kB 0 B
frontend/dist/VisualReviewSnapshotHistoryScene 13.8 kB 0 B
frontend/dist/VisualReviewSnapshotOverviewScene 19.5 kB +37 B (+0.19%)
frontend/dist/wardley-L42UT6IY 352 B 0 B
frontend/dist/wardleyDiagram-YWT4CUSO 26.2 kB 0 B
frontend/dist/web-vitals-with-attribution.js 11.8 kB 0 B
frontend/dist/web-vitals.js 6.39 kB 0 B
frontend/dist/WebAnalyticsScene 10.4 kB 0 B
frontend/dist/WebGLRenderer-DYjOwNoG 60.4 kB 0 B
frontend/dist/WebGPURenderer-B_wkl_Ja 36.3 kB 0 B
frontend/dist/WebScriptsScene 2.82 kB 0 B
frontend/dist/WebVitals 7.41 kB 0 B
frontend/dist/WebVitalsPathBreakdown 3.89 kB 0 B
frontend/dist/webworkerAll-puPV1rBA 397 B 0 B
frontend/dist/wgsl 7.38 kB 0 B
frontend/dist/Wizard 4.73 kB 0 B
frontend/dist/WorkflowScene 104 kB 0 B
frontend/dist/WorkflowsScene 60 kB -90 B (-0.15%)
frontend/dist/WorldMap 1.04 MB 0 B
frontend/dist/xml 3.02 kB 0 B
frontend/dist/xychartDiagram-2RQKCTM6 39.6 kB 0 B
frontend/dist/yaml 4.64 kB 0 B

compressed-size-action

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented May 21, 2026

Query snapshots: Backend query snapshots updated

Changes: 2 snapshots (2 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

@webjunkie webjunkie marked this pull request as ready for review May 21, 2026 10:17
@webjunkie webjunkie requested a review from a team as a code owner May 21, 2026 10:17
Copilot AI review requested due to automatic review settings May 21, 2026 10:17
@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team May 21, 2026 10:18
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b86c26c776

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread posthog/tasks/__init__.py
Comment on lines 11 to 14
exporter,
feature_flags,
health_checks,
heatmap_screenshot,
hog_flows,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Re-export the moved heatmap task for Celery discovery

Removing heatmap_screenshot from the posthog.tasks import list without adding an equivalent re-export under products.web_analytics.backend.tasks leaves generate_heatmap_screenshot undiscovered by workers: app.autodiscover_tasks() imports <app>.tasks, but the new tasks/__init__.py is empty and never imports tasks.heatmap_screenshot. In production, calls to .delay() will enqueue products.web_analytics.backend.tasks.heatmap_screenshot.generate_heatmap_screenshot, and workers that haven't imported that module will treat it as an unregistered task, so screenshot jobs can stay stuck in processing.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a valid one

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues PostHog’s product-isolation work by moving Web Analytics Django models (and a sizable chunk of related web analytics query/API/task code) out of monolithic posthog/* into products/web_analytics/backend/*, while keeping existing DB tables in place via state-only migrations and a ContentType relabel migration.

Changes:

  • Introduces the web_analytics Django app (WebAnalyticsConfig), adds state-only migrations to “move” models, and migrates ContentTypes from posthogweb_analytics.
  • Relocates Web Analytics models, heatmaps API/task code, and updates imports/routes across the backend (plus generated frontend API clients).
  • Moves/duplicates a large set of web analytics HogQL query runners/utilities and adds/updates extensive test coverage and snapshots.

Reviewed changes

Copilot reviewed 79 out of 116 changed files in this pull request and generated no comments.

Show a summary per file
File Description
products/web_analytics/mcp/tools.yaml Adds (disabled) MCP tool definitions for heatmaps/saved/presets endpoints.
products/web_analytics/frontend/generated/api.zod.ts Adds Zod schemas for web analytics filter presets + heatmap saved endpoints.
products/web_analytics/frontend/generated/api.ts Adds generated TS client functions for new web analytics endpoints.
products/web_analytics/frontend/generated/api.schemas.ts Adds generated TS types for presets/heatmaps saved endpoints.
products/web_analytics/dags/web_preaggregated_asset_checks.py Updates WebOverviewQueryRunner import path into product app.
products/web_analytics/backend/weekly_digest.py Updates HogQL query runner imports into product app.
products/web_analytics/backend/test/test_heatmaps_api.py Adds tests for legacy heatmap endpoint behavior.
products/web_analytics/backend/test/test_heatmap_screenshots.py Updates model imports + patch targets to product app modules.
products/web_analytics/backend/tasks/test/test_heatmap_screenshot.py Updates imports/patch targets for moved heatmap screenshot task + models.
products/web_analytics/backend/tasks/test/init.py Test package init.
products/web_analytics/backend/tasks/heatmap_screenshot.py Moves/updates heatmap screenshot task to product app, updates imports.
products/web_analytics/backend/tasks/init.py Adds tasks package for the product app.
products/web_analytics/backend/models/web_analytics_filter_preset.py Moves preset model, updates FK string refs, sets db_table.
products/web_analytics/backend/models/heatmap_saved.py Moves heatmap models, updates FK string refs, sets db_table.
products/web_analytics/backend/models/init.py Adds product-app model barrel exports.
products/web_analytics/backend/migrations/max_migration.txt Adds product-app max migration marker.
products/web_analytics/backend/migrations/0001_initial.py Adds state-only initial migration for moved models.
products/web_analytics/backend/migrations/init.py Migration package init.
products/web_analytics/backend/hogql_queries/web_vitals_path_breakdown.py Updates imports to product-app query runner base.
products/web_analytics/backend/hogql_queries/web_trends_query_runner.py Updates imports to product-app query runner base/builders.
products/web_analytics/backend/hogql_queries/web_overview.py Updates imports to product-app query runner base/builders.
products/web_analytics/backend/hogql_queries/web_overview_pre_aggregated.py Updates imports to product-app pre-aggregated builder/properties.
products/web_analytics/backend/hogql_queries/web_goals.py Updates imports to product-app query runner base.
products/web_analytics/backend/hogql_queries/web_analytics_query_runner.py Updates imports for metrics + traffic type helpers into product app.
products/web_analytics/backend/hogql_queries/trends_pre_aggregated_query_builder.py Updates imports to product-app pre-aggregated modules.
products/web_analytics/backend/hogql_queries/traffic_type.py Updates BOT_DEFINITIONS import to product app.
products/web_analytics/backend/hogql_queries/test/web_preaggregated_test_base.py Adds shared test base for pre-aggregated web analytics tests.
products/web_analytics/backend/hogql_queries/test/test_web_vitals_path_breakdown.py Updates test imports for moved query runner.
products/web_analytics/backend/hogql_queries/test/test_web_trends_query_runner.py Updates test imports for moved query runner.
products/web_analytics/backend/hogql_queries/test/test_web_traffic_type.py Updates test imports for moved traffic_type helpers.
products/web_analytics/backend/hogql_queries/test/test_web_stats_table.py Updates test imports + patch targets for moved stats table.
products/web_analytics/backend/hogql_queries/test/test_web_stats_table_pre_aggregated_conversions.py Updates test imports for moved modules/builders.
products/web_analytics/backend/hogql_queries/test/test_web_stats_pre_aggregated.py Updates test imports for moved modules/builders.
products/web_analytics/backend/hogql_queries/test/test_web_stats_pre_aggregated_channel_types.py Updates test imports for moved modules/builders.
products/web_analytics/backend/hogql_queries/test/test_web_overview.py Updates test imports for moved modules/builders.
products/web_analytics/backend/hogql_queries/test/test_web_overview_state_aggregations.py Updates test imports for moved web_overview runner.
products/web_analytics/backend/hogql_queries/test/test_web_overview_dashboard_filters.py Updates test imports for moved web_overview runner.
products/web_analytics/backend/hogql_queries/test/test_web_goals.py Updates test imports for moved web_goals runner.
products/web_analytics/backend/hogql_queries/test/test_web_bounces_pre_aggregated.py Updates test imports for moved modules.
products/web_analytics/backend/hogql_queries/test/test_web_analytics_rbac.py Updates test imports for moved web_overview runner.
products/web_analytics/backend/hogql_queries/test/test_web_analytics_query_runner.py Updates test imports + patch targets for moved query runner.
products/web_analytics/backend/hogql_queries/test/test_web_analytics_metrics.py Updates test imports + patch targets for moved metrics/query runner.
products/web_analytics/backend/hogql_queries/test/test_web_analytics_cohort_filter.py Updates test imports for moved query runners.
products/web_analytics/backend/hogql_queries/test/test_trends_pre_aggregated_query_builder.py Updates test imports for moved builder.
products/web_analytics/backend/hogql_queries/test/test_traffic_type_snapshot.py Adds snapshot tests for traffic type HogQL helpers.
products/web_analytics/backend/hogql_queries/test/test_session_attribution_explorer_query_runner.py Updates test imports for moved session attribution runner.
products/web_analytics/backend/hogql_queries/test/test_sample_web_analytics_queries.py Updates test imports for moved query runners.
products/web_analytics/backend/hogql_queries/test/test_page_url_search_query_runner.py Updates test imports for moved page URL search runner.
products/web_analytics/backend/hogql_queries/test/test_page_reports_avg_time.py Adds tests for p90 time-on-page reporting behavior.
products/web_analytics/backend/hogql_queries/test/test_notable_changes.py Updates test imports for moved notable changes runner.
products/web_analytics/backend/hogql_queries/test/test_external_clicks_table.py Updates test imports for moved external clicks runner.
products/web_analytics/backend/hogql_queries/test/test_events_prefilter.py Adds/updates tests for events prefilter transformer/paginator.
products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py Updates test import for moved bot definitions.
products/web_analytics/backend/hogql_queries/test/snapshots/test_web_vitals_path_breakdown.ambr Adds snapshot baseline for web vitals path breakdown SQL.
products/web_analytics/backend/hogql_queries/test/snapshots/test_active_hours_heatmap_query_runner.ambr Adds snapshot baseline for active hours heatmap SQL.
products/web_analytics/backend/hogql_queries/test_web_analytics_tables_version.py Updates query runner imports for table-version tests.
products/web_analytics/backend/hogql_queries/stats_table.py Updates imports and adds events prefilter paginator wiring.
products/web_analytics/backend/hogql_queries/stats_table_strategies.py Updates imports for stats table query constants/typing.
products/web_analytics/backend/hogql_queries/stats_table_pre_aggregated.py Updates imports for moved pre-aggregated property mapping/builder.
products/web_analytics/backend/hogql_queries/session_attribution_explorer_query_runner.py Adds moved session attribution explorer query runner.
products/web_analytics/backend/hogql_queries/query_constants/stats_table_queries.py Adds SQL templates for stats table strategies.
products/web_analytics/backend/hogql_queries/query_constants/init.py Package init for query constants.
products/web_analytics/backend/hogql_queries/pre_aggregated/query_builder.py Updates imports for moved pre-aggregated property transformer.
products/web_analytics/backend/hogql_queries/pre_aggregated/property_transformer.py Adds moved property transformer + channel type replacer.
products/web_analytics/backend/hogql_queries/pre_aggregated/properties.py Adds moved pre-aggregated property mappings.
products/web_analytics/backend/hogql_queries/page_url_search_query_runner.py Updates imports for moved query runner base.
products/web_analytics/backend/hogql_queries/notable_changes.py Updates imports for moved pre-aggregated modules/query runner base.
products/web_analytics/backend/hogql_queries/metrics.py Adds moved Prometheus metrics for web analytics query runners.
products/web_analytics/backend/hogql_queries/external/test/test_summary_query_runner.py Updates imports/patch targets for moved external summary runner.
products/web_analytics/backend/hogql_queries/external/test/init.py Test package init.
products/web_analytics/backend/hogql_queries/external/summary_query_runner.py Adds external (S3/chdb) web analytics summary query runner.
products/web_analytics/backend/hogql_queries/external/init.py Package init.
products/web_analytics/backend/hogql_queries/external_clicks.py Updates imports for moved query runner base.
products/web_analytics/backend/hogql_queries/events_prefilter.py Adds events prefilter transformer + specialized paginator.
products/web_analytics/backend/hogql_queries/ctes.py Adds SQL CTE constants used by web analytics queries.
products/web_analytics/backend/hogql_queries/bot_ua_fixtures.py Adds UA fixture lists for bot/traffic-type testing + demo data.
products/web_analytics/backend/hogql_queries/bot_definitions.py Adds bot definition mapping for HogQL traffic type functions.
products/web_analytics/backend/hogql_queries/init.py Package init.
products/web_analytics/backend/apps.py Adds WebAnalyticsConfig app config (name/label).
products/web_analytics/backend/api/web_analytics_filter_preset.py Updates model import to product app.
products/web_analytics/backend/api/heatmaps_utils.py Adds DEFAULT_TARGET_WIDTHS constant under product app.
products/web_analytics/backend/api/heatmaps_api.py Updates imports to product models/task + constants.
products/web_analytics/backend/api/api.py Adds WebAnalytics weekly digest endpoint ViewSet.
products/web_analytics/backend/api/init.py Exports WebAnalyticsViewSet.
products/ruff.toml Exempts web_analytics backend from ANN typing rule enforcement.
posthog/test/base.py Updates patching hooks for moved web analytics query modules.
posthog/tasks/test/snapshots/test_task_registration.ambr Updates snapshot (removes moved heatmap screenshot task from posthog.*).
posthog/tasks/init.py Stops importing heatmap_screenshot from monolithic tasks package.
posthog/settings/web.py Registers products.web_analytics.backend app config.
posthog/models/web_preaggregated/test_web_preaggregated_sql.py Updates imports for moved web preaggregated test base.
posthog/models/web_preaggregated/test_web_pre_aggregated_timezones.py Updates imports + patch targets for moved stats table.
posthog/models/init.py Removes re-exports for moved heatmap/preset models.
posthog/migrations/max_migration.txt Bumps max migration pointer to 1168.
posthog/migrations/1168_migrate_web_analytics_models.py Adds state-only model removal + ContentType relabel migration.
posthog/management/commands/generate_bot_demo_data.py Updates UA fixtures import to product app.
posthog/hogql/transforms/test/test_preaggregated_table_transformation.py Updates imports for moved pre-aggregated property mappings.
posthog/hogql/transforms/preaggregated_table_transformation.py Updates imports for moved pre-aggregated property mappings.
posthog/hogql/functions/traffic_type.py Updates bot definitions import path + docstring reference.
posthog/hogql/functions/test/test_traffic_type_real_ua.py Updates imports for moved bot definitions/fixtures.
posthog/hogql/functions/test/test_traffic_type_functions.py Updates import for moved bot definitions.
posthog/hogql/database/schema/sessions_v3.py Updates comment reference to moved session attribution runner.
posthog/hogql/database/schema/sessions_v2.py Updates comment reference to moved session attribution runner.
posthog/hogql/database/schema/sessions_v1.py Updates comment reference to moved session attribution runner.
posthog/hogql_queries/query_runner.py Repoints web analytics query runner imports into product app.
posthog/api/init.py Repoints heatmaps + filter preset ViewSet imports into product app.
livestream/bot/generate_definitions.py Updates bot definitions import path for generator script.
Comments suppressed due to low confidence (1)

products/web_analytics/backend/tasks/heatmap_screenshot.py:18

  • Since this task module moved under products.web_analytics.backend.tasks.*, the Celery task name will change (default name derives from the module path). That can break execution of any in-flight queued messages still referencing the old name (posthog.tasks.heatmap_screenshot.generate_heatmap_screenshot). Consider explicitly setting name= on the @shared_task decorator (or keeping a thin compatibility module at the old import path).

Also ensure this module is imported during Celery autodiscovery: app.autodiscover_tasks() will import products.web_analytics.backend.tasks, but if that package doesn’t import heatmap_screenshot, the task won’t be registered on workers.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ytics-models-to-product

# Conflicts:
#	posthog/migrations/max_migration.txt
#	posthog/settings/web.py
#	products/web_analytics/backend/hogql_queries/test/test_web_analytics_cohort_filter.py
#	products/web_analytics/backend/hogql_queries/test/test_web_goals.py
#	products/web_analytics/backend/hogql_queries/test/test_web_overview.py
#	products/web_analytics/backend/hogql_queries/test/test_web_overview_lazy_precompute.py
#	products/web_analytics/backend/hogql_queries/test/test_web_stats_table.py
#	products/web_analytics/backend/hogql_queries/test/test_web_stats_table_pre_aggregated_conversions.py
#	products/web_analytics/backend/hogql_queries/web_analytics_query_runner.py
#	products/web_analytics/backend/hogql_queries/web_goals.py
#	products/web_analytics/backend/hogql_queries/web_overview.py
#	products/web_analytics/backend/hogql_queries/web_overview_lazy_precompute.py
Copy link
Copy Markdown
Collaborator

@mariusandra mariusandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hogql unblock

webjunkie added 2 commits May 22, 2026 10:19
…ytics-models-to-product

Renumber migration 1170 -> 1176 to slot in after the new master leaf
(1175_drop_alertconfiguration_is_calculating_column). Drop the stale
1168 file that survived a previous renumber and was producing the
duplicate migration leaf nodes blowing up CI.

Align the lazy precompute test's mock patch path with the new
products/web_analytics location and update the livestream bot docstring
pointer.
@github-actions
Copy link
Copy Markdown
Contributor

ClickHouse migration SQL per cloud environment

No ClickHouse migrations changed in this PR.

webjunkie added 2 commits May 22, 2026 10:46
ruff I001 — the file came in via merge with master and the rearranged
imports (after the file move from posthog/ to products/) tripped the
import sort check.
web_overview_lazy_precompute and its test (came in from master via #59075)
import from products.analytics_platform — that was fine while the file
lived under posthog/, but moving it into products/web_analytics/ tightens
the tach boundary. analytics_platform has no facade, so allow the raw
dep here (same pattern posthog uses).
webjunkie added 3 commits May 22, 2026 10:58
ruff format wants single-line ContentType chains; the older multi-line
shape carried over when the file was renamed across master merges. Local
ruff check passed but ruff format --check (separate CI step) didn't.
@webjunkie
Copy link
Copy Markdown
Contributor Author

@mendral-app is the CI failure from my branch?


@posthog/products-web-analytics:backend:test: =================================== FAILURES ===================================
@posthog/products-web-analytics:backend:test: ______ TestWebOverviewLazyPrecompute.test_lazy_result_matches_raw_result _______
@posthog/products-web-analytics:backend:test: backend/hogql_queries/test/test_web_overview_lazy_precompute.py:129: in test_lazy_result_matches_raw_result
@posthog/products-web-analytics:backend:test:     assert lazy_visitors == raw_visitors, f"visitors mismatch: lazy={lazy_visitors}, raw={raw_visitors}"
@posthog/products-web-analytics:backend:test: E   AssertionError: visitors mismatch: lazy=0.0, raw=2.0
@posthog/products-web-analytics:backend:test: E   assert 0.0 == 2.0
@posthog/products-web-analytics:backend:test: --------------------------- snapshot report summary ----------------------------
@posthog/products-web-analytics:backend:test: 291 snapshots passed.
@posthog/products-web-analytics:backend:test: =========================== short test summary info ============================
@posthog/products-web-analytics:backend:test: FAILED backend/hogql_queries/test/test_web_overview_lazy_precompute.py::TestWebOverviewLazyPrecompute::test_lazy_result_matches_raw_result - AssertionError: visitors mismatch: lazy=0.0, raw=2.0
@posthog/products-web-analytics:backend:test: assert 0.0 == 2.0
@posthog/products-web-analytics:backend:test: ================== 1 failed, 657 passed in 983.05s (0:16:23) ===================

@mendral-app
Copy link
Copy Markdown
Contributor

mendral-app Bot commented May 22, 2026

This failure is very unlikely to be caused by your branch. Here's why:

  1. Your PR moves models (SavedHeatmap, WebAnalyticsFilterPreset) that are completely unrelated to the lazy precompute logic being tested.

  2. All other precompute tests pass — notably the parameterized test_lazy_result_matches_raw_for_whole_hour_timezones_* variants (UTC, Pacific, Tokyo) all succeed. If this were an import/path issue from your refactor, all of these would break too.

  3. The failure pattern (lazy=0.0, raw=2.0) suggests a timing/race condition where the precomputed cache returns empty results — this is characteristic of a flaky test with ClickHouse data availability timing, not a broken import path.

  4. The test file doesn't use any of the models you moved — it only imports WebOverviewQueryRunner and PreaggregationJob, both of which have their imports correctly updated in your PR.

TL;DR: This looks like a pre-existing flaky test. You should be safe to re-run CI or merge once the other checks pass.

@webjunkie webjunkie merged commit e675413 into master May 22, 2026
312 of 316 checks passed
@webjunkie webjunkie deleted the chore/move-web-analytics-models-to-product branch May 22, 2026 10:16
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented May 22, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-05-22 11:59 UTC Run
prod-us ✅ Deployed 2026-05-22 12:13 UTC Run
prod-eu ✅ Deployed 2026-05-22 12:15 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants