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: scaffold engineering_analytics product files (#58888)

Raúl Negrón-Oterocf0413cc48ae
diff --git a/frontend/package.json b/frontend/package.json
index 746c47e236ec..68adde5da010 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -85,6 +85,7 @@
"@posthog/products-deployments": "workspace:*",
"@posthog/products-early-access-features": "workspace:*",
"@posthog/products-endpoints": "workspace:*",
+ "@posthog/products-engineering-analytics": "workspace:*",
"@posthog/products-error-tracking": "workspace:*",
"@posthog/products-experiments": "workspace:*",
"@posthog/products-feature-flags": "workspace:*",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e62ed5a1b044..647540253740 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -645,6 +645,9 @@ importers:
'@posthog/products-endpoints':
specifier: workspace:*
version: link:../products/endpoints
+ '@posthog/products-engineering-analytics':
+ specifier: workspace:*
+ version: link:../products/engineering_analytics
'@posthog/products-error-tracking':
specifier: workspace:*
version: link:../products/error_tracking
@@ -2554,6 +2557,8 @@ importers:
specifier: 18.3.1
version: 18.3.1
+ products/engineering_analytics: {}
+
products/error_tracking:
dependencies:
'@dnd-kit/core':
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index d4f6602df4cc..6715fc2c66d4 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -84,6 +84,7 @@ PRODUCTS_APPS = [
"products.actions.backend.apps.ActionsConfig",
"products.product_analytics.backend.apps.ProductAnalyticsConfig",
"products.wizard.backend.apps.WizardConfig",
+ "products.engineering_analytics.backend.apps.EngineeringAnalyticsConfig",
]
INSTALLED_APPS = [
diff --git a/products/engineering_analytics/README.md b/products/engineering_analytics/README.md
new file mode 100644
index 000000000000..fedc31b15c48
--- /dev/null
+++ b/products/engineering_analytics/README.md
@@ -0,0 +1,128 @@
+# Engineering analytics
+
+Owner: team-devex. Engineering contract: [SPEC.md](./SPEC.md).
+
+## The one-sentence version
+
+**It's product analytics, but the "users" are pull requests and the "events" are what happens to them on the way to production.**
+
+Everything else is mechanics.
+
+## The analogy
+
+If you understand PostHog product analytics, you understand this. Map it one-to-one:
+
+| Product analytics | Engineering analytics |
+| ---------------------------------------- | ---------------------------------------------- |
+| A **person** does things in your app | A **PR** moves through your pipeline |
+| Events: `pageview`, `signup`, `purchase` | Events: `opened`, `ready_for_review`, `merged` |
+| "How long from signup to purchase?" | "How long from opened to merged?" |
+| "What % of signups convert?" (funnel) | "What % of PRs make it to prod?" (funnel) |
+| "Is conversion getting better?" (trend) | "Is CI getting faster?" (trend) |
+| Segment by country, plan, browser | Segment by repo, author, file path |
+
+Same product, different noun.
+
+## The shape of the thing
+
+```text
+A PR's life, as a stream of timestamped events:
+
+opened ──> ready_for_review ──> ci_passed ──> approved ──> merged ──> deployed
+ │ │ │ │ │ │
+t=0 t=2h t=2h15m t=4h t=4h30m t=5h
+
+Engineering analytics measures every gap:
+ opened→ready = how long it sat as a draft
+ ready→merged = THE NORTH STAR (shorten this)
+ any→ci_passed = how long CI took to go green
+ merged→deployed = ship latency
+
+Then averages each gap across all PRs, and trends it over weeks.
+DevEx's job: watch those gaps shrink.
+```
+
+The product is: **measure every gap in a PR's life, average it, and watch it shrink.**
+
+## A moment of use
+
+The primary surface is MCP tools. You're in Claude Code and you ask:
+
+> "Is CI getting faster or slower on posthog/posthog over the last 8 weeks?"
+
+A tool runs HogQL over the PR/CI data and answers:
+
+> CI time-to-green: median dropped from 14m to 9m over 8 weeks (good). But p95 rose
+> from 31m to 47m — a long tail of PRs is getting stuck. Worst offender is the
+> `e2e-playwright` workflow on `products/web_analytics`. Want the slow PRs?
+
+That grounded, trended, segmented answer **is the product.** The read-only UI is just a prettier rendering of the same data for show-and-tell.
+
+## Why this exists
+
+PostHog already has the two ends of its own AI-to-prod loop:
+
+```text
+PostHog Code engineering_analytics PostHog product analytics
+(generates code, → (CI / review / merge / deploy) → (events, errors, flags,
+ opens PRs) surveys, replays)
+ ↑ │
+ └─────────── signals feed back to PostHog Code ───────────┘
+```
+
+The middle — what happens to code between "PR opened" and "running in production" — is invisible to both ends today. Engineering analytics fills it, serving two consumers with the same tools:
+
+- **Engineers** driving an agent (Claude Code, Cursor, PostHog AI) asking about their monorepo. We dogfood on `PostHog/posthog` from day one.
+- **PostHog Code** itself, autonomously, calling the same tools on its own PRs — to diagnose why a PR is stuck, decide whether to retry, and eventually see how a merged change behaved in production.
+
+Tool return shapes must be legible to an autonomous agent, not just renderable in chat: typed contracts with explicit `metric_quality` markers, never prose an LLM might paraphrase wrong.
+
+## v1 vs the destination
+
+The specs read as cautious ("coarse", "deferred", "later") because they're written around a **data-availability constraint**, not the product. Strip the constraint and it's simple:
+
+- **Destination:** every PR is a stream of lifecycle events. Every gap is measurable and trendable. Ask any question in natural language; get a grounded answer. Funnels, retention, cohorts — all PostHog tooling — on PRs.
+- **v1 (ships first):** only the gaps measurable from today's snapshot warehouse data — total open time, CI duration. Honest, partial, useful immediately.
+
+The gap between them is **just data ingestion** (the path from warehouse snapshots to lifecycle events). v1 lives on HogQL over `github_pull_requests` + `github_workflow_runs`; no event ingestion, no PR-as-group-type, no webhook receiver yet.
+
+## Locked decisions
+
+Change one only in a separate PR with a written reason. Engineering-level decisions live in [SPEC.md](./SPEC.md) → Locked decisions.
+
+- Two motivations: (A) DevEx dogfood, (B) close the dark middle in PostHog's AI-to-prod loop. Both must be served by every design decision.
+- Two consumer classes: human-driven agents (primary) and agent-driven agents like PostHog Code (secondary, designed-for-now).
+- Unit of value = the open PR.
+- Phase model: draft (experimentation, low rigor) vs ready-for-review (high stakes).
+- North star: shorten ready-for-review-to-merge without removing useful friction.
+- Wedge = end-to-end code visibility, served as MCP tools to PostHog Code (autonomous) and engineers using PostHog MCP (human-driven).
+- Tool return shapes = typed Python (pydantic / dataclasses) with explicit `metric_quality` markers (`precise | coarse | partial`). Not free-form prose.
+- Validation UI = demo surface. Read-only. Capped at the design-system showcase. No saved views — saved state lives in agent memory, not Postgres.
+- v1 data path = HogQL on warehouse. Event ingestion deferred. Product Postgres DB stays empty.
+- Author identity = `Author{handle, display_name, avatar_url, is_bot}`. No PostHog-user mapping in v1.
+- Bots and drafts excluded by default in throughput / cycle-time tools; bots are first-class in bot-impact analysis (don't strip them everywhere).
+- Bot detection = `handle.endswith("[bot]") OR handle in KNOWN_BOT_HANDLES`. Hardcoded allowlist for v1.
+- `time_to_merge` v1 = `merged_at - created_at` (draft + ready-for-review combined), marked coarse on the return shape.
+- CI granularity = workflow level (`github_workflow_runs`). Job-level is a later add.
+- `pull_request_reviews` warehouse source deferred until the wedge tool is built.
+- No privacy guardrails in v1; revisit if scope widens beyond the team-devex maintainer.
+
+## Glossary
+
+| Term | Definition |
+| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **PR (unit of value)** | An open GitHub pull request, draft or ready-for-review — the atomic thing this product measures |
+| **Draft phase** | Experimentation. Low-rigor measurement. Selective tests + advisory bots are OK |
+| **Ready-for-review phase** | High-stakes. Where DevEx measures aggressively |
+| **Good friction** | Tests / bots / checks that catch real problems. Kept and optimized |
+| **Bad friction** | Tests / bots / checks that engineers ignore or that fail for unrelated reasons. Removed |
+| **Wedge** | End-to-end code visibility: code tracked from written → CI / review → live, served via MCP to PostHog Code and engineers using PostHog MCP |
+| **MCP tool** | A function the agent calls. Its description is a production prompt |
+| **Surface** | Primary = MCP tools; secondary = read-only demo UI |
+| **Human-driven agent** | Claude Code / Cursor / PostHog AI invoked by an engineer typing |
+| **Agent-driven agent** | An autonomous agent (e.g. PostHog Code) invoking MCP tools without a human in the loop |
+| **The AI-to-prod loop** | PostHog Code → engineering_analytics → PostHog product analytics → feedback to PostHog Code. The full lifecycle of agent-generated code, instrumented |
+| **The dark middle** | The CI / review / merge / deploy steps between PostHog Code and PostHog product analytics, currently invisible to both |
+| **`time_to_merge` (v1)** | `merged_at - created_at`. PR open to merge — combines draft + ready-for-review until state-transition data lands. Marked coarse on the return shape |
+| **Workflow** | A GitHub Actions workflow run on a PR's head commit. One row in `github_workflow_runs`. v1 CI granularity; job-level is a later add |
+| **Bot** | An `Author` with `is_bot = True`. Detection: `handle.endswith("[bot]") OR handle in KNOWN_BOT_HANDLES` |
diff --git a/products/engineering_analytics/SPEC.md b/products/engineering_analytics/SPEC.md
new file mode 100644
index 000000000000..07effb64c6d1
--- /dev/null
+++ b/products/engineering_analytics/SPEC.md
@@ -0,0 +1,186 @@
+# engineering_analytics — Engineering Spec
+
+Owner: team-devex
+Sibling doc: [README.md](./README.md) — read that first for the product picture, motivations, and the wedge. This file is the engineering contract: architecture, canonical types, file layout, ordering.
+
+## 1. Purpose
+
+Engineering contract for the `products/engineering_analytics/` product. The product surfaces PR + CI lifecycle data from the warehouse (`github_pull_requests`, `github_workflow_runs`) as MCP tools and DRF endpoints. Consumers and motivations are in the README.
+
+## 2. Non-goals
+
+- Per-developer surveillance metrics or rankings. Filters operate at cohort level by default.
+- Real-time alerting on individual PRs. That's notification surface, not analytics.
+- Replacing GitHub's own UI. We surface signal, not the raw PR thread.
+- Code-quality static analysis. Different product space.
+
+## 3. Architecture
+
+```mermaid
+graph TB
+ subgraph Consumers
+ MCP[MCP clients - Claude Code / Cursor / PostHog AI]
+ UI[Read-only demo UI - React + kea]
+ Other[PostHog Code and other agent-driven callers]
+ end
+
+ subgraph "Surface (autogen)"
+ Tools["MCP tools<br/>(tools.yaml -> codegen)"]
+ DRF["DRF viewsets<br/>(@extend_schema)"]
+ end
+
+ subgraph Domain
+ Facade["facade/api.py<br/>(public interface, canonical types)"]
+ Logic["logic/<br/>(metric definitions)"]
+ Queries["logic/queries/<br/>(HogQL queries, GitHub-shaped)"]
+ end
+
+ subgraph Storage
+ WH[(warehouse<br/>github_pull_requests<br/>github_workflow_runs)]
+ end
+
+ MCP --> Tools
+ UI --> DRF
+ Other --> Tools
+ Tools --> DRF
+ DRF --> Facade
+ Facade --> Logic
+ Logic --> Queries
+ Queries --> WH
+```
+
+Rules:
+
+- HogQL via `execute_hogql_query()` is the only data access pattern. No raw ClickHouse `sync_execute()`.
+- Django ORM is not used by this product. There is no product Postgres DB in v1 — see README → Locked decisions.
+- `logic/queries/` is the only module that names warehouse tables (`github_pull_requests`, `github_workflow_runs`). Logic and facade work with canonical types only.
+- One contract feeds both surfaces: DRF viewsets with `@extend_schema` produce OpenAPI → TypeScript types AND MCP tool descriptions. Logic functions are called by both.
+- Every MCP-tools PR ships with a matching in-product skill at `skills/<name>/SKILL.md` so the dogfooder has an installed playbook for chaining tool calls — same pattern as `products/visual_review/skills/triaging-visual-review-runs/`.
+- Provider abstraction (`CodeHostProvider` Protocol) is **deferred**. GitHub-specific HogQL lives in `logic/queries/` directly; when a second provider lands, the Protocol is extracted then. See §7.
+
+## 4. Canonical types
+
+Defined in `backend/facade/contracts.py` as `pydantic.dataclasses.dataclass(frozen=True)` — same `is_dataclass()` semantics as the stdlib variant (so `DataclassSerializer` works) but with runtime validation at construction. No Django imports.
+
+```mermaid
+classDiagram
+ class RepoRef {
+ +str provider
+ +str owner
+ +str name
+ }
+ class Author {
+ +str handle
+ +str display_name
+ +str avatar_url
+ +bool is_bot
+ }
+ class PRState {
+ <<enum>>
+ OPEN
+ CLOSED
+ MERGED
+ }
+ class WorkflowConclusion {
+ <<enum>>
+ SUCCESS
+ FAILURE
+ CANCELLED
+ SKIPPED
+ TIMED_OUT
+ NEUTRAL
+ }
+ class PullRequest {
+ +int id
+ +int number
+ +str title
+ +Author author
+ +RepoRef repo
+ +PRState state
+ +bool is_draft
+ +datetime created_at
+ +datetime merged_at
+ +datetime closed_at
+ }
+ class WorkflowRun {
+ +int id
+ +str workflow_name
+ +str head_sha
+ +WorkflowConclusion conclusion
+ +datetime run_started_at
+ +datetime updated_at
+ +int duration_seconds
+ }
+ PullRequest --> Author
+ PullRequest --> RepoRef
+ PullRequest --> PRState
+ WorkflowRun --> WorkflowConclusion
+```
+
+`is_bot` on `Author` is set inside the query / mapping layer:
+`is_bot = handle.endswith("[bot]") OR handle in KNOWN_BOT_HANDLES`.
+
+Tool-specific return types (`WorkflowReport`, `TimeToMerge`, `PRLifecycle`) live in `facade/contracts.py` alongside the canonical types. They wrap rows + a `metric_quality` field per README → Locked decisions.
+
+Types named in the README but not in v1 contracts (reviewers, deploys, file paths) wait until the corresponding warehouse data lands.
+
+## 5. v1 tool catalog
+
+Tools live in `products/engineering_analytics/mcp/tools.yaml`. Each tool description is prompt-engineered — it explains to the calling LLM **when** and **why** to call it, not just the parameter list. Tool return shapes are typed contracts, not free-form prose (README → Locked decisions).
+
+| Tool | Source data | Returns | Quality |
+| ----------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
+| `workflow_report` | `github_workflow_runs` | `list[WorkflowReportRow]` — workflow name, total runs, success rate, median + p95 duration, last failed at | precise |
+| `time_to_merge` | `github_pull_requests` | `list[TimeToMergeRow]` — `bucket` (overall or per author), pr_count, median + p95 seconds | coarse (combines draft + ready-for-review time) |
+| `pr_lifecycle` | both | `PRLifecycle` — PR header + timeline of CI run events | partial (no reviews/comments until reviews data lands) |
+
+All tools accept `date_from` / `date_to` per PostHog convention (relative `-7d` or ISO8601). Optional `repo` filter on the first two.
+
+UI: one read-only scene rendering `workflow_report` as a horizontal bar chart of slowest workflows. Design system showcase only. No filters, no kea forms, no saved views.
+
+## 6. Delivery shape
+
+Vertical slices, each independently mergeable — a feature PR delivers a complete read path (HogQL → logic → facade → DRF → MCP), not a horizontal layer. The near-term path: this scaffold, then the `github_workflow_runs` source, then the first MCP tools (`workflow_report` + `time_to_merge` + `pr_lifecycle`) with a matching `skills/<name>/SKILL.md`, then the read-only UI scene. Beyond that, sequencing follows the data — see §9.
+
+## 7. Locked decisions
+
+Engineering-specific decisions. Product-level decisions live in README → Locked decisions. If you want to change one, do it in a separate PR with a written reason.
+
+- **HogQL only for analytics data.** No raw ClickHouse.
+- **No product Postgres DB.** Saved state lives in the agent's memory; tool calls are stateless. No `db_routing.yaml` entry — analytics data is in the warehouse / ClickHouse (shared infra, nothing to provision). If a product-config model is ever needed, it goes on the **main** DB as a team-scoped model (`TeamScopedRootMixin`), not a separate DB.
+- **Provider abstraction deferred.** No `CodeHostProvider` Protocol in v1. GitHub-shaped HogQL lives in `logic/queries/`. The boundary between `logic/queries/` and `logic/` is the future Protocol seam — keep canonical types above it, GitHub-isms below.
+- **Canonical types live in `facade/contracts.py`** as frozen dataclasses. No Django imports, no provider-specific fields.
+- **CI granularity = workflow level** (`github_workflow_runs`). Job-level breakdown requires a new warehouse endpoint and is deferred.
+- **Bot detection** lives in the query / mapping layer: `handle.endswith("[bot]") OR handle in KNOWN_BOT_HANDLES`. Hardcoded allowlist for v1; per-team config deferred.
+- **Bots and drafts excluded by default** in PR-listing / cycle-time tools. They are first-class in any future bot-impact analysis (don't strip them everywhere).
+- **`time_to_merge` v1** = `merged_at - created_at`. Marked `metric_quality = "coarse"`. Precise companion lands when state-transition data exists.
+- **Tool return shapes** = typed pydantic / dataclasses with explicit `metric_quality` marker (`"precise" | "coarse" | "partial"`). Repo convention.
+
+## 8. Deferred (engineering) decisions
+
+Use the current default; revisit when the relevant data lands (§9).
+
+- Team taxonomy (CODEOWNERS vs config file vs author allowlist) — defer until team-level rollups are asked for.
+- Cycle time variants (first-commit, ready-for-review, first-approval) — need review + state-transition data.
+- Deploy definition (deployment events vs named workflow vs tag push) — decide when deploy data lands.
+- Path-based filtering (which files a PR touched) — not in the current snapshot; comes with the lifecycle-event data.
+- Commits-till-merged — same; comes with the lifecycle-event data.
+- Provider Protocol — wait for a second provider. The query-layer boundary is already drawn to make extraction mechanical.
+
+## 9. Data sources
+
+Available now (warehouse snapshots, queried via HogQL):
+
+- `github_pull_requests` — PR snapshot: number, title, author, state, created_at, merged_at, closed_at, draft flag, base/head refs. Current state only — transitions are overwritten on update.
+- `github_workflow_runs` — CI runs: workflow name, status, conclusion, run_started_at, updated_at, head SHA. Each run is immutable, so durations and their trends are precise.
+
+These bound v1 to coarse PR timing (no transition history) and workflow-level CI (no per-check detail).
+
+Beyond v1 the product needs lifecycle data the snapshots can't hold: PR state transitions (draft↔ready), reviews and approvals, per-check/job CI, and deploys. The likely path is **GitHub webhooks → PostHog events, with the PR as a group type** — one mechanism that delivers all of these as immutable timestamped events, while the warehouse snapshots stay as the current-state/backfill layer. PostHog already runs a GitHub App webhook receiver, so this is an analytics handler on existing infra, not new infra. A per-primitive warehouse-source poll is the heavier alternative and still can't recover transition timing, so it's not the plan. See README → "v1 vs the destination".
+
+## 10. Reference reading
+
+- [README.md](./README.md) — product picture, motivations, locked decisions, glossary (read this first)
+- `products/architecture.md` — folder structure, isolation rules, tach + import-linter
+- `products/README.md` — how to scaffold a product
+- `posthog/models/scoping/README.md` — `TeamScopedRootMixin` contract (main-DB team-scoped model, for whenever the first config model lands)
diff --git a/products/engineering_analytics/__init__.py b/products/engineering_analytics/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/backend/__init__.py b/products/engineering_analytics/backend/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/backend/apps.py b/products/engineering_analytics/backend/apps.py
new file mode 100644
index 000000000000..e44233f3df2a
--- /dev/null
+++ b/products/engineering_analytics/backend/apps.py
@@ -0,0 +1,8 @@
+"""Django app configuration for engineering_analytics."""
+
+from django.apps import AppConfig
+
+
+class EngineeringAnalyticsConfig(AppConfig):
+ name = "products.engineering_analytics.backend"
+ label = "engineering_analytics"
diff --git a/products/engineering_analytics/backend/facade/__init__.py b/products/engineering_analytics/backend/facade/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/backend/facade/api.py b/products/engineering_analytics/backend/facade/api.py
new file mode 100644
index 000000000000..151275377b1d
--- /dev/null
+++ b/products/engineering_analytics/backend/facade/api.py
@@ -0,0 +1 @@
+"""Facade for engineering_analytics — the only module other products may import."""
diff --git a/products/engineering_analytics/backend/facade/contracts.py b/products/engineering_analytics/backend/facade/contracts.py
new file mode 100644
index 000000000000..0299fcdea35b
--- /dev/null
+++ b/products/engineering_analytics/backend/facade/contracts.py
@@ -0,0 +1 @@
+"""Contract types for engineering_analytics — frozen pydantic dataclasses, no Django imports."""
diff --git a/products/engineering_analytics/backend/logic/__init__.py b/products/engineering_analytics/backend/logic/__init__.py
new file mode 100644
index 000000000000..93ed15dd23ce
--- /dev/null
+++ b/products/engineering_analytics/backend/logic/__init__.py
@@ -0,0 +1 @@
+"""Business logic for engineering_analytics — metric definitions over canonical types."""
diff --git a/products/engineering_analytics/backend/logic/queries/__init__.py b/products/engineering_analytics/backend/logic/queries/__init__.py
new file mode 100644
index 000000000000..20a841e9c20e
--- /dev/null
+++ b/products/engineering_analytics/backend/logic/queries/__init__.py
@@ -0,0 +1,6 @@
+"""HogQL queries for engineering_analytics.
+
+The only module allowed to name warehouse tables (`github_pull_requests`,
+`github_workflow_runs`); logic and facade work with canonical types only.
+This boundary is the future code-host-provider seam.
+"""
diff --git a/products/engineering_analytics/backend/models.py b/products/engineering_analytics/backend/models.py
new file mode 100644
index 000000000000..5fc88d084ce8
--- /dev/null
+++ b/products/engineering_analytics/backend/models.py
@@ -0,0 +1,5 @@
+"""Django models for engineering_analytics.
+
+Intentionally empty — the warehouse is the source of truth for PR and CI data,
+and the product has no Postgres DB.
+"""
diff --git a/products/engineering_analytics/backend/presentation/__init__.py b/products/engineering_analytics/backend/presentation/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/backend/presentation/serializers.py b/products/engineering_analytics/backend/presentation/serializers.py
new file mode 100644
index 000000000000..e6137b96b4c3
--- /dev/null
+++ b/products/engineering_analytics/backend/presentation/serializers.py
@@ -0,0 +1 @@
+"""DRF serializers for engineering_analytics."""
diff --git a/products/engineering_analytics/backend/presentation/urls.py b/products/engineering_analytics/backend/presentation/urls.py
new file mode 100644
index 000000000000..e4aaa402f6ae
--- /dev/null
+++ b/products/engineering_analytics/backend/presentation/urls.py
@@ -0,0 +1,3 @@
+"""URL routes for engineering_analytics."""
+
+urlpatterns: list = []
diff --git a/products/engineering_analytics/backend/presentation/views.py b/products/engineering_analytics/backend/presentation/views.py
new file mode 100644
index 000000000000..59fa4a5e88ac
--- /dev/null
+++ b/products/engineering_analytics/backend/presentation/views.py
@@ -0,0 +1 @@
+"""DRF views for engineering_analytics."""
diff --git a/products/engineering_analytics/backend/tasks/__init__.py b/products/engineering_analytics/backend/tasks/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/backend/tasks/schedules.py b/products/engineering_analytics/backend/tasks/schedules.py
new file mode 100644
index 000000000000..1e5fe997e719
--- /dev/null
+++ b/products/engineering_analytics/backend/tasks/schedules.py
@@ -0,0 +1 @@
+"""Celery beat schedules for engineering_analytics."""
diff --git a/products/engineering_analytics/backend/tasks/tasks.py b/products/engineering_analytics/backend/tasks/tasks.py
new file mode 100644
index 000000000000..93160cfebba5
--- /dev/null
+++ b/products/engineering_analytics/backend/tasks/tasks.py
@@ -0,0 +1 @@
+"""Celery tasks for engineering_analytics."""
diff --git a/products/engineering_analytics/backend/tests/__init__.py b/products/engineering_analytics/backend/tests/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/backend/tests/conftest.py b/products/engineering_analytics/backend/tests/conftest.py
new file mode 100644
index 000000000000..ae3f00200968
--- /dev/null
+++ b/products/engineering_analytics/backend/tests/conftest.py
@@ -0,0 +1,13 @@
+import pytest
+
+from posthog.models.scoping import team_scope
+
+
[email protected](autouse=True)
+def _set_team_scope(request):
+ if request.node.get_closest_marker("django_db") is None:
+ yield
+ return
+ team = request.getfixturevalue("team")
+ with team_scope(team.id):
+ yield
diff --git a/products/engineering_analytics/backend/tests/test_api.py b/products/engineering_analytics/backend/tests/test_api.py
new file mode 100644
index 000000000000..a214f63f9ab7
--- /dev/null
+++ b/products/engineering_analytics/backend/tests/test_api.py
@@ -0,0 +1,5 @@
+from django.apps import apps
+
+
+def test_app_is_installed():
+ assert apps.is_installed("products.engineering_analytics.backend")
diff --git a/products/engineering_analytics/backend/tests/test_logic.py b/products/engineering_analytics/backend/tests/test_logic.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/backend/tests/test_models.py b/products/engineering_analytics/backend/tests/test_models.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/backend/tests/test_presentation.py b/products/engineering_analytics/backend/tests/test_presentation.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/backend/tests/test_tasks.py b/products/engineering_analytics/backend/tests/test_tasks.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/engineering_analytics/manifest.tsx b/products/engineering_analytics/manifest.tsx
new file mode 100644
index 000000000000..73fe33ac8f11
--- /dev/null
+++ b/products/engineering_analytics/manifest.tsx
@@ -0,0 +1,23 @@
+/**
+ * Product manifest for engineering_analytics.
+ *
+ * Defines scenes, routes, URLs, and navigation for this product.
+ */
+import { ProductManifest } from '../../frontend/src/types'
+
+export const manifest: ProductManifest = {
+ name: 'EngineeringAnalytics',
+ scenes: {
+ // Define scenes here
+ },
+ routes: {
+ // Define routes here
+ },
+ redirects: {},
+ urls: {
+ // Define URL helpers here
+ },
+ fileSystemTypes: {},
+ treeItemsNew: [],
+ treeItemsProducts: [],
+}
diff --git a/products/engineering_analytics/package.json b/products/engineering_analytics/package.json
new file mode 100644
index 000000000000..b8bd7bdb10e4
--- /dev/null
+++ b/products/engineering_analytics/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "@posthog/products-engineering-analytics",
+ "scripts": {
+ "backend:test": "pytest -c ../../pytest.ini --rootdir ../.. backend/tests -v --tb=short"
+ }
+}
diff --git a/products/engineering_analytics/product.yaml b/products/engineering_analytics/product.yaml
new file mode 100644
index 000000000000..81772c836626
--- /dev/null
+++ b/products/engineering_analytics/product.yaml
@@ -0,0 +1,3 @@
+name: Engineering analytics
+owners:
+ - team-devex
diff --git a/products/engineering_analytics/tsconfig.json b/products/engineering_analytics/tsconfig.json
new file mode 100644
index 000000000000..fe425d6fcba8
--- /dev/null
+++ b/products/engineering_analytics/tsconfig.json
@@ -0,0 +1,6 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "composite": true
+ }
+}
diff --git a/products/engineering_analytics/turbo.json b/products/engineering_analytics/turbo.json
new file mode 100644
index 000000000000..44865e1b7931
--- /dev/null
+++ b/products/engineering_analytics/turbo.json
@@ -0,0 +1,3 @@
+{
+ "extends": ["//"]
+}
diff --git a/tach.toml b/tach.toml
index e4cd1edf7c51..8dceddb79dda 100644
--- a/tach.toml
+++ b/tach.toml
@@ -760,3 +760,17 @@ expose = [
from = [
"products.wizard",
]
+
+[[modules]]
+path = "products.engineering_analytics"
+depends_on = ["posthog"]
+layer = "modules"
+
+[[interfaces]]
+expose = [
+ "backend\\.facade.*",
+ "backend\\.presentation\\.views.*",
+]
+from = [
+ "products.engineering_analytics",
+]