chore: remove posthog integration and analytics scaffold - #9634
chore: remove posthog integration and analytics scaffold#9634sriramveeraghanta wants to merge 2 commits into
Conversation
Removes the PostHog integration end to end, plus the inert autocapture scaffold left behind by an earlier partial removal (d61b157, "chore: remove posthog events (#8465)"). Backend: - delete bgtasks/event_tracking_task.py and utils/analytics_events.py - drop all 6 track_event.delay call sites - drop POSTHOG_API_KEY / POSTHOG_HOST settings - stop returning posthog_api_key / posthog_host from GET /api/instances/ - drop the posthog==3.5.0 dependency Frontend: - delete packages/constants/src/event-tracker (all 40 exports were unused) - remove 42 data-ph-element attributes across 36 files - remove the dead shouldTrackEvents and trackerElements prop chains - remove the Microsoft Clarity session-recording tag Note: GET /api/instances/ no longer returns posthog_api_key/posthog_host. Nothing in this repo read them and neither do plane-ee or plane-commercial, but the endpoint is AllowAny and cached for 2h. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HD7dTidmtWWRRiFv3nmW3s
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (7)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change removes backend analytics events, PostHog configuration, session recording, frontend tracker constants, tracking attributes, and event-related component props. Workspace, invitation, filtering, state, and button behavior remains unchanged. ChangesBackend analytics removal
Frontend tracking removal
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to This change removes unused analytics code, telemetry annotations, and exposed PostHog configuration without identified in-repository behavior impact. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
React Doctor found 1 new issue in 1 file · 1 warning · score 82 / 100 (Needs work) · 0 fixed · vs 1 warning
Reviewed by React Doctor for commit |
Collapse JSX elements and import statements that were left multi-line after the tracker props and specifiers were removed. Whitespace only. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HD7dTidmtWWRRiFv3nmW3s
There was a problem hiding this comment.
Pull request overview
This PR completes the removal of PostHog analytics and related tracking scaffolding across the Plane backend and frontend. It removes both the backend event tracking task/call-sites and the remaining frontend “ph” tracking attributes/props, and updates the instance config surface area accordingly.
Changes:
- Backend: remove PostHog Celery task + event constants, remove all
track_event.delay(...)call sites, dropPOSTHOG_*settings/config exposure, and remove theposthogdependency. - Frontend: remove the unused event-tracker constants package exports, remove
data-ph-elementannotations, and unwind dead prop chains (trackerElements,shouldTrackEvents). - Ops/build config: remove Clarity session-recorder injection and related Turbo env entries; remove PostHog keys from instance config types.
Reviewed changes
Copilot reviewed 63 out of 63 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| turbo.json | Removes Clarity/session-recorder env passthrough entries. |
| packages/types/src/instance/base.ts | Removes posthog_* keys from the instance config type contract. |
| packages/constants/src/index.ts | Stops exporting the removed event-tracker module. |
| packages/constants/src/event-tracker/index.ts | Deletes inert event-tracker export surface. |
| packages/constants/src/event-tracker/core.ts | Deletes inert tracker constants scaffold (~500 lines). |
| apps/web/core/components/workspace/sidebar/quick-actions.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/workspace/sidebar/projects-list.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/workspace/sidebar/projects-list-item.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/workspace/settings/member-columns.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/workspace/delete-workspace-section.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/web-hooks/form/form.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/web-hooks/form/delete-section.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/rich-filters/filters-row.tsx | Removes unused trackerElements prop plumbing and data-ph-element usage. |
| apps/web/core/components/project/settings/member-columns.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/project/settings/helper.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/project/settings/control-section.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/project/member-list.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/project/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/project-states/state-list.tsx | Removes dead shouldTrackEvents prop threading. |
| apps/web/core/components/project-states/state-item.tsx | Removes dead shouldTrackEvents prop threading. |
| apps/web/core/components/project-states/state-item-title.tsx | Removes dead tracking prop usage/imports. |
| apps/web/core/components/project-states/root.tsx | Stops passing shouldTrackEvents down the tree. |
| apps/web/core/components/project-states/options/delete.tsx | Removes dead optional tracking prop from delete option. |
| apps/web/core/components/project-states/group-list.tsx | Removes dead shouldTrackEvents prop threading. |
| apps/web/core/components/project-states/group-item.tsx | Removes data-ph-element usage and dead tracking prop threading. |
| apps/web/core/components/project-states/create-update/update.tsx | Removes dead shouldTrackEvents prop from update flow. |
| apps/web/core/components/project-states/create-update/create.tsx | Removes dead optional tracking prop from create flow. |
| apps/web/core/components/navigation/project-actions-menu.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/modules/modules-list-view.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/modules/links/list-item.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/labels/label-block/label-item-block.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/issues/issue-layouts/roots/project-view-layout-root.tsx | Removes dead trackerElements prop passing to filters row. |
| apps/web/core/components/issues/issue-layouts/roots/project-layout-root.tsx | Removes dead trackerElements prop passing to filters row. |
| apps/web/core/components/issues/issue-layouts/roots/module-layout-root.tsx | Removes dead trackerElements prop passing to filters row. |
| apps/web/core/components/issues/issue-layouts/roots/cycle-layout-root.tsx | Removes dead trackerElements prop passing to filters row. |
| apps/web/core/components/issues/issue-layouts/roots/all-issue-layout-root.tsx | Removes dead trackerElements prop passing to filters row. |
| apps/web/core/components/issues/issue-layouts/empty-states/cycle.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/issues/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/global/product-updates/footer.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/estimates/estimate-list-item-buttons.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/auth-screens/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/api-token/token-list-item.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/core/components/account/auth-forms/password.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/root.tsx | Removes Clarity session-recorder script injection. |
| apps/web/app/layout.tsx | Removes Clarity session-recorder script injection. |
| apps/web/app/(all)/[workspaceSlug]/(settings)/settings/projects/page.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/(all)/[workspaceSlug]/(projects)/workspace-views/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(list)/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(detail)/[viewId]/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(list)/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/page.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/header.tsx | Removes data-ph-element usage and related constants import. |
| apps/web/app/(all)/[workspaceSlug]/(projects)/extended-project-sidebar.tsx | Removes data-ph-element usage and related constants import. |
| apps/api/requirements/base.txt | Drops the posthog Python dependency. |
| apps/api/plane/utils/analytics_events.py | Deletes PostHog event name constants. |
| apps/api/plane/settings/common.py | Removes POSTHOG_API_KEY / POSTHOG_HOST settings. |
| apps/api/plane/license/api/views/instance.py | Stops returning posthog_* values from GET /api/instances/ config. |
| apps/api/plane/bgtasks/event_tracking_task.py | Deletes the PostHog tracking Celery task implementation. |
| apps/api/plane/authentication/utils/workspace_project_join.py | Removes PostHog tracking call-site when joining via accepted invites. |
| apps/api/plane/app/views/workspace/invite.py | Removes PostHog tracking call-sites for invite/join flows. |
| apps/api/plane/app/views/workspace/base.py | Removes PostHog tracking call-sites for workspace create/delete flows. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Reviewed this end to end. Looks good to go from my side. |
Description
Removes PostHog end to end.
The backend integration was live:
track_eventfired to the PostHog SDK from six call sites, andPOSTHOG_API_KEY/POSTHOG_HOSTwere exposed through the unauthenticatedGET /api/instances/endpoint.The frontend SDK was already removed in d61b157 (#8465), but that pass left ~700 lines of inert scaffold behind — invisible to a
posthoggrep because it is spelledph. This PR finishes that job.Backend
bgtasks/event_tracking_task.pyandutils/analytics_events.pytrack_event.delay(...)call sites (workspace/base.py,workspace/invite.py,workspace_project_join.py)POSTHOG_API_KEY/POSTHOG_HOSTfrom settingsposthog_api_key/posthog_hostfromGET /api/instances/posthog==3.5.0dependencyFrontend
packages/constants/src/event-tracker/— all 40 exports verified to have zero consumersdata-ph-elementattributes across 36 filesshouldTrackEventsprop chain (20 sites) andtrackerElementschain (6 files) — both were threaded through the tree but never readlayout.tsx,root.tsx) and its 2turbo.jsonenv entriesNo behavioural change: nothing in the repo consumed any of this.
Type of Change
Screenshots and Media (if applicable)
N/A — pure removal, no UI change. The
data-ph-elementattributes were non-visual DOM annotations.Test Scenarios
track_eventsites must complete with no Celery errors in the worker log.process_workspace_project_invitations). Covers the remaining 4 call sites.GET /api/instances/returns 200 with noposthog_*keys, andenable_signup/has_unsplash_configured/has_llm_configuredstill hold correct values. (The endpoint is cached 2h — flush Redis first.) This guards the positional-tuple unpack ininstance.py, which had to stay arity-matched with its config list.shouldTrackEventstree that was unwound.pnpm turbo run buildandruff check/manage.py checkpass.References
Supersedes the partial removal in #8465.
Reviewer notes — two things worth a look:
GET /api/instances/no longer returnsposthog_api_key/posthog_host. Nothing in this repo read them, and I confirmed neitherplane-eenorplane-commercialdoes either — but the endpoint isAllowAnyand cached for 2 hours, so any external consumer will getundefinedand stale responses may linger after deploy.plane-eeandplane-commercialkeep their own copies ofproject-stateswith their ownshouldTrackEventsprops. They will not break (they don't import CE's), but expect merge conflicts there.Left alone deliberately, as out of scope: removing Clarity orphaned the
next/scriptcompat shim (apps/web/app/compat/next/script.tsx, its Vite alias,types/next-script.d.ts) — now zero consumers. Separately,turbo.jsonstill has 10 orphanedSENTRY_*env entries with no@sentry/*dependency anywhere. Both are easy follow-ups.🤖 Generated with Claude Code
https://claude.ai/code/session_01HD7dTidmtWWRRiFv3nmW3s
Summary by CodeRabbit