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

168 Commits

Author SHA1 Message Date
Michael Matloka
96e4ee8512
Nest endpoints of project-based models under /api/project/ – LITE (#2485)
* Nest endpoints under /project/ with StructuredViewSetMixin

* Rewrite URLs

* isort

* Update utils.py

* Fix errors

* Fix almoast all the errors

Last left to do: shared dashboards and permission classes.

* isort

* Adjust for master

* Add compatbility with shared dashboards

* Debug ClickHouse

* Remove some # type: ignores

* Simplify CursorPagination

* Move test base from posthog.api.test to posthog.test

* Improve API structure

* Bring back legacy endpoints

* Fix legacy compatibility

* Fix bugs and typing

* isort

* Fix hooks test

* Try fixing errors

* Fix oversight

* isort

* Fix problems

* isort

* Be more tolerant

* Fix naming and remove redundant code

* Fix imports

* Update deleteWithUndo

* Roll back

* Roll back more

* Update .gitignore

* Rollll back

* Rollllllll

* back

* Betterify

* Address feedback
2020-11-24 23:26:28 +01:00
Tim Glaser
f47e8b97ae
Combine events and actions into select box (#2394)
* WIP combine events and actions

* Alignment

* Keyboard navigation select box

* Fix enter and other small issues

* add icons

* fix renderinfo

* Hide scrollbar

* Refactor

* Fix cypress test

* fix cypress test
2020-11-24 18:28:44 +01:00
Tim Glaser
ac24aa903e
Revert "Event usage split clickhouse queries (#2388)" (#2469)
This reverts commit 7e343c2a89.
2020-11-23 13:31:02 +01:00
Tim Glaser
7e343c2a89
Event usage split clickhouse queries (#2388)
* Event usage split clickhouse queries

* Ignore

* Remove unnecessary code

* Use Karl's refactor
2020-11-23 12:40:09 +01:00
Michael Matloka
d24783ece6
Org/projects UX enhancements (#2145)
* Improve member removal UX

* Add Delete Project

* Constrain project deletion in the frontend

* Improve no org

* Make minor fixes

* Bring back changes

* Add member level changing

* Update test_organization_members.py

* Fix org leaving edge case

* Polish Project Settings UI

* Allow full project deletion

* Fix dynamic page title edge case

* Mymymypy

* Remove console.log

* Remove obsolete test

* Fix API constraints

* Fix invite creation validation case

* Add cloud/self-hosted specificity to premium feature guarding

* Improve user setting logic in case of error

* Use Teammates instead of Team Members

* Improve org/project creation UX

* Add organization ownership

* Add migration

* Fix redirecting to org creation

* Improve clipboard toast consistency

* isort

* Update tests

* isort

* Update test_organization.py

* Fix typing (somewhat)

* Explain passing on ownership

* Address feedback

* Reverse guardPremiumFeature return

* Fix typing

* Fix test

* Fix last typing

* Fix merge conflict resolution

* Remove unused code
2020-11-23 10:53:45 +01:00
Marius Andra
6906c86a5c
Use isoformat() for dates in Kafka WAL (otherwise playback results in errors); add back sentry instrumentation (#2396) 2020-11-20 14:47:03 +01:00
James Greenhill
e32ba846ed
Revert "Add alt_host for graceful failover to our secondary clickhouse node (#2407)" (#2446)
This reverts commit 751b47c73f.
2020-11-19 21:45:58 -08:00
James Greenhill
751b47c73f
Add alt_host for graceful failover to our secondary clickhouse node (#2407) 2020-11-19 21:18:46 -08:00
Tim Glaser
7bd0ea7039
Fix fetch single event clickhouse (#2436) 2020-11-19 11:27:29 +01:00
Tim Glaser
78c2ae74ac
Fix filtering is not bool (#2435)
* Fix filtering is not bool

* don't commit settings
2020-11-18 19:30:16 +01:00
Tim Glaser
b41381c149
Fix empty actions in cohorts (#2411)
* Fix empty actions in cohorts

* Dont show calculating in clickhouse

* Fix
2020-11-18 16:30:29 +01:00
Tim Glaser
4e610a0136
Fix aggregates clickhouse (#2432)
* Fix aggregates clickhouse

* remove join
2020-11-18 16:30:09 +01:00
Adam Boaler
54ae8f0e70
Check STATSD_HOST exists before setting statsd defaults (#2430) 2020-11-18 14:42:26 +01:00
Eric Duong
ec64e467ee
Organize logic (#2358)
* clean up reused function

* remove fluff and use constants

* standardizing compare

* segment logic for clickhouse queries that have a lot

* add default to filter.date_to

* mino unwrap

* fix test
2020-11-18 13:12:26 +01:00
Paolo D'Amico
9ad483064b
Refactor people & users to persons (#2413) 2020-11-17 08:40:48 -06:00
Eric Duong
dfeb94fb23
First time retention bug fixes (#2371)
* working two evention recurring retention

* change first time event to be captured across all time
2020-11-16 15:43:13 +01:00
Eric Duong
fdaba70781
remove test for now (#2383) 2020-11-13 14:30:10 -05:00
Eric Duong
b68b4397ed
remove webhooks ee (#2373) 2020-11-13 10:52:41 -05:00
Tim Glaser
25a053cda4
Manage events view (#2319)
* Finish the local dev w/ proto setup

* WIP manage events view

* Add task, add interface etc

* Move everything to 'manage events' view

* Move all settings into single dropdown (can be reverted)

* Urls for tabs

* Fix migration

* Clickhouse and humanize volume

* Fix cypress test

* Fix sidebar cypress

* Fix cypress again

* Fix some small issues

* Address comments

* Corect naming

* Fix test'

Co-authored-by: James Greenhill <fuziontech@gmail.com>
2020-11-13 14:59:08 +01:00
James Greenhill
7ac64c84f1
Basic caching for Clickhouse to redis (#2300)
* Basic caching for Clickhouse to redis

* Use redis for caching results

* add tests and fix bugs

* fix mypy

* add fakeredis as req

* add fakeredis to github action for testing

* add fakeredis to cloud tests too

* pickle -> json

* bytes

* json in tests

* tuplefy
2020-11-13 13:20:00 +01:00
James Greenhill
39081364e6
Watch person and person_distinct_id tables for lag (#2360)
* Watch person and person_distinct_id tables for lag

* record row counts as well

* add session_recording_events as well

* gofmt
2020-11-12 19:09:40 -08:00
Paolo D'Amico
b6ad72fc52
adds features to cloud plans (#2357) 2020-11-12 21:43:06 +00:00
Eric Duong
51a7d2d63e
First time retention (#2325)
* add contants, filter structure, and tests

* add frontend

* add logic

* fix retention logic for clickhouse

* postgres logic working

* add postgres logic and make test more thorough

* working

* fix cache people and change names

* add tooltips

* UX Improvements for first-time retention (#2346)

* UX improvements & copy updates

* few adjustments

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2020-11-12 08:48:07 -05:00
Eric Duong
fae9fe5238
Fix doubled up slack hook (#2340)
* fix doubled up and change name

* Fix test

Co-authored-by: Tim Glaser <tim@glsr.nl>
2020-11-12 08:31:32 -05:00
Eric Duong
92b41eeaff
Trends consolidation (#2339)
* inital consolidation

* split out result processing

* restore alltime for pg

* prune unsed imports and fix empty state

* reduce param logic

* initial reduction

* move cumulative

* improve reuse

* handle empty action

* more consolidation

* fix types
2020-11-12 12:54:45 +01:00
Karl-Aksel Puulmann
a3f055429a
Cache cohorts from clickhouse / make /decide fast (#2316)
* Cache cohorts in clickhouse

This fixes #2306

* Calculate celery

* Schedule cohorts recalculation once per hour

* Run cohort calculations each in separate task

* Fix max age in cohort recalculation

* Simplify

Co-authored-by: Tim Glaser <tim@glsr.nl>
2020-11-12 12:58:35 +02:00
Karl-Aksel Puulmann
95089dc955
Fix: Add default to params (#2314)
* Fix: Add default to params

Otherwise this debugging code blows up

* Handle CLICKHOUSE_ASYNC
2020-11-12 11:18:10 +02:00
Eric Duong
bfb57520f9
Implement missing person datapoint on breakdown (#2338)
* uncomment and implement person for breakdown by cohort and pesron prop

* fix types
2020-11-11 19:13:12 +01:00
Tim Glaser
9c5ab3b270
Closes #2283 fix heatmap (#2309) 2020-11-11 15:08:12 +01:00
Eric Duong
9fff06e2cc
Fix day interval for people (#2328)
* make sure day works too

* fix tests and interval

* change to timedelta
2020-11-10 21:59:20 -05:00
Yakko Majuri
b5809139b3
Remove Live Actions Altogether (#2303)
* Remove Live Actions Altogether

* remove backend code

* remove accidental file
2020-11-10 16:35:33 +01:00
Eric Duong
5aab1472ed
make sure properties filter (#2315) 2020-11-10 16:34:39 +01:00
Eric Duong
881416ae37
handle intervals don't rely on date_to (#2317) 2020-11-10 16:33:49 +01:00
Eric Duong
b620845caf
Maximize resuability between ch retention and pg retention (#2241)
* inherit retention base class

* move query_retention over

* use query builder

* return to original singel query attempt

* adjust weekly

* fix types
2020-11-10 07:35:36 -05:00
Karl-Aksel Puulmann
63b78e3f81
Add option to print clickhouse SQL to terminal (#2302)
* Make it possible to print SQL to console

Without this, debugging why queries are slow requires a lot of work to
figure out what the actual query is. This came up yesterday when
debugging slow /decide endpoint responses.

Heavily inspired by dba2da861b/django_extensions/management/debug_cursor.py

To use this, run e.g. `PRINT_SQL=1 ./bin/start-backend` or `PRINT_SQL=1
python manage.py shell_plus`

* Parameterize SQL in a better way
2020-11-10 13:00:43 +02:00
Eric Duong
7bcbd44ca3
fix queries (#2299) 2020-11-09 18:17:46 -05:00
Eric Duong
3ba655fbb9
Revert "Revert "Fix person created at (#2288)" (#2293)" (#2297)
This reverts commit e38da34a40.
2020-11-09 17:36:44 -05:00
Eric Duong
e38da34a40
Revert "Fix person created at (#2288)" (#2293)
This reverts commit 5b75520b7d.
2020-11-09 15:43:45 -05:00
Tim Glaser
5b75520b7d
Fix person created at (#2288) 2020-11-09 20:43:26 +01:00
Tim Glaser
7d0b983505
Fix actions grouping by OR (#2276) 2020-11-09 10:40:16 +00:00
James Greenhill
ccd70fa3f9
Finish the local dev w/ proto setup (#2254) 2020-11-06 17:15:19 -08:00
Tim Glaser
b8f7813bf3
Fix team leakge in count (#2257) 2020-11-06 11:04:24 +01:00
Tim Glaser
5b041d9849
Fix actions count clickhouse (#2234)
* Fix actions count clickhouse

* More

* Fix

* Fix test

* Black
2020-11-05 16:26:21 +01:00
Tim Glaser
efc62e1999
Fix feature flags clickhouse (#2170)
* remove person properties up to date

* remove person props mv

* move latest person

* prune rest of person materialized

* missing parenth

* add type

* remove migration

* Fix feature flags clickhouse

* Fix feature flags clickhouse

* Fix types

* Fix stuff

* Silly me

Co-authored-by: Eric <eeoneric@gmail.com>
2020-11-05 16:01:32 +01:00
Eric Duong
7a5bcab99e
Restore slack hook (#2186)
* add back hook

* add back hook

* filter event matcher

* create artificial event to query for actions

* fix test

* possible solution

* remove printer

* reformat

* remove test_event temp

* comment out tests

* comment out

* uncomment

* patch another

* reduce var

* fix timestamp
2020-11-05 14:40:30 +01:00
Eric Duong
fd4d66738c
remove feature flags (#2212) 2020-11-04 19:16:21 +01:00
Michael Matloka
76307429d2
Fix Sentry issue POSTHOG-13K (#2180)
* Fix Sentry issue POSTHOG-13K

* Ignore typing on line

* Black
2020-11-04 11:08:28 +01:00
James Greenhill
cadb560d19
skip celery for ee path (#2210)
* skip celery for ee path

* mypy fixes

* take celery out and fix types as cleanly and performant as possible

* add timing

* setup statsd, need to clean this up

* use sane defaults for statsd
2020-11-03 17:06:52 -08:00
James Greenhill
10f1a52c8e
Update local dev to use proto for events (#2181)
Co-authored-by: James Greenhill <james@jamess-mbp.lan>
2020-11-03 11:37:12 -08:00
Tim Glaser
a07eed7d2e
Simplify action queries (#2167)
* Simplify funnel and action query

* Fix type errors

* Update test_action.py

* Move more over to avoid_loop

* Simplify query everywhere

* Fix black

* Fix

* Fix everything

* Fix black

* Fix filtering

* Move or join
2020-11-03 16:06:25 +01:00