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

119 Commits

Author SHA1 Message Date
Karl-Aksel Puulmann
96ad4a6d32
Fix build (#5162)
* Test: Update requirements

* Update version

* Attempt #3
2021-07-16 16:21:36 +03:00
James Greenhill
751a35cd35
Make DDLs more friendly towards running on a cluster and cleanups (#5091)
* Make DDLs more friendly towards running on a cluster

* Use primary CLICKHOUSE host for migrations and DDL

* loose ends on person kafka create

* posthog -> cluster typo

* add cluster to KAFKA create for plugin logs

* Feed the type monster

* clusterfy local clickhouse

* test docker-compose backed github action

* run just clickhouse and postgres from docker-compose

* move option to between up and <services>

* posthog all the things

* suggest tests run on  cluster

* posthog cluster for ci

* use deploy path for docker-compose

* fix for a clickhouse bug 🐛

* complete CH bug fixes

* 5439 the github actions pg configs

* remove CLICKHOUSE_DATABASE (handled automatically)

* update DATABASE_URL for code quality checks

* Missed a few DDLs on Person

* 5439 -> 5432 to please the people

* cleanup persons and use f strings <3 f strings

* remove auto parens

* Update requirements to use our fork of infi.clickhouse_orm

* fix person.py formatting

* Include boilerplate macros for a cluster
2021-07-15 17:20:37 -07:00
Karl-Aksel Puulmann
87c7809ac1
Bump clickhouse dependencies (#4728) 2021-06-14 10:54:36 +03:00
Karl-Aksel Puulmann
e96aec672b
Update gunicorn (#4690)
Changelog: https://docs.gunicorn.org/en/stable/news.html

The release seems to include some new bugfixes.
2021-06-11 15:53:02 +03:00
Karl-Aksel Puulmann
6baa08bf50
Temporarily use forked version of clickhouse-pool (#4710)
Fixed a bug upstream, waiting for it to get released. https://github.com/ericmccarthy7/clickhouse-pool/pull/12
2021-06-11 15:48:44 +03:00
Paolo D'Amico
d0c93fa589
Upgrade to Django 3.1.12, urllib & requests (#4639) 2021-06-08 14:19:32 -07:00
Karl-Aksel Puulmann
008ee1f04c
Include more clickhouse query metrics (#4256)
* Use `statshog` over python-statsd

More support for tags!

* Include custom tags for every query + add annotation to query

After this we can:
- Figure out from query logs where queries are coming from (speeding up debugging)
- Break down query speeds by user queries vs others (e.g. celery) --
better represents overall speed
- Can figure out how fast queries are on average for various teams

* Use tags in more queries over interpolation

This way we can set up more interesting graphs \o/

* Solve mypy error

* Fix a flaky test (due to ordering)
2021-05-10 10:47:54 +03:00
Paolo D'Amico
7ea9eb692c
Update Django to 3.1.8 (and related) (#4007) 2021-04-19 12:59:10 -07:00
Sam Winslow
49f7d841ce
bump cryptography==3.4.7 and add macosx_arm64 install script (#3935) 2021-04-10 00:53:19 +02:00
Marius Andra
1d2f9bf971
Minimum PostHog version in plugins (#3916)
* add "put_json_into_zip_archive" util

* add semantic version package

* compare posthog version requirement string in plugin.json if present

* Clarify posthogVersion error messages

* Don't check posthogVersion on Cloud

* Clarify error messages better

* Split test_create_plugin_version_ranges into multiple tests

* Add Cloud test and fix the rest

* Make mypy happy

* Update ci-backend.yml

* Fix typing

* Remove broad restore-keys

* Revert "Remove broad restore-keys"

This reverts commit b720e1e1cf.

* Attempt to make cached pip actually work

* Always run package installs even if cache hit just to be sure

* Avoid pytest from PATH

* Avoid PATH in Python CI altogether

* Roll back general CI changes

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-04-09 09:04:53 +02:00
Buddy Williams
b9b77281f0
Bumped cffi so that pip will install deps for M1 chip (#3808) 2021-03-30 18:29:18 +02:00
dependabot[bot]
afb78abe04
Bump lxml from 4.6.2 to 4.6.3 (#3725)
Bumps [lxml](https://github.com/lxml/lxml) from 4.6.2 to 4.6.3.
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-4.6.2...lxml-4.6.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-23 15:26:06 +01:00
dependabot-preview[bot]
a7fb59d1f6
Bump celery-redbeat from 0.13.0 to 2.0.0 (#3544)
Bumps [celery-redbeat](https://github.com/sibson/redbeat) from 0.13.0 to 2.0.0.
- [Release notes](https://github.com/sibson/redbeat/releases)
- [Changelog](https://github.com/sibson/redbeat/blob/main/CHANGES.txt)
- [Commits](https://github.com/sibson/redbeat/compare/v0.13.0...v2.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-03 11:52:12 +01:00
dependabot-preview[bot]
0a0a8bd349
Bump parso from 0.6.1 to 0.8.1 (#3542)
Bumps [parso](https://github.com/davidhalter/parso) from 0.6.1 to 0.8.1.
- [Release notes](https://github.com/davidhalter/parso/releases)
- [Changelog](https://github.com/davidhalter/parso/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/davidhalter/parso/compare/v0.6.1...v0.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-01 20:11:36 +01:00
dependabot-preview[bot]
bf164b216a
Bump whitenoise from 5.0.1 to 5.2.0 (#3538)
Bumps [whitenoise](https://github.com/evansd/whitenoise) from 5.0.1 to 5.2.0.
- [Release notes](https://github.com/evansd/whitenoise/releases)
- [Changelog](https://github.com/evansd/whitenoise/blob/master/docs/changelog.rst)
- [Commits](https://github.com/evansd/whitenoise/compare/v5.0.1...v5.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-01 20:11:07 +01:00
dependabot-preview[bot]
f2d7a962e5
Bump django-deprecate-fields from 0.1.0 to 0.1.1 (#3536)
Bumps [django-deprecate-fields](https://github.com/3YOURMIND/django-deprecate-fields) from 0.1.0 to 0.1.1.
- [Release notes](https://github.com/3YOURMIND/django-deprecate-fields/releases)
- [Commits](https://github.com/3YOURMIND/django-deprecate-fields/compare/0.1.0...0.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-01 20:02:30 +01:00
dependabot-preview[bot]
8ef31567db
Bump asgiref from 3.2.7 to 3.3.1 (#3535)
Bumps [asgiref](https://github.com/django/asgiref) from 3.2.7 to 3.3.1.
- [Release notes](https://github.com/django/asgiref/releases)
- [Changelog](https://github.com/django/asgiref/blob/master/CHANGELOG.txt)
- [Commits](https://github.com/django/asgiref/compare/3.2.7...3.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-01 20:02:25 +01:00
dependabot-preview[bot]
b13bd73e85
Bump psycopg2-binary from 2.8.4 to 2.8.6 (#3543)
Bumps [psycopg2-binary](https://github.com/psycopg/psycopg2) from 2.8.4 to 2.8.6.
- [Release notes](https://github.com/psycopg/psycopg2/releases)
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](https://github.com/psycopg/psycopg2/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-01 20:01:36 +01:00
dependabot-preview[bot]
5ae87afecd
Bump pytz from 2019.3 to 2021.1 (#3545)
Bumps [pytz](https://github.com/stub42/pytz) from 2019.3 to 2021.1.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2019.3...release_2021.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-01 20:01:13 +01:00
James Greenhill
cd7ccc779e
Run all connections through clickhouse connection pooler (#3495)
* Use clickhouse connection pooler to avoid connections from stepping on eachother

* build reqs
2021-02-26 12:54:35 -08:00
dependabot[bot]
070fa181d2
Bump cryptography from 3.2 to 3.3.2 (#3281)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.2 to 3.3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.2...3.3.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 12:20:52 +01:00
James Greenhill
55db17eefb
Remove CH Pool as dependency (#3279) 2021-02-09 16:41:10 -08:00
Karl-Aksel Puulmann
58327b406d
Update clickhouse-driver (#3265)
We're having a lot of clickhouse noise in sentry, keeping good hygene by
keeping up.

Changelogs:
- https://github.com/mymarilyn/clickhouse-driver/blob/master/CHANGELOG.md
- https://github.com/ericmccarthy7/clickhouse-pool/releases/tag/v0.4.3
2021-02-09 19:40:50 +02:00
Michael Matloka
481e9ddc6f
Don't install unused pandas and numpy (#3034)
* Don't install unused pandas and numpy

* Use built-in NaN instead of Numpy's
2021-01-21 13:47:18 +01:00
dependabot[bot]
9f9516ab8e
Bump lxml from 4.6.1 to 4.6.2 (#2886)
Bumps [lxml](https://github.com/lxml/lxml) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-4.6.1...lxml-4.6.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-07 20:12:45 -06:00
Tim Glaser
e8d64117d3
Remove legacy funnel code (#2700)
* Remove legacy funnel code

* recsw

* Fix test
2020-12-08 18:23:46 +01:00
Noah Rickles
d924181fce
Issue #2573, Add django-axes (#2582)
* Closes #2573 adds django-axes middleware with default configuration, disabled during tests

* Added django-axes to requirements

* Moved environment variable declaration in tests script to see if django-axes is disabled during CI tests

* Removed disabling of django-axes in the tests script, updated expected number of queries in tests
2020-12-02 11:01:46 +01:00
Marius Andra
ad86e43cce
bump posthoganalytics to 1.1.3 (#2475) 2020-11-23 17:54:02 +01:00
Michael Matloka
b7b9e8caf3
Remove some seemingly unused requirements and use pip-compile (#2192)
* Remove some seemingly unused requirements

* Remove a few more

* Bring back dependencies of other requirements

* pip-compile prod requirements

* Sync with master updates

* Fix grep

* Revert "Fix grep"

This reverts commit 2e6538cad4.

* Fix grep but using cut

* Clean up and regenerate requirements

* Simplify requirements-dev

* Fix fakeredis import in production

* Black
2020-11-10 10:17:48 +01:00
Michael Matloka
1e44617cdd
Update Django from 3.0.7 to 3.0.11 (and Django-related packages) (#2190)
* Update Django from 3.0.7 to 3.1.3 (and Django-related packages)

* Roll Django back to 3.0.11
2020-11-04 12:40:14 +01:00
Michael Matloka
3f8b95b9e7
Update sentry-sdk from 0.16.5 to 0.19.2 (#2188)
* Update sentry-sdk from 0.16.5 to 1.19.2

* Restore original clickhouse-driver
2020-11-03 14:29:48 +01:00
James Greenhill
83b5273113
Protobufize events to protect from malformed JSON (#2085)
* Protobuf all the things

* oops

* Protobufize events to protect from malformed JSON

* format the generated files (will need to remember this for future)

* format

* clean up kafka produce serializer

* fixes
2020-10-28 15:18:52 -07:00
dependabot[bot]
55dbb55747
Bump cryptography from 2.9 to 3.2 (#2058)
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.9 to 3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.9...3.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-28 15:53:16 +01:00
Michael Matloka
51c329248f
Make PostHog compatibile with Python 3.9 (#1987)
* Make PostHog compatibile with Python 3.9

* Update actions/setup-python and run Django tests in matrix

* Don't test pypy

* Better specify Py matrix
2020-10-26 11:11:02 +01:00
Michael Matloka
533c7df105
Organization<>Team<>User structure (closes #1540) (#1562)
* Backend changes to implement #1461

* Added the missing migration files

* Fixes Typecheck errors

* Refactor request.user.team_set.get() to use request.user.team

* Updated user patch method to change current_team on team id instead of name

* Merged migration file

* Changes team property to return first item in queryset

* Fixes failing tests

* Changed User api to return the ids of the teams they are currently part of

* Frontend for changing teams

* Update and simplify migrations

* Improve team and user buttons

* Make team changing backend more logical

* Improve current_team mechanics

* Update test_team.py

* Fix Team.objects.create_with_data

* Update migration

* Update tests

* Make setup_review more convenient

* Add Organization and OrganizationMembership

* Replace is_admin with level

* Extend API

* Update team.py

* Improve modeling

* Improve handling of new mechanics

* Add proper migration

* Remove _ensure_organization_and_team

* Update 0084_org_team_user.py

* Improve user, org and team creation

* Make MembershipLevel more flexible for the future

* Add member deletion

* Fix naive datetime warnings

* Update setup_review.py

* Update API route

* Make PersonalAPIKey changes

* Update models and migrations, fix typing

* Fix typing

* Use MAC-less UUID v1 instead of v4 for better performance

* Add abstract UUIDModel

* Update utils.py

* Update utils.py

* Fix multi/unicast bit

* Update APIs, frontend and tests

* Update pull_request_template.md

* Fix comment

* Fix migration error

* Compress migrations

* Updates with minimal renaming

* More updates

* Make further updates

* Update test_team_user.py

* Fix issues

* Add migration

* Satisfy mypy

* Remove Signup redirect on logged in

* Use uuid1_macless in Person

* Fix typing

* Update tests

* Update /api/team/signup to /api/organization/signup

* Fix mypy issues and update tests

The remaining failures are actually missing functionality (TDD applied), so filling these in.

* Update 0086_org_live

* Make small improvements

* Implement permissions

* Remove now unneccesary membership check

* Update setup_dev.py

* Make small frontend improvements

* Add drf-nested-routers as requirement

* Remove unused import

* Implemented nested routes

* Remove cruft

* Add relevant org/proj/user name to headings

* Fix imports

* Update migration

* Replace unreliable drf-nested-routers with drf-extensions

* Improve unset team handling

* Make org and team creation proper

* Update migration

* Fix migration

* Update TopContent

* Update command palette for new sidebar structure

* Remove deprecated demo data deletion

* Assume that each org has a project and fix typing

* Require paid plan for multiple orgs and projects

* Make HogFlix demo a separate team

* Update migration

* Slightly improve style

* Adjust page layout bottom padding

* Make user dropdown nicer

* Fix base app tests

* Satisfy mypy

* Fix test_leave_organization

* Improve wording

* Possibly fix import

* Remove misplaced None check

* Enhance org and teams APIs and add tests

* Fix /api/projects for particular Team

* Improve invites and demo data

* Address feedback

* Put everything related to billing on Organization

* Fix minor issues

* Simplify invitation creation

* Update team model

* Make orgs and projects premium only on self-hosted

* Improve testing

* Update migration

* Remove extra License import

* Fix minor issues

* Fix Django tests

* Fix Cypress

* Fix yarn build

* Fix TeamSignupViewset

* Fix posthog-production incompatibility

* Remove extraneous insight endpoint registration

* Adjust tests for posthog-production

* Simplify invitations and fix email validation

* Address all feedback

* Satisfy mypy

* Update migration

* Fix constraint removal in migration

* Update tests

* Fix test creation edge case

* Run posthog-production CI tests against this branch and teams-live

* Ensure that js_posthog_api_key is always passed

* Fix preflight check pre-login

* Update cypress tests

* Update instanceStatus.js

* Bring ee tets up to par

* Bring actions-ux-201012 back

* Cypress retry in cypress.json

* Revert "Run posthog-production CI tests against this branch and teams-live"

This reverts commit d79cb844d8.

Co-authored-by: anna <ms.annaphilips@gmail.com>
Co-authored-by: Anna Philips <aphilips@matmacorp.com>
2020-10-22 10:58:32 +02:00
Paolo D'Amico
c5ea8220e7
bump drf-exceptions-hog (#1897) 2020-10-15 17:17:32 +02:00
Michael Matloka
f71e011a86
Command palette (#1819)
* add hotkey base

* add platform check

* Rename CommandBox to CommandPalette

* Add styled-components

* Restructure CommandPalette and add Esc handling

* Update utils.js

* add search box

* Add logic types

* Implement base logic

* Fix scroll prevention

* Update logic and add goto command base with Fuse fuzzy serach

* ux hotkey

* Implement command (de)registration

* minor fix

* base UI

* error message & hints

* command groups UI

* Add commands search

* Make commands work

* Prepare palette for fuzzy search and add basic labeling

* ui adjustments

* ui

* Improve colors

* switch to global command

* Optimize resolution

* global go to commands

* abstract item selection logic to command palette

* Update casing and types

* Add conditional useCommands

* Improve results

* keyboard nav

* keyboard nav fix

* removed double fuse (synonyms broken)

* Update style

* Fix highlighting

* Remove extra style

* conditional go to commands

* add mouse hover handling and rename functions

* remove mac check

* add more commands

* added insights stub pages

* Add command components

* refactor logic

* Update styling

* Remove extraneous `input`

* load custom dashboards to command palette

* Add input styling

* Add write icon

* Refactor results

* minor adjustments

* add person search

* remove papercups fully

* fix input indexing

* fix result executing empty

* Add command grouping and improve navigation

* add urls

* make logic explicit

* fix error with hadnler

* Remove redundant border-top

* add trend functions

* personal api key stub

* Add command palette toggle button

* Fix things

* fix personal api keys

* copy api key to clipboard

* Add toggle text

* Improve palette UX and perform refactoring

* Improve UX and add palette usage reporting

* tests refactor

* filter person list

* refactor api person tests

* add squeak

* deprecate by_distinct_id & by_email person endpoints

* Optimize squeak

* fix typegen error

* use new filters in frontend

* Optimize squeak

* key identifier refactor

* fix mypy

* removed unused code

* Make custom command UI more coherent

* Add calculator to palette

* Use equal sign

* Make palette button nicer

* Add lodash back officially and show palette suggestions

lodash is still used in a few places, but it was not in package.json. The reason this was working was that lodash is a dependency of some other depedencies, but this was fragile. It's still not ideal to use this, but at least this is now not a hack the way it was.

* Remove isHint

* Optimize graph time range command

* Move command results grouping to Kea logic

* Fix result focus autoshift

* Improve palette result focusing

* Adjust for window.posthog being optional

* add test for third-party person filters

* Remove styled-components in favor of .scss files

* Remove redundant container class

* Use insect (sic!) squeak instead of pig squeak

* Show only unique palette results

* Fix palette overlay

* Add powerful command building protocol CommandFlow

* Fix minor issues

* Always show scope when flow active

* Use custom label icon

* Add feedback sharing command

* block command input from being captured in screen recording

at least until we can figure out how to capture this info in a privacy-preserving way

* Hide palette button on narrow screens

* Improve responsiveness

* Fix palette feedback sending

* Fix Esc handling

* Add Message Sent info

* Fix Message Sent info

* Fix dashboard creation and null name handling

* Rename Cy tests to JS convention

* Add basic Cypress test

* Address feedback

Co-authored-by: Eric <eeoneric@gmail.com>
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2020-10-13 15:44:56 +02:00
Michael Matloka
5714ced2f9
Bump drf-exceptions-hog to 0.0.3 (#1845) 2020-10-13 10:48:03 +02:00
Paolo D'Amico
457ae83b80
Report all non-DRF exceptions to sentry (#1773)
* report all non-DRF exceptions to sentry

* update drf-exceptions-hog
2020-09-30 10:32:38 -04:00
James Greenhill
fad85a5f4e
Convert sync execute to use clickhouse connection pool (#1762)" (#1770) (#1771)
* Revert "Revert "Convert sync execute to use clickhouse connection pool (#1762)" (#1770)"

This reverts commit cbb8fb01a9.

* remove runtime requirement from posthog, that is convered in posthog-production

* Bump the max number of connections in the pool
2020-09-30 15:07:10 +01:00
James Greenhill
08f6879343
Bump posthoganalytics requirement for feature flag bugfixes (#1772) 2020-09-30 15:05:13 +01:00
James Greenhill
cbb8fb01a9
Revert "Convert sync execute to use clickhouse connection pool (#1762)" (#1770)
This reverts commit fedd2428aa.
2020-09-30 14:19:03 +01:00
James Greenhill
fedd2428aa
Convert sync execute to use clickhouse connection pool (#1762)
* Convert sync execute to use clickhouse connection pool

* type fixes

* use pool for tests to feel safe
2020-09-29 19:26:58 +01:00
Tim Glaser
6cbe76f401
Bump posthog analytics version (#1751) 2020-09-29 15:51:55 +02:00
James Greenhill
0b371d43ec
Revert "Clickhouse Features (#1565)" (#1748)
This reverts commit 24713b923d.
2020-09-29 12:11:28 +01:00
Paolo D'Amico
b3532c598a
Weekly report email V1 (#1700) 2020-09-29 11:56:29 +01:00
Eric Duong
24713b923d
Clickhouse Features (#1565)
* initial

* migration command

* migrations working

* add modelless views for clickhouse

* initial testing structure

* use test factory

* scaffold for all tests

* add insight and person api

* add basic readme

* add client

* change how migrations are run

* add base tables

* ingesting events

* restore delay

* remove print

* updated testing flow

* changed sessions tests

* update tests

* reorganized sql

* parametrize strings

* element list query

* change to seralizer

* add values endpoint

* retrieve with filter

* pruned code to prepare for staged merge

* working ingestion again

* tests for ee

* undo unneeded tests right now

* fix linting

* more typing errors

* fix tests

* add clickhouse image to workflow

* move to right job

* remove django_clickhouse

* return database url

* run super

* remove keepdb

* reordered calls

* fix type

* fractional seconds

* fix type error

* add checks

* remove retention sql

* fix tests

* add property storage and tests

* merge master

* fix tests

* fix tests

* .

* remove keepdb

* format python files

* update CI env vars

* Override defaults and insecure tests

* Update how ClickHouse database gets evaluated

* remove bootstrapping clickhouse database routine

* Don't initialize the clickhouse connection unless we say it's primary

* .

* fixed id generation

* remove dump

* black settings

* empty client

* add param

* move docker-compose for ch to ee dir

* Add _public_ key to repo for verifying self signed cert on server

* update ee compose file for ee dir

* fix a few issues with tls in migrations

* update migrations to be flexible about storage profile and engine

* black settings

* add elements prop tables

* add elements prop tables

* working filter

* refactored

* better url handling

* add mapping table

* add processing to worker task

* working cohort with actions

* add cohort property filtering

* add cohort property filtering

* reformat and add cohort processing

* prop clauses

* add util

* add more util

* add clickhouse modifier

* Clickhouse Sessions (#1623)

* sessions sql

* skeleton

* add endpoint

* better tests

* sessions list

* merge clickhouse-actions

* added session endpoint

* sessions sql working again

* add clickhouse modifier

* session avg with props working

* add dist

* tests working (no list)

* list working

* add formatting

* more formatting

* fix tests

* dummy commit

* fix types

* remove unnecessary improt

* ignore type when importing from ee in task

* fix test running

* Clickhouse Trends Base (#1609)

* initial working

* date param almost working

* fix date range and labels

* fixed monthly math

* handle compare

* change table

* using new event ingestion

* direct query actions working

* remove interface

* fix date range

* properties initial working

* handle operator

* handle operator

* move timestamp parse

* move more to util

* inital breaking down working

* working cohort breakdown

* some tests running

* fix sessions

* cohort tests

* action and interval test

* reorder cohort filtering

* rename retention test

* fix inits

* change multitenancy tests

* fix types

* fix optional types

* replace ch_client.execute with sync_execute

* replace ch_client.execute with sync_execute, part 2

* Clickhouse Stickiness + Process Event (#1654)

* 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

* Basic stickiness query

* Clickhouse Stickiness tests

* stickiness test [WIP, actions fail]

* generate clickhouse uuid script

* change default test runner if PRIMARY_DB=clickhouse

* fix stickiness test for actions

* fix merge bug

* remove _create_person stub; cohort person_id is UUID now

* fix typing

* Clickhouse trends process math (#1660)

* most of process math works

* all process math

* fix ordering issue

* unusued imports

* update property comparison for process_event_ee

* indentation wrong missing calls

* demo users and events (#1661)

* finish breakdown filtering tests and reformat label function

* add increment to demo_data

* update demo data populating

* Add people endpoint for ch (#1670)

* add people endpoint for ch

* stickiness people

* fix value padding

* add process math to breakdown and

* add limit

* fix tests

* condensed code

* converted test to factory

* add people tests

* add month handling

* add typing fix

* change people test handling

* fix tests

* Clickhouse funnels 2 (#1668)

* add elements to create_event

* WIP closes #1663 Add funnels to clickhouse

* Make funnels work

* Clean up

* Move filtering around

* Add mypy tests and fix

* Performance improvements

* fix person tests again

* add people for funnel endpoint

* fix prop numbering

Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Eric <eeoneric@gmail.com>

* merge master

* add retention

* update types

* more typing errors

* fix types

* bug with kafka payload, elements insert, and demo data

* Clickhouse Paths (#1657)

* paths clickhouse test (fails)

* add elements to create_event

* make this fail for clickhouse

* hardcoded query that returns good results for $pageviews, no filters yet

* clean up queries

* bound by time, fix 30min new session boundary

* support screen and custom events

* add properties filter

* paths url

* filter by path start

* better path start test

* even better path start test

* start from the first "path start" in a group

* test for person_id in paths

* partition by person_id for POSTGRES paths

* partition by person_id for Clickhouse paths

* clean up order in paths test

* clean up order in paths test

* join elements

* force element order on element group creation

* remove "order" when creating elements in tests and demo

* get list of elements for paths

* add limit to paths query

* use materialized view

* rename "element_hash" to "elements_hash" (no change in db)

* cull rows that are definitely unused

* simplify query

* New highly optimized paths clickhouse query

* start_point for $autocapture paths

* extract event property values from clickhouse

* prevent crash

* select one element sql

* get elements for event

* remove lodash

* remove host from $pageview path elements if same domain as incoming path

* show metadata based on loaded paths filter, not in flight filter

* fix order (all soures and targets in order, not all sources first, then all targets after) - makes for a better looking graph

* add test that makes the Postgres paths query fail

* fix postgres paths --> no fuzzy matching, breaks "starts with" for urls and gives too many incorrect start points

* create automatic /demo urls that match the real urls (no ending /)

* fix elements queries

* path element joins

* create persons via postgres in paths test

* change serializers back to id

* fix tests with uuid

* fix demo

* more bugs

* fix type

* change now to timezone aware

* [clickhouse] retention filters (#1725)

* implemented target entity and prop filtering

* add insight view override

* fix endpoint and filters

* include tests

* fix tests

* add period filtering

* .

* fix pg param name

* add filtering params to both queries in retention sql

* fix param again

* change to todatetime

* change tz to timezone

* add back timezone in model/event

* [clickhouse] feature flag endpoint requests (#1731)

* add feature flags to endpoints

* add flags to endpoints that check on request

* remove magic strings and fill in missing flags

* fix types

* add missing flag

* change from iso

* fix more timestamps and comparator

* change _people to get_people in actions view

* remove action and cohort populating

Co-authored-by: James Greenhill <jams@uber.com>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Tim Glaser <tim.glaser@hiberly.com>
2020-09-29 06:36:50 -04:00
Paolo D'Amico
6320d05b08
Use drf-exceptions-hog package (#1732) 2020-09-29 09:07:51 +01:00
Michael Matloka
9d7dae201a
Make production docker-compose.yml generated (#1704)
* Make production docker-compose.yml generated

* Move "version" to top

* Update instructions

* Leave a fallback docker-compose.yml

* Fix grammar

* Update instructions

* Delete docker-compose.proxy.yml

* Improve error handling

* Update script

* Update wording
2020-09-28 20:50:38 +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