Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(dashboards): convert dashboard templates from filters to queries #26389

Merged
merged 13 commits into from
Dec 13, 2024

Conversation

thmsobrmlr
Copy link
Contributor

@thmsobrmlr thmsobrmlr commented Nov 25, 2024

Problem

We want to get rid of insights with filters eventually. All insights should use queries instead.

Currently we're still creating new insights with filters through dashboard templates.

Changes

This PR:

  • adds a migration that converts existing dashboard templates from filters to queries.
  • adds a flag to the filters_to_query method for supporting template variables.
  • handles template variables frontend side: at the moment we only have variables for events. these need to be converted to the new entity format before sending them to the dashboard endpoint.

How did you test this code?

Loaded templates from production into my local instance and ran the migration. Tested selected dashboard templates picked by popularity and those having issues when running the migration:

  • Customer Retention Rate in Test B2B SaaS Product Metrics -> variables
  • product analytics (79k)
  • landing pages report (4.3k)
  • website metrics (3.5k)
  • user research (3.5k)
  • real time analytics (1.7k)

@thmsobrmlr thmsobrmlr reopened this Dec 10, 2024
@PostHog PostHog deleted a comment from posthog-bot Dec 10, 2024
@PostHog PostHog deleted a comment from posthog-bot Dec 10, 2024
Copy link
Contributor

github-actions bot commented Dec 10, 2024

Size Change: 0 B

Total Size: 1.11 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.11 MB

compressed-size-action

@thmsobrmlr thmsobrmlr removed the stale label Dec 10, 2024
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@thmsobrmlr thmsobrmlr marked this pull request as ready for review December 11, 2024 08:37
Copy link
Contributor

@anirudhpillai anirudhpillai left a comment

Choose a reason for hiding this comment

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

Great job testing on all the prod templates!

# Conflicts:
#	posthog/migrations/max_migration.txt
@thmsobrmlr thmsobrmlr enabled auto-merge (squash) December 13, 2024 10:54
@thmsobrmlr thmsobrmlr merged commit 41b9911 into master Dec 13, 2024
96 checks passed
@thmsobrmlr thmsobrmlr deleted the convert-dashboard-templates branch December 13, 2024 11:45
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.

3 participants