0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
Commit Graph

41 Commits

Author SHA1 Message Date
Sandy Spicer
23a789d9fe
chore: upgrade python to 3.11 🐍 (#22932)
🐍
2024-06-21 16:45:42 +00:00
Vladislav Supalov
f643ef32d0
chore(dev): Pin devcontainer pnpm version (#22023)
* fix: pin pnpm version

* fix: use corepack for correct pnpm version

---------

Co-authored-by: Vladislav Supalov <mail@vsupalov.com>
2024-05-03 13:31:41 +02:00
Ben White
8deaf4e8ea
feat: Swapped to use KAFKA_HOSTS everywhere (#16109)
* Swapped to use KAFKA_HOSTS everywhere

* Fixed up type of kafka config options and setup separate kafka hosts for blob consumer

* allow session recordings to have its own kafka security protocol

* remove slash commands from this pr

* syntax must be obeyed

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* fix

* Update query snapshots

* no empty strings in kafka hosts

* fix snapshot

* fix test

---------

Co-authored-by: Paul D'Ambra <paul@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-19 12:15:17 +01:00
Ben White
27b75226b0
feat: Completely separate ingestion for replay events (#16024)
---------

Co-authored-by: Paul D'Ambra <paul@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-15 14:13:28 +01:00
Harry Waye
7b86fae6b0
chore(codespaces): add deps for running bin/start, plus GH cli (#15067)
Need brotli and netcat for it to work.

Also, install the GH client to make creating prs from the command line
easier.
2023-04-13 09:58:46 +00:00
Harry Waye
f29204ef49
fix: run prettier formatting on .devcontainer.json (#15050)
* ci(cdp): push image as latest on master

* chore: add SECRET_KEY env var to codespaces

Now that I'm sharing the key between the Django app and the CDP work, we
want it to be set as a global env var.

* fix: run prettier formatting on .devcontainer.json

* fix format
2023-04-12 14:24:00 +00:00
Harry Waye
4826874f31
chore: add SECRET_KEY env var to codespaces (#15049)
* ci(cdp): push image as latest on master

* chore: add SECRET_KEY env var to codespaces

Now that I'm sharing the key between the Django app and the CDP work, we
want it to be set as a global env var.
2023-04-12 13:47:37 +00:00
Harry Waye
0c23f9c3ae
fix: specify correct workspace folder (#14920) 2023-03-29 12:39:14 -04:00
Paul D'Ambra
eb04734131
chore(ci): try and successfully install pnpm in the code spaces build (#14832) 2023-03-20 21:27:19 +00:00
Harry Waye
01da91d1e2
test: remove explicit dependencies from functional tests (#14471)
* test: remove explicit dependencies from functional tests

* Install pnpm in devcontainer
2023-03-01 12:03:54 +00:00
Harry Waye
3c962ecb14
dev(codespaces): update to python3.10 (#14449)
Was updated elsewhere, but not here. Some people are reporting issues
with not being able to run the app with Python3.10 so I wanted to make
sure I could!
2023-02-28 15:48:18 +00:00
Guido Iaquinti
9acbb57623
chore(NodeJS): use Node.js v18 (#12650) 2022-12-12 15:02:33 +01:00
Harry Waye
a70b4b28c6
chore(web): add django-prometheus exposed on /_metrics (#11000)
* chore(web): add django-prometheus exposed on /_metrics

This exposes a number of metrics, see
97d5748664/documentation/exports.md
for details. It includes histogram of timings by viewname before and
after middleware.

I'm not particularly interested in these right now, but rather would
like to expose Kafka Producer metrics as per
https://github.com/PostHog/posthog/pull/10997

* Refactor to use gunicorn server hooks

* also add expose to dockerfile

* wip
2022-07-27 20:37:44 +01:00
Harry Waye
328534b9fd
chore(codespaces): add env vars for running codespaces dev (#10923)
* chore(codespaces): add env vars for running codespaces dev

These will be used by vscode and any terminals spawned

* Use default python interpreter

* chore(codespaces): add env vars for running codespaces dev

These will be used by vscode and any terminals spawned

* Use default python interpreter

* add kafka to hosts

* fix hosts

* add to hosts on docker run

* keep python path

* wip
2022-07-25 15:21:00 +01:00
Harry Waye
d7998cef30
Revert "chore(dev): use network mode host for docker-compose services (#10917)" (#10926)
This reverts commit 225a41db72.
2022-07-22 10:25:59 +01:00
Harry Waye
225a41db72
chore(dev): use network mode host for docker-compose services (#10917)
* chore(dev): use network mode host for docker-compose services

This removes the need to add kafka to /etc/hosts.

As far as I can tell this should be fine for peoples local dev except
they will be required to reset and re-migrate ClickHouse tables as they
will be trying to pull from `kafka` instead of `localhost`.

* remove ports from redis

* Update a few more references
2022-07-21 15:29:31 +01:00
Guido Iaquinti
cda6b83148
chore(Dockerfile): remove dev.Dockerfile (#10529) 2022-06-28 13:50:57 +02:00
Eric Duong
46faa8fab2
refactor(FOSS): foss remove all ee dependencies from /posthog (#10319)
* refactor: foss move properties to /posthog

* refactor: move replication and materializtaion

* refactor: move file

* refactor: move test and journeys

* refactor: move breakdown props

* refactor: move query imports

* refactor: move more ee dependencies

* refactor: restore groupsjoinquery

* fix: errors

* refactor: no ee.clickhouse dependncies

* try import tasks

* refactor: move materialization

* refactor: change foss split for column optimizer

* run black

* fix: imports

* remove comment

* Update snapshots

* run black

* skip isort

* Update snapshots

* format

* more fixes

* refactor(FOSS): split out paths query code (#10378)

* refactor: move migrations

* refactor: move idl

* fix: move more imports

* import adjustments

* fix: test import

* fix: test import

* fix: remove restriction

* refactor: split out paths query code

* refactor: more code splitting

* fix: types

* refactor(FOSS): Setup such that FOSS is deployable (#10352)

* refactor: move migrations

* refactor: move idl

* fix: move more imports

* import adjustments

* fix: test import

* fix: test import

* fix: remove restriction

* fix import

* refactor: add snapshost

* subscription-import

* fix: safe import

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-22 17:24:03 -04:00
James Greenhill
2e69e0d4bb
chore: bump defaults for clickhouse to 22.3 across the board (#9847)
* chore: bump defaults for clickhouse to 22.3 across the board

* remove docker build instructions for clickhouse

* remove 21.11.11.1 from matrix

* prettier it
2022-05-20 20:32:22 -07:00
James Greenhill
49c56fabe3
chore: Add ClickHouse version 22.3 to CI and set 21.11.11.1 to be default except for ARM64 compose (#9743)
* chore: Remove ClickHouse version 21.6 and add 22.3 for testing and docker-compose (21.6 is not in clickhouse dockerhub)

* update service requirements

* update arm64 compose as well

* Default to 21.11.11.1 and support multiple dockerhub repositories

* prettier .github/workflows/ci-backend.yml
2022-05-16 14:00:43 -07:00
Harry Waye
8dad49d75f
chore(codespaces): use Dockerfile not docker-compose (#9659)
* dev(codespaces): use Dockerfile not docker-compose

I wasn't so confident around the updating of the docker-compose file to
include minio, and the workflow around it. I'd rather just drop into
something with docker-in-docker and run docker-compose myself.

Also finally added some extensions I'm using so I don't need to enable
them all the time.

TODO: update docker-compose file to work with docker-in-docker. At the
moment I don't think the networking will be correct.

* Merge remote-tracking branch 'origin/master' into hackaton_session_rec

* add new line

* remove yarn install, it will be overwritten by the codespaces mount

* revert compose formatting

* format with prettier
2022-05-05 14:05:56 +00:00
Guido Iaquinti
ac10b93348
ci(zookeeper version/image): use zookeeper:3.7.0 (#9638) 2022-05-04 16:07:54 +02:00
Guido Iaquinti
90ef8e2373
ci(redis version/image): use redis:6.2.7-alpine (#9620) 2022-05-03 15:35:26 +02:00
Harry Waye
fbdefdab1d
feat(trends): add moving average smoothing_intervals param (#6435)
* feat(trends): add moving average `smoothing_intervals` param

This will average over the preceding `smoothing_intervals` intervals.
The driver for this is to remove either weekly or monthly trends.

Limitations at the moment are that it only works for total volume
queries, as it relies on the results from clickhouse being from a single
timeline series.

* WIP UI for selecting smoothing

* WIP: Fix typing and appearce logic

* Made smoothing extensible beyond day

* Test now considers a non-trivial case

* chore(smoothing): use url params for state storage of smoothing value

This should allow for url navigation to work, although I haven't quite
figured out how we then use this to make the insights/trends POST
request

* Added further tests for smoothing intervals

* fix test_to_dict

* fix trend tests

* Added test to validate preceeding limit

* Fixed test for 2 interval

* clear django redis cache before each test

* add explicit ordering to dashboard items in refresh test

Otherwise the test is not deterministic.

* Revert "clear django redis cache before each test"

This is a good thing to do, but I don't want to open up a discussion on
this PR. It was not fix for the immediate intermittent
test_refresh_cache test

This reverts commit aa52f332f3.

* format

* clickhouse trends: SET allow_experimental_window_functions = 1

* fix setting of allow_experimental_window_functions

* add cache clears for requests

* Delete SmoothingFilterLogic.ts

Removed smoothing filter logic file

* Use `SMOOTHING_INTERVALS` instead of string literal

This should ensure that if we update the url param key somewhere, we don't have to remember to change it here as well.

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>

* move test_trends to ee

* actually delete test_trends.py

* Transitioned smoothing logic to use Logic

* WIP: Moving away from url based logic

* WIP: Refactored logic on listeners

* fix storybook

* refactor

* set redis url

* remove keastory

* Move interval filter to setFilters insight logic

* update trend snapshots

* run prettier

* Add stickiness test deps that were in test_trends

* Fix storybook

* fix stickiness tests

* update snapshot

* fix cohort test

* only display smoothing on linear

* fix tests

* Add some tests

* added box to make dropdown consistent

* Floor

* fix tests

* fix tests

* fix test

* Add feature flag

Co-authored-by: Marcus Hyett <marcus@posthog.com>
Co-authored-by: Marcus Hyett (PostHog) <85295485+marcushyett-ph@users.noreply.github.com>
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: Tim Glaser <tim@glsr.nl>
2022-03-23 15:54:38 +00:00
Guido Iaquinti
e70eac9474
chore(Kafka): change default Kafka container image (#9087) 2022-03-21 12:49:43 +01:00
Harry Waye
2e9a3954bb
ci(codespaces): install node 16 in codespaces image (#9030)
We've updated node elsewhere and increased the requirements, so we need
to also update in codespaces.
2022-03-15 12:24:39 +00:00
Guido Iaquinti
98ca2904be
feat(ClickHouse): upgrade Docker references to 21.11.11.1 (1/2) (#8860)
* feat(ClickHouse): upgrade Docker references to 21.11.11.1 (1/2)

* ci(backend): run tests on docker-compose changes

Co-authored-by: Harry Waye <harry@posthog.com>
2022-03-15 11:19:21 +00:00
Paolo D'Amico
655c1ce9a4
refactor(enteprise): Removes conditional SAML dependencies (#8952) 2022-03-10 07:14:30 -06:00
Harry Waye
3ad5609e56
dev(codespaces): fix clickhouse volume paths (#8817)
As part of yeetcode I think we accidentally broke some of the volume
path loading for clickhouse, this just reverts.

Refers to
a71e899605 (diff-67a4805fdcc6145d7b3ada2a6099a9b2e91c9d0fd108c22f95d2f01d219793d1)
2022-03-02 15:25:12 +00:00
Harry Waye
aafad724ea
fix(codespaces): only pin versions to major versions (#8318)
* fix: don't pin docker.io, avoid package install issues

* pin to major versions
2022-01-28 11:23:17 +00:00
Eric Duong
a71e899605
Yeetcode (#7830)
* remove django query tests

* remove funnel and caching check

* remove ee available var

* remove is_clickhouse_enabled

* remove abstract tests

* change primary db

* missing func

* unnecessary test

* try new e2e ci

* func arg

* remove param

* ci

* remove plugins in docker

* background

* change ur;

* add kafka url

* add step

* update docker

* primary docker file

* mount volumes correctly

* one more

* remove postgres tests

* remove foss

* remove all  is_clickhouse_neabled

* remove irrelelvant test

* remove extra arg

* remove var

* arg

* add foss comment

* add foss comment

* plugin server config

* Update posthog/utils.py

Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>

* migrate commands

* comment

* add clickhouse to pg tests

* change script

* change ordering

* deepsource

* restore foss tests

* test remove KAFKA_ENABLED from CI

* always wait

* up proper resources

* use one conftest

* restore

* remove unnecessary tests

* remove more pg

* log event tests

* fix more tests

* more tests

* type

* fix more tests

* last test

* typing

* account for shared class setup

* temp test cloud

* restore cloud master checkout

* adjust contexts

* backwards

Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>
Co-authored-by: yakkomajuri <yakko.majuri@gmail.com>
2022-01-18 14:32:28 -05:00
Paolo D'Amico
c1af8f377f
Fix codespaces build (#7587) 2021-12-08 15:21:28 -07:00
Harry Waye
7108f1911a
dev(codespaces): make sure REDIS_URL set in codespaces (#7553)
This needs to be set for django to get to the redis celery broker
properly.
2021-12-07 12:17:59 +00:00
Harry Waye
71fa440394
Reimplement codespaces support (#7234)
* dev(codespaces): add "lean in" docker configuration for codespaces

This changes creates a dedicated `docker-compose.yml` and `Dockerfile`
for codespaces and doesn't attempt to have compatability with the
existing docker config files. This is intentional and is designed to be
a close to what codespaces would consider the ideal, so as to understand
what great would look like.

At the moment it doesn't do, but could:

 1. install python and node packages in the image
 2. push this image up to dockerhub
 3. specify this image to be used for caching. There is a "cacheFrom"
    option in the [.devcontainer
    reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference)
    although I haven't checked how this works with using
    `docker-compose.yml`. Perhaps we just need to add the `image:`
    property to the `app` service :fingerscrossed:
 4. specify default extensions and settings to be used.

* Use python 3.9, not the latest python 3 codespaces supports

* Add some basic python default settings and extensions

* add github codespaces image build workflow

* chore: update docker-compose cache from :cache tag

* chore: use docker cache-to inline

* add codespaces platform comment

* temp run on branch

* chore: fix flatforms format

* chore: update qemu comment

* chore: codespaces build use master image

* chore: target x86_64

* chore: just use image for codespaces, don't try to build

* add in python, node requirements

* install node

* install node

* uncomment node deps install

* use app network stack for all services

* move .env to .dev.env and us in docker-compose

* set WORKDIR to workspace

* pin apt packages

* pin versions, remove apt-key

* add yarn cache clean

* Fix hadolint warnings

* make codespace build on master, or a PR with codespaces-build label

* add missing &&

* dont bother with clickhouse install, its huge

* dont be cute with the networks, just expose explicitly

* fix network

* create container zsh

* correct .env path

* point app to the clickhouse container

* Also install saml deps

* ignore .env again

* libxml already installed

* correct conditional workflow comment
2021-11-23 08:34:51 +00:00
James Greenhill
e7cb7c89e8
Update devcontainer for docker success (#6148) 2021-09-28 15:05:28 +01:00
James Greenhill
de75cb9d33
Use web not backend script for codespaces (#6145)
fixes webpack issues
2021-09-28 11:52:04 +01:00
James Greenhill
bd72c05033
Allow codespaces container to connect to docker host (#5981) 2021-09-16 01:54:44 +00:00
Karl-Aksel Puulmann
fc5c6476a0
Revert "Revert "Add is_deleted column to person_distinct_id"" (#5194)
* Revert "Revert "Add is_deleted column to person_distinct_id (#5151)" (#5193)"

This reverts commit 401268bdba.

* A tweak for docker-compose builds

Co-authored-by: James Greenhill <fuziontech@gmail.com>
2021-07-19 19:47:41 -07:00
Karl-Aksel Puulmann
401268bdba
Revert "Add is_deleted column to person_distinct_id (#5151)" (#5193)
This reverts commit b1c11ba7dc.
2021-07-19 12:57:42 +03:00
Karl-Aksel Puulmann
b1c11ba7dc
Add is_deleted column to person_distinct_id (#5151)
* Update PERSONS_ACTIVE_USER_SQL query

* Remove dead import

* Update lifecycle queries

* Update BREAKDOWN_ACTIVE_USER_INNER_SQL to use new persons query

* Update STICKINESS_SQL

* Update STICKINESS_PEOPLE_SQL

* Update STICKINESS_ACTIONS_SQL

* Update paths query

* Update events query

* Update CALCULATE_COHORT_PEOPLE_SQL

* Update retention queries

* Update TOP_PERSON_PROPS_ARRAY_OF_KEY_SQL

* Update EVENT_JOIN_PERSON_SQL

* Update GET_PERSON_ID_BY_ENTITY_COUNT_SQL

* Remove remaining references to old get latest person query

* Update GET_DISTINCT_IDS_BY_PROPERTY_SQL

* Fix code style issue

* Update table engine for person_distinct_id table

* don't select team_id

* Make person deletion work

* Use replacingmergetree over collapsing with is_deleted

Replacing an existing engine is hard, let's not do it

* Update query in test

* add migration

* set database on materialized views

* Update plugin server to 1.1.6

Co-authored-by: James Greenhill <fuziontech@gmail.com>
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2021-07-19 12:43:44 +03:00
James Greenhill
aecd5ce743
Add codespaces config for github remote dev (#5113)
* Add codespaces config for github remote dev

* add lodash for dev

* remove lodash and add echo for ease

* Update motd and remove lodash (works)
2021-07-15 11:53:52 -07:00