0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
Commit Graph

45 Commits

Author SHA1 Message Date
Zach Waterfield
a5375dfa0d
feat: send updated owner/admin emails to billing (#22374)
* Send updated admin emails to billing

* add tests

* sync when a user is removed from an org

* fix the admin email filter

* sync admin emails on level change

* add more tests
2024-05-22 15:49:13 -04:00
Zach Waterfield
187c1265c0
fix: make sure available features get set (#22423)
make sure available features get set
2024-05-22 10:48:24 -04:00
Bianca Yang
008698a785
feat: remove most frontend references to available_features (#22337)
* remove most frontend references to available_features

* some more

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* adding back some items, fix tests

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* fix test

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-20 14:24:32 -07:00
Bianca Yang
cb95d71723
fix: Fix dict accessor for subscription status on addons (#22280)
* fix dict accessor

* more comprehensive fix
2024-05-14 15:06:51 +00:00
Bianca Yang
8af7c7ea5f
fix: Use safer dict accessor when computing tiers information (#22203)
change dict accessor
2024-05-08 23:32:21 +00:00
Bianca Yang
69dfe43e8a
feat: Block subscriptions if there are open invoices on the customer (#22057)
* retrieve open invoices as part of /billing loading, show warning

* small fixes

* address pr feedback

* small grammar update

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-08 10:30:53 -07:00
Bianca Yang
a266ffc60e
feat: Update tiers usage information with local org usage information (#21957)
* update tiers usage with local org usage information

* type finagling

* update addon tiers as well

* test

* Update ee/billing/billing_manager.py

* update tests

---------

Co-authored-by: Raquel Smith <raquelmsmith@users.noreply.github.com>
2024-05-07 23:25:22 +00:00
Bianca Yang
d785d8cbe2
fix: Use requests.exception.JSONDecodeError in try/except for billing service errors (#21907)
silence mypy error about exception not existing
2024-04-26 21:45:39 +00:00
Bianca Yang
5f296b44b3
fix: Adds fallback to res.text in billing error handler (#21904)
* add fallback to res.text

* lint
2024-04-26 11:56:30 -07:00
Bianca Yang
f4fe46378c
feat: Show error messages from server on billing page (#21765)
* show error messages on billing page

* some more updates

* extraneous exception and pr feedback

* Move error display into the unsubscribe modal
* Only show link to stripe if the error detail is about open invoices

* Update frontend/src/scenes/billing/billingLogic.tsx

Co-authored-by: Raquel Smith <raquelmsmith@users.noreply.github.com>

* remove opensupportform from billingLogic

---------

Co-authored-by: Raquel Smith <raquelmsmith@users.noreply.github.com>
2024-04-25 19:50:55 +00:00
Julian Bez
9576fab1e4
chore: Add Pyupgrade rules (#21714)
* Add Pyupgrade rules
* Set correct Python version
2024-04-25 08:22:28 +01:00
Julian Bez
487ca39064
chore: Enable more ruff rules (#21043) 2024-04-08 16:21:51 +01:00
Bianca Yang
376fb232ae
feat: Implement Quota Limiting Suspension Strategy (#20469)
* add db field, add automatic scoring mechanism, update billing response types

* implement score override system

* add migration file, small change

* add model fields, fix ff implementation

* add is_hipaa field to organization
* fix ff quota_limiting implementation so only not already limited orgs have limiting suspended

* update automatic limiting logic, existing tests

* update ff test

* beefing up tests

* Update query snapshots

* Update query snapshots

* Update query snapshots

* rebase upon customer score pr

* Update query snapshots

* typo fix

Co-authored-by: Raquel Smith <raquelmsmith@users.noreply.github.com>

* remove needs_save, claen up migration

* Update query snapshots

* Update query snapshots

* another set of small cleanup

* Update query snapshots

* Update query snapshots

* fix type errors

* Update query snapshots

* tests and typing

* actually fix tests

* Update query snapshots

* Update query snapshots

* Update query snapshots

* update fields to match backend

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* some pr comments

* undo migrations as they are moved to another pr

* undo model changes to organization

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Raquel Smith <raquelmsmith@users.noreply.github.com>
2024-03-07 10:15:11 -08:00
Ben White
11c0506bee
fix: revert #19938 (#20232) 2024-02-09 14:14:18 +00:00
Bianca Yang
879fb81d8e
feat: Don't Label Users as Quota Limited for N Days After They Exceed Their Quota (#19938)
* wip

* add tests

* fix up mypy

* Update query snapshots

* Update query snapshots

* address pr feedback

* small updates

* fix tests

* use better types and no key defaults

* fix typing

* fix up some test setup

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Raquel Smith <raquelmsmith@users.noreply.github.com>
2024-02-08 17:56:28 -08:00
Raquel Smith
037541af8e
fix: quota limiting memory usage (#20161)
* only get the team data we need

* make sure we got all the fields (with assert num queries)
2024-02-06 23:59:20 +00:00
Bianca Yang
31807262c0
fix: fix structure of group properties param in feature_enabled call (#20079)
fix structure of group properties param
2024-02-01 03:32:36 +00:00
Bianca Yang
c3623b039f
feat: use feature flag to control whether to quota limit or not (#19996)
* use feature flag to control whether to quota limit or not

* add simple test

* Update query snapshots

* fix up the feature flag activation logic

* confirm that the fixed feature flag logic works

* remove unnecessary change

* Update query snapshots

* Update query snapshots

* fix up tests

* another fix for tests

* Update query snapshots

* still fixing tests

* Update query snapshots

* pr feedback, more tests

* tune up ff enabled call, add capture check to test for quota limit changed

* i really need to run tests locally

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-31 21:37:40 +00:00
Raquel Smith
5590acbb7f
fix: rows synced doesn't exist (#19469)
* fix rows synced doesn't exist

* use default value
2023-12-21 16:49:05 +00:00
Bianca Yang
ecd525644d
feat: Update the organization customer email upon signup (#18724)
* Update the organization customer email upon signup

* Only do this is the person signing up is the owner of the org and there isn't already a
  stripe subscription associated with the org

* undo local changes that shouldn't be in prod

* small tweaks to match backend

* fix test

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: Bianca Yang <bianca@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-21 10:39:37 -08:00
Raquel Smith
db82cff3e2
fix: tolerate missing rows_synced in billing response (#18695)
* tolerate missing rows_synced

* more fix
2023-11-16 15:36:29 -05:00
Eric Duong
820e6a78a0
chore(data-warehouse): dw billing (#18168)
* create airbyte source api

* comment test

* rename and add connection

* comment out test

* frontend updates and additional API calls on airbyte

* some more UI and retrieve endpoint

* restore lock file

* connecting the dots

* add destination logic

* make destinatino parquet

* ui updates

* add task to billing usage report

* update task

* rename data

* more renaming

* migration

* remove test

* rename

* Update UI snapshots for `chromium` (2)

* missing file

* typing

* remove unneeded field

* remove 'billable' and unnecessary field

* add rollback deletions if one fo the related resources fails

* fix types

* change type

* remove fluff

* remove migration

* Update UI snapshots for `chromium` (1)

* new attempt

* add tests

* add comment

* move around ph_client

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update query snapshots

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* add job

* usage report task and tests

* test

* add limit checker task

* add conversion

* add tests

* address comments

* Update query snapshots

* Update query snapshots

* update test

* revised

* fix tests

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* add typing

* update tests

* rename

* typing

* fix tests

* Update query snapshots

* Update query snapshots

* Update query snapshots

* fix tests and types

* fix typo

* naming

* verbose

* remove verbose

* typo

* restore main

* adjust timing

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-16 14:40:31 -05:00
Bianca Yang
96dd0d2fd3
chore: remove the remaining call to api/plans (#18589)
remove the remaining call to api/plans

Co-authored-by: Bianca Yang <bianca@posthog.com>
2023-11-14 09:57:01 -08:00
Tom Owers
5513be7731
chore: upgraded Ruff linter (#18188)
* Upgraded Ruff linter

* Formatted whole codebase with new ruff rules

* Revert import removal

* Fixed mypi issues or added ignores

* Fixed schema formatting

* Fixed hogvm failing tests

* Remove duplicate key in list
2023-10-26 12:38:15 +02:00
Raquel Smith
723238e6d1
feat: add and handle never drop data field (#17978)
* add and handle never drop data field

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-16 07:51:18 -07:00
Raquel Smith
4e53dc74b7
feat: sync distinct ids with billing (#16919)
* update billing distinct IDs on user join/leave org

* temporarily update on usage report send
to update existing orgs

* abstract a bit more

* update existing tests

* add billing_manager test for the method

* Update query snapshots

* specify date

* move outside the transaction

* cache the instance license

* use new instance license method in other places

* fix mypy and some tests

* Update query snapshots

* Update query snapshots

* fix caching in tests

* constrain try/except

* Update query snapshots

* make sure we hae license before update billing

* Update query snapshots

* Update query snapshots

* set to false if no instance license

* fix date

* Update query snapshots

* use correct var

* Update UI snapshots for `chromium` (1)

* clear license cache before running tests

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* fix tests

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-17 11:41:25 -07:00
Neil Kakkar
8a9fbf8161
chore(usage-report): Stop charging for feature flag called events (#16226)
* chore(usage-report): Stop charging for feature flag called events

* Update query snapshots

* rename

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-26 08:13:18 -07:00
Ben White
bd1d16603d
feat: Started improving the usage report performance (#16532) 2023-07-13 16:04:40 +00:00
James Greenhill
522a08ac77
chore: bump clickhouse for local dev and ci to 23.6 (#16361)
* chore: bump clickhouse for local dev and ci to 23.6

* test to see if race condition

* it is a race
2023-07-03 19:04:57 -07:00
Raquel Smith
e68d740f50
chore: remove the old billing UI (#15928)
* remove the old billing UI

* fix imports

* Update UI snapshots for `chromium` (1)

* fix billing story data

* return the correct products api response

* autocreate licenses after subing in unlicensed debug

* fix tests

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-12 08:07:52 -07:00
Raquel Smith
91de4af59c
fix: support feature objects from billing (#15243)
* save available_product_features to the org

* use new feature objects and gaurd on limits

* guard playlists based on feature limit frontend

* handle feature limits on backend for playlists

* migrations

* Update query snapshots

* fix a couple things

* fix / add playlist tests

* fix dashboard collab tests

* fix types

* fix some tests

* fix collab test

* fix dashboard collab tests?

* Update query snapshots

* fix migration

* Update query snapshots

* remove default on field

* debug geoip test failure

* remove print

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-27 14:50:17 +00:00
Raquel Smith
d03fa0a953
feat(billing): create product-specific billing page (#15035)
* clean up and organize

* create ff and stub out new product layout

* Split main billing page

* refactor test billing product

* rename table bordered to borderedRows

* Add stealth display to table for minimal styling

* key the logic

* stub addons

* working version connected to api

* accept usage key from custom_limits_usd map
just in case some old ones are left dangling

* consolidate pricing tables and more

* add pricing modal

* avoid errors

* fix

* fix tests

* Handle contact_support products

* Update UI snapshots for `chromium` (2)

* incorporate fixes from em's other PR

* Update UI snapshots for `chromium` (2)

* Fix some tests and type errors

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* more type fixes

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Hide billing limit field if it's open & then unsub

* just say products not your products

* feat: add product comparisons and ingestion styling/logic (#15040)

* add upgrade CTA on plan card

* add a modal to show plan details

* make ingestion view work

* add upgrade all button on ingestion

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `firefox` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `firefox` (2)

* redirect back to ingestion if that's where they were

* stay on billing panel til they are done sub-ing

* upgrade to addons automatically in onbdg

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* only include free tier in gauge if there is one

* use proj_amt_usd instead of calculating on frontend

* usage_key not type

---------

Co-authored-by: Emanuele Capparelli <k@emkpp.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-13 17:43:33 +00:00
Emanuele Capparelli
20881d9701
fix: current_usage wrongly displayed (#15061)
* fix: current_usage wrongly displayed

* fix
2023-04-12 22:54:38 +00:00
Emanuele Capparelli
c86e490bc4
fix: small UI fixes for new billing API (#15024)
* fix: small UI fixes for new billing API

* fix tests

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-11 09:52:46 -07:00
Emanuele Capparelli
f489831bc4
fix: improved billing page for yearly plans (#14652)
* fix: show correct billing interval

* fix types and hide billing limits

* fix type

* fix copy

* fix copy
2023-03-09 17:42:48 +00:00
Emanuele Capparelli
7672b3d131
fix: handle billing discounts (#14576)
* fix: handle billing discounts

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-08 12:01:35 +00:00
Ben White
a69ff2ab13
feat: Track info about quota limiting to posthog (#14340) 2023-02-22 09:34:26 +01:00
Ben White
34ba9ee2e5
chore: Add exception catching if there are no team_tokens (#14246) 2023-02-15 09:02:22 +00:00
Ben White
aeec7ba10c
feat: Added code to sync quota limits when updated (#14227)
* Added code to sync quota limits when updated

* Fixed syncing of rate limited teams

* fix

* Fix types

* Reverse changes

* fix import

---------

Co-authored-by: Emanuele Capparelli <k@emkpp.com>
2023-02-14 19:17:26 +00:00
Emanuele Capparelli
2272fca0b5
fix: avoid sending distinct ids to billing (#14224)
* fix: avoid sending distinct ids to billing

* fix test
2023-02-14 02:38:02 +00:00
Emanuele Capparelli
7a0a7283e0
fix: better billing debug (#14223)
* fix: better billing debugging

* fix error handler
2023-02-13 16:24:16 -08:00
Ben White
3234aaf081
feat: Billing limits take 2 (#14198)
* Revert "revert: Billing change (#14195)"

This reverts commit e0a65353e5.

* Fix up access
2023-02-13 14:43:53 -08:00
Ben White
e0a65353e5
revert: Billing change (#14195) 2023-02-13 08:58:30 +00:00
Emanuele Capparelli
037b635945
feat: chron job to rate limit orgs based on usage (#13521) 2023-02-13 09:03:22 +01:00
Ben White
8ecbf29766
feat: Added quota limiting for capture (#14046) 2023-02-06 10:43:33 +01:00