Skip to content

feat: Add Revenue Analytics v0 #30895

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

Merged
merged 10 commits into from
Apr 8, 2025
Merged

Conversation

rafaeelaudibert
Copy link
Member

This our first attempt at Revenue Analytics. This is just the initial setup, configuring all of the file structure and attempting at using a virtual view to display this inside PostHog. We arent adding any charts yet, this is coming soon.

We'll probably need to create cross-table views (for invoices and charges), but that's coming in a future PR. This is only the first PR to get an idea from the Data Warehouse team whether this makes any sense or not

Supersedes #30704

@rafaeelaudibert rafaeelaudibert requested review from EDsCODE, a team, lricoy, robbie-c and jabahamondes and removed request for a team April 7, 2025 18:37
@rafaeelaudibert rafaeelaudibert force-pushed the revenue-analytics-v0-attempt-2 branch from fc8a40c to bcbe43b Compare April 7, 2025 18:39
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR kickstarts Revenue Analytics v0 by refactoring revenue configuration, navigation, and API mocks while removing deprecated data warehouse settings.

  • Updated revenue URL in /frontend/src/layout/panel-layout/ProjectTree/defaultTree.tsx from urls.revenue() to urls.revenueSettings().
  • Removed dataWarehouseTables from MOCK_DEFAULT_TEAM in /frontend/src/lib/api.mock.ts to consolidate revenue event settings.
  • Added a new navigation item with IconPiggyBank in /frontend/src/layout/navigation-3000/navigationLogic.tsx, gated by the REVENUE_ANALYTICS feature flag.
  • Introduced a new workspace dependency for Revenue Analytics in /frontend/package.json and adjusted schema types in /frontend/src/queries/schema/schema-general.ts.
  • Configured new scene mapping and URL changes in /frontend/src/scenes/appScenes.ts and /frontend/src/scenes/urls.ts for integration of the Revenue Analytics feature.

55 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Member

@EDsCODE EDsCODE left a comment

Choose a reason for hiding this comment

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

**Looked at the hogql/data warehouse querying code. This looks better and easier to work into materializations now

}


class RevenueAnalyticsRevenueView(SavedQuery):
Copy link
Member

Choose a reason for hiding this comment

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

sweet

rafaeelaudibert added a commit that referenced this pull request Apr 7, 2025
Testing queries against data warehouse tables is extremely hard right now. We're doing it in different ways in different places. Let's standardize it by providing a common interface we can use everywhere: CSV files + single function to handle creating tables, sources, credentials, etc.

Extracted from #30895
@rafaeelaudibert rafaeelaudibert force-pushed the revenue-analytics-v0-attempt-2 branch 2 times, most recently from 96aa010 to cdaeb57 Compare April 7, 2025 21:52
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 3)
  • 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

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

github-actions bot commented Apr 7, 2025

Size Change: -7.69 kB (-0.06%)

Total Size: 13.2 MB

Filename Size Change
frontend/dist/toolbar.js 13.2 MB -7.69 kB (-0.06%)

compressed-size-action

@rafaeelaudibert rafaeelaudibert force-pushed the revenue-analytics-v0-attempt-2 branch from a0088b2 to 7665286 Compare April 8, 2025 01:15
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 3)
  • 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 5)
  • 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 5)
  • 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 5)
  • 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

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 5)
  • 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 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

rafaeelaudibert and others added 3 commits April 8, 2025 10:14
This our first attempt at Revenue Analytics. This is just the initial setup, configuring all of the file structure and attempting at using a virtual `view` to display this inside PostHog. We arent adding any charts yet, this is coming soon.

We'll probably need to create cross-table views (for invoices and charges) but that's coming in a future PR, this is only the first PR to get an idea from the Data Warehouse team whether this makes any sense or not
Most werent necessary anymore, we've simplified the workflow by a lot now
Update query snapshots

Update query snapshots

Update UI snapshots for `chromium` (5)

Update UI snapshots for `chromium` (5)

Update UI snapshots for `chromium` (5)

Update UI snapshots for `chromium` (5)

Update UI snapshots for `chromium` (5)
@rafaeelaudibert rafaeelaudibert force-pushed the revenue-analytics-v0-attempt-2 branch from 96a9406 to 2c3849f Compare April 8, 2025 13:14
@rafaeelaudibert rafaeelaudibert enabled auto-merge (squash) April 8, 2025 13:18
@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 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert force-pushed the revenue-analytics-v0-attempt-2 branch from 90d7b54 to aa15cd9 Compare April 8, 2025 13:50
@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 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

There's one extra query now to check for Stripe sources
@rafaeelaudibert rafaeelaudibert force-pushed the revenue-analytics-v0-attempt-2 branch from 59f6162 to 1c4e1c4 Compare April 8, 2025 14:17
@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 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Turns out increasing the number of queries in the test file was wrong, let's remove all of the N+1 queries
@rafaeelaudibert rafaeelaudibert force-pushed the revenue-analytics-v0-attempt-2 branch from ca5a1bc to 6c2fb5d Compare April 8, 2025 15:29
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

"products.early_access_features",
"products.editor",
"products.revenue_analytics",
Copy link
Member

Choose a reason for hiding this comment

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

Just a note to check if the style changes are due to a local or different formatter; nothing is required on this PR.

@lricoy
Copy link
Member

lricoy commented Apr 8, 2025

Nice! I trust your changes; I did some quick local explorations on the pats I am familiar with, but they are very shallow.

@rafaeelaudibert rafaeelaudibert force-pushed the revenue-analytics-v0-attempt-2 branch from c0cf4d5 to 6346d07 Compare April 8, 2025 17:51
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert merged commit ec8ba7b into master Apr 8, 2025
109 checks passed
@rafaeelaudibert rafaeelaudibert deleted the revenue-analytics-v0-attempt-2 branch April 8, 2025 18:55
hpouillot pushed a commit that referenced this pull request Apr 9, 2025
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants