0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00
Commit Graph

1448 Commits

Author SHA1 Message Date
James Greenhill
2bb97b8efa
Do not shadow Kafka default columns _timestamp and _offset (#1718)
* Do not shadow Kafka default columns _timestamp and _offset

* drop the columns only on the kafka_ tables

* include data types

* fields cleanups

* datetime -> datetime64

* double import datetime
2020-09-25 16:23:48 +01:00
Michael Matloka
c2ec67c948
Only allow using aggregate functions on numerical properties (#1536)
* Only allow aggregate functions on numerical properties

* Don't pass onclick when math option disabled

* Add numerical property to demo

* Fix demo

* Update test_demo.py

* Fix Team.event_properties_numerical updating

* Account for extra Team query

* Fix math selection options

* Change "cost" to "price"
2020-09-25 14:05:11 +02:00
James Greenhill
1ed6263a71
Create Omni-Person model for managing people in Clickhouse (#1712)
* Create Omni-Person model for managing people in Clickhouse

* type fixes

* rebase all the things

* cleanups

* id -> uuid for events in clickhouse

* cleanups and type checks

* Further cleanups and uuid conversions

* kafka fix

* break out serializer across kafka clients

* fix a few bugs w/ datetime types

* basic fix for people kafka table

* fix migration errors (copy pasta errors)

* Use KafkaProducer for Omni Person emitting

* setup mock kafka producer

* undo some work for inserting

* Test TestKafkaProducer

* change if order, obvious mistake

* remove unnecessary function arg

* Fix getters for new column

* Test fixes

* mirror columns across element queries

* firm up handling of timestamps

* only return timestamps for handle_timestamp

* Correct heroku config for Kafka
2020-09-25 11:05:50 +01:00
Yakko Majuri
8115e4969c
Added password strength bar (#1632)
* added password strength bar

* minor style fixes

* retry cypress

* extract password strength logic to standalone component

* Refactor with TypeScript

* updated strength algo

* fix linter comments

* fix comment

* made distinct chars test less strict

* use zxcvbn

* Make score numbers nicer and add a color between red and orange

Slightly pedantically made passwordScore always a multiple of 20%. :)

* run prettier

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
2020-09-25 02:37:55 +02:00
Marius Andra
e9ce195b99
Small insights type update (#1717)
* type update

* Update ci-backend.yml

* Update Django tests names

* Fix required check

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-09-25 02:20:33 +02:00
Michael Matloka
6d633f8f31
Don't assume that each user belongs to a team (#1715)
* Don't assume that each user belongs to a team

* Kind of assume team and user for ease

* Fix types
2020-09-24 16:57:00 +02:00
Michael Matloka
604b98c17e
Fix migration issue (#1711)
* Update 0085_org_models.py

* Black migrations

* Update 0085_org_models.py
2020-09-24 16:19:35 +02:00
Michael Matloka
663cdc4f1c
Update 0085_org_models.py (#1710)
* Update 0085_org_models.py

* Black migrations
2020-09-24 15:14:53 +02:00
Michael Matloka
d00e90067c
Fix compatibility with posthog-production (#1708)
* Update only models

* Bring in line with master and use uuid1_macless

* Update models and annotation scope support

* Delete test_team_model.py

* Update user creation, team retrieval and fix tests

* Make fixes

* Rename migration

* Fix migrating from master

* Bring back previous company_name max_length

* Use get_price_id()

* Temporarily disable team member deletion

* Update user joining and leaving, and billing

* Improve first_name handling

* Update warning

* Update TestTeamUser

* Fix migration

* Update 0085_org_models.py

* Improve bootstrapping

* Move multitenancy price tests to posthog-production

* Update team_user.py

* Update setup_review.py

* Enhance opt_slash_path

* Update team.py

* Fix default test email

* Fix typing

* Fix test

* Fix billing import

* Make mypy happy
2020-09-24 14:22:43 +02:00
Marius Andra
dd7e38c5b5
Clickhouse Elements Dedup (based on master) (#1698)
* Use ReplacingMergeTree for elements, remove element_groups and use elements_hash as a virtual "pk"

* remove unused ELEMENT_GROUP_TABLE_SQL

* merge fixes

* use redis cache to avoid writing duplicate elements to clickhouse

* move fakeredis to requirements.txt

* add team_id to cache key

* remove elements_group kafka table references

* add elements_hash to clickhouse element serializer

* fix cache key

* rename few keys

* add test runner to ease pycharm dev

* fix a some mypy errors

* remove typo

Co-authored-by: Eric <eeoneric@gmail.com>
2020-09-24 06:47:28 -04:00
Marius Andra
1eeed28751
Fix Master EE code (#1701)
* add test runner to ease pycharm dev

* fix broken import

* drop and recreate the clickhouse test db before running tests

* fix person uuid str json serialization issue

* make kafka optional in tests

* fix inits

* remove need for kafka in person.py

* fix a bunch of mypy errors

* fix function and add process_event to pipeline

* fixed missing params and tests

* change uuid and fix types

* types

* optimize for merge prop test

* make ClickhouseProducer to produce to clickhouse one way or another

* annotate types

Co-authored-by: Eric <eeoneric@gmail.com>
Co-authored-by: James Greenhill <fuziontech@gmail.com>
2020-09-24 06:14:17 -04:00
Paolo D'Amico
45421a6b06
Random improvements (merge people, analytics) (#1706)
Co-authored-by: Michael Matloka <dev@twixes.com>
2020-09-24 10:02:10 +01:00
Michael Matloka
8a629179a9
Organizations – models (#1674)
* Update only models

* Bring in line with master and use uuid1_macless

* Update models and annotation scope support

* Delete test_team_model.py

* Update user creation, team retrieval and fix tests

* Make fixes

* Rename migration

* Fix migrating from master

* Bring back previous company_name max_length

* Use get_price_id()

* Temporarily disable team member deletion

* Update user joining and leaving, and billing

* Improve first_name handling

* Update warning

* Update TestTeamUser

* Fix migration

* Update 0085_org_models.py

* Improve bootstrapping

* Move multitenancy price tests to posthog-production

* Update team_user.py

* Update setup_review.py

* Enhance opt_slash_path

* Update team.py

* Fix default test email

* Fix typing
2020-09-24 00:53:51 +02:00
Michael Matloka
8ae86c6003
Send a weekly instance status report (resolves #1509) (#1683)
* Send a basic event ingestion status report

* Fix status report

* Fix at last

* Improve instance analytics

* Satisfy mypy

* Include users as active if they logged in after period

* minor typo fix

* Move auth classes to a file of their own

* Fix report

* Enhance report, per team data

* Add persons active in period count and fix capturing

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2020-09-23 19:34:55 +02:00
Yakko Majuri
349a828c9a
added docker-compose proxy file (#1703) 2020-09-23 15:38:56 +02:00
James Greenhill
97a665d277
Leverage Postgres for Persons and reorder order by's on clickhouse" (#1681)
* Query optimizations

* more sql optimizations

* checkpoint

* fix migration

* add UUID field to person

* use django signals to signal that clickhouse needs to be updated

* cleanup person logic

* cleanups

* update migration

* Don't setup the django signals unless we are for sure using ee setup

* expecting back to 30 queries for capturing with new person

* add .venv to .gitignore

* add env back to .gitignore

Co-authored-by: Ubuntu <ubuntu@ip-172-31-73-18.ec2.internal>
2020-09-22 13:41:08 +01:00
Michel Semaan
0268e88f4f
#724: Export Events to CSV (#1580)
* Add CSV renderer to Event serializer

* Add Export button to Event Table page

* Add failsafe in case request doesn't exist

* Update event.py

* Format changes in event.py with black

* Add ignore typing to CSV Renderer import in event.py

* Prettify EventsTable.js

* Improve CSV format detection

* Fix person.py

* Make events CSV query params in line with table logic

* Remove queryset limiting

* Add 100K limit to Event CSV export

* Add limit tooltip

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-09-18 15:48:19 +02:00
Yakko Majuri
4cb64d0c74
Fix Cypress tests (#1635)
* added timeouts and waits to ensure flow of cypress tests

* removed unused test

* fixed trends elements tests

* testing a longer wait time - temp

* fix trends sessions and retetion filtering tests

* fix events filtering test

* removed wait

* trends sessions fix

* minor update

* fix live actions & sessions

* improve timeouts

* more timouts

* removed some waits

* added timeouts to trends tests

* modify config

* remove test on bug

* removed timeout from events table

* remove dashboards timeout

* change selector for sessions tab

* use data-attr
2020-09-18 09:26:12 -04:00
Michael Matloka
1a96b86925
Show underlying property value type (#1666)
* Show underlying property value type

* Use icons to signify property type

* Fix null

* Update null

* Use Bulb instead of QuestionCircle for boolean

* Change "parsed" to "parsable"

* Update style
2020-09-18 13:42:47 +02:00
Tim Glaser
fdfb393c8d
Fix table view sessions (#1672)
* Test commit

* Fix table view for sessions
2020-09-18 09:02:24 +00:00
James Greenhill
2fd4fc90d4
Materialize Views to wrap data coming in from Kafka for Events, Elements, People (#1678) 2020-09-17 11:22:00 -07:00
James Greenhill
8c372070b2
refactor how we grab kafka_host to make it reusable for migrations (#1677) 2020-09-17 11:09:41 -07:00
James Greenhill
be4373e96c
Test if person exists before getting from it (#1676) 2020-09-17 09:46:15 -07:00
James Greenhill
463ce40ba6
Make get_is_identified more tolerant of missing person (#1675)
* Make get_is_identified more tolerant of missing person

* better test of out of range
2020-09-17 09:26:58 -07:00
Tim Glaser
b175cac5ce
Use cached results for funnels (#1671)
* Test commit

* use cached results for funnels
2020-09-17 13:58:15 +02:00
Paolo D'Amico
17bb22062b
Core action tracking I (#1612)
* feat: capture team member deleted event

* feat: capture annotation creation & update events

* feat: annotation deleted event

* fix: typechecking

* fix: fixes action signal

* Merge branch 'master' into 1575-core-action-tracking

* black

* refactor annotation analytics

* feature flag analytics

* formatting & typechecking

* fix
2020-09-17 11:38:41 +02:00
Yakko Majuri
0f1b5953b2
Added warning for changing feature flag key (#1646)
* added warning for changing feature flag key

* update link to docs
2020-09-17 11:36:43 +02:00
James Greenhill
bd1b5b7c64
Remove default json serializer from kafka_helper (#1669) 2020-09-16 12:19:16 -07:00
James Greenhill
247b7c1912
put process_event_ee back on celery with delay (#1667) 2020-09-16 10:47:40 -07:00
James Greenhill
adeb7694cc
Publish events to Kafka for consumption (#1644)
* Publish events to Kafka for consumption

* Commit avro idl's for event schemas

* convert client to use github.com/dpkp/kafka-python

* events loaded into clickhouse from Kafka

* remove cruft

* Publish events to Kafka for consumption

* convert client to use github.com/dpkp/kafka-python

* remove cruft

* include kafka migrations

* bugfixes for migrations

* use constants for consistency

* wrap up local migrations

* small fixes

* tune ups
2020-09-15 20:04:38 -07:00
Marius Andra
50c683e691
Clickhouse process event (#1652)
* generate clickhouse uuid script

* set CLICKHOUSE_SECURE=False by default if running in TEST or DEBUG

* convert person_id to UUID, make adding `person_id` optional, add distinct_ids already in the `create_person` function

* Fix test_process_event_ee.py, remove all calls to Person.objects.*

* add back util

* fix broken imports

* improve process_event test clickhouse queries

* change property parsing

* indentation wrong missing calls

* uuid4 instead of call to CH

Co-authored-by: Eric <eeoneric@gmail.com>
Co-authored-by: James Greenhill <fuziontech@gmail.com>
2020-09-15 12:40:35 -07:00
Tim Glaser
10c0819d27
Add detailed label to actionstable (#1653)
* Test commit

* Add detailed label to actionstable
2020-09-15 13:16:44 +02:00
Tim Glaser
fe3c8e7c24
Add "is_simple_flag" to Feature flags (#1639)
* Test commit

* Add is_simple_flag to api
2020-09-11 08:02:44 +00:00
Tim Glaser
2421793228
Add tests for FOSS (#1600)
* Add tests for FOSS

* Ignore ee specific tests

* Exclude more ee only tests

* conditional tests, nice

* Add ee_available to settings

* fix test

* Fix test

* Test commit

* Fix test again

* Remove EE_MISSING in favor of EE_AVAILABLE completely

* Rename bottom-notice.html to overlays.html, to better reflect purpose

* Add greeting

* Fix ee import

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-09-10 18:20:29 +02:00
Marius Andra
5a6853654c
Fix a few "Unchanged files with check annotations" issues (#1641)
* fix a few "Unchanged files with check annotations" issues

* fix one more issue
2020-09-10 17:09:56 +02:00
Marius Andra
bfd856bb95
Nicer API Failure Errors (#1633)
* convert api to async/await

* throw a nicer error if received a HTML error
2020-09-10 16:32:31 +02:00
Eric Duong
c3b6d62d83
change the default so local dev works well (#1637) 2020-09-10 16:09:40 +02:00
Marius Andra
270c5f4a78
1) upgrade kea to 2.2.0 final and kea-typegen to 0.3.0, 2) fix some broken types (#1634) 2020-09-10 15:29:24 +02:00
Michael Matloka
36dd684861
Fix optional trailing slash routing (#1631) 2020-09-10 12:06:32 +02:00
James Greenhill
87f54610cc
Enable Clickhouse event processing (#1629)
* Enable Clickhouse event processing
2020-09-09 21:21:01 -07:00
James Greenhill
f8c48c0779
Remove function call to see impact on performance (#1627) 2020-09-09 20:32:03 -07:00
James Greenhill
eaff39388d
Refactor get_or_create_person function in process_event (#1626)
* Refactor get_or_create_person function in process_event

* optimize get_or_create person
2020-09-09 19:58:31 -07:00
James Greenhill
1de047b10d
Migrate process_event shared functions to be public (#1625)
* Migrate process_event shared functions to be public

* mypy and adjust

* exclude tests that are tagged 'skip_on_multitenancy'
2020-09-09 18:34:13 -07:00
James Greenhill
2e6a5ed79b
Make hash elements public function on element_group (#1622)
* Make hash elements public function on element_group

* Remove self from function 🧘
2020-09-09 11:36:47 -07:00
Michael Matloka
fd9df64b92
Improve API routing (#1557)
* Make trailing slash optional in DRF endpoints

* Update tests

* Make authenticate_secondarily a util

* Use @authenticate_secondarily in /decide

* Add API-specific 404 error and improve URLs

* Update tests

* Don't use @authenticate_secondarily in /decide

* Update urlpatterns

* Update test_user.py

* fixed formatting

* minor changes to tests and _ endpoints

Co-authored-by: Yakko Majuri <yakko.majuri@gmail.com>
2020-09-09 16:54:50 +02:00
James Greenhill
fdfe7a4459
Revert "Convert private functions to public for ee access (#1618)" (#1620)
This reverts commit 245bf27857.
2020-09-08 22:51:20 -07:00
James Greenhill
245bf27857
Convert private functions to public for ee access (#1618)
* Final ClickHouse module before wiring up to Posthog

* convert private functions to public for ee access

* Fix mypy error

* fix up a few typos breaking tests
2020-09-08 22:35:26 -07:00
James Greenhill
70868fc7db
Final ClickHouse module before wiring up to Posthog (#1617) 2020-09-08 21:00:37 -07:00
James Greenhill
7d80f7631e
clickhouse views and management commands (#1616) 2020-09-08 20:13:54 -07:00
James Greenhill
712e790f8d
Add clickhouse queries (#1615) 2020-09-08 19:23:10 -07:00