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

91 Commits

Author SHA1 Message Date
Sandy Spicer
eac199d24a
chore: upgrade python to 3.11 (#23206) 2024-06-27 14:16:27 -07:00
Sandy Spicer
6c23c9bd89
revert: "chore: upgrade python to 3.11 🐍" (#23198)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-24 11:50:48 -07:00
Sandy Spicer
23a789d9fe
chore: upgrade python to 3.11 🐍 (#22932)
🐍
2024-06-21 16:45:42 +00:00
Ben White
95a0b85848
feat: DeliveryHog (#22706) 2024-06-10 15:12:04 +02:00
Marius Andra
45d275c4ee
feat(not-defining): Hog (#22336) 2024-05-28 14:51:45 +02:00
Michael Matloka
233d3a9098
chore(deps): Remove unused Python requirements (#21580)
* chore(deps): Remove unused Python requirements

* Also remove `dnspython`

* Recompile txts

* Revert "Also remove `dnspython`"

This reverts commit 7eaf89979b774808cc0920c34a3a1cf1d75d2f14.

* Re-recompile txts

* Remove more deps based on `deptry`

* Restore `phonenumberslite`

* Restore `geoip2`

* Restore `python3-saml`

* Move `prance` and `openapi-spec-validator` to dev reqs

* Reorder `geoip2`

* Force HTTP 1.1 in downloading MMDB

Should fix CI failures caused by `curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)` (e.g. https://github.com/PostHog/posthog/actions/runs/8741861825/job/23988870688?pr=21580).
2024-04-22 22:52:47 +02:00
Frank Hamand
3f9fd8aec7
feat: allow asgi/wsgi to be configurable by env var (#21635)
allow asgi/wsgi to be configurable by env var

This will let us roll out asgi separate across services as we had
issues with our recordings capture pods on asgi
2024-04-18 10:13:06 +01:00
danielxnj
f0f230ea4d
chore: bump base image to fix vulns (#20885)
Co-authored-by: xneyder <xneyder@gmail.com>
2024-03-13 08:29:29 -04:00
Ben White
7bfb0cff15
fix: Docker build not reporting errors (#20892) 2024-03-13 12:29:19 +00:00
Paul D'Ambra
4b12f76bc4
feat: patch canvas export into rrweb (#19861)
* feat: patch canvas export into rrweb

* like that?

* like that?
2024-01-19 13:41:19 +00:00
Michael Matloka
6112daf720
chore(dev): Immediately pick up new Tailwind classes being used (#19736)
* chore(dev): Pick up new Tailwind classes being used

* Remove `postcss.config.js` from production

It's only used in Storybook.
2024-01-15 09:45:26 +00:00
Michael Matloka
5c51230ea4
chore(frontend): Real Tailwind + Autoprefixer (#19051)
* chore(frontend): Real Tailwind + Autoprefixer

* Align some non-standard utility class usage with Tailwind

* Start using container queries

* Update tailwind.config.js

* Move PostCSS packages into prod dependencies

* Add EE

* Add larger spacings for properties other than width

* Fix spacing backward compat

* Add max-w-1/2

* Remove Tailwind normalization

* Ensure JIT analysis works

* Actually we don't need a container query for this

* Clean up more

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update production.Dockerfile

* Extend `fontSize` instead of replacing

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Fix production build

* Add clarification comment

* Update trends.cy.ts

* Fix `scale` usage

* Fix minor styling issues

* Upgrade to Tailwind 3.4

* Actually use `cssnano`

* Don't use `cssnano` in dev

* Solve annoying Tailwind logs

* Add comment explaining plugins being defined twice

* Fix side panel icon rotation

* Reset snapshots

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update query snapshots

* Update query snapshots

* Fix dockerfile

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Fix up flag wrap

* Update UI snapshots for `chromium` (2)

* Fix

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ben White <ben@posthog.com>
2024-01-08 13:26:12 +01:00
Frank Hamand
636d0c44b3
chore: Remove old dockerfile and only build a single image with unit (#19614)
* Remove old dockerfile and only build a single image with unit

We have migrated over to the `unit` image (instead of gunicorn) but we
were still building both. This could lead to confusion - we have no
plans to move back so let's remove the second image build and only
build the unit based image

* Remove unit build id
2024-01-05 15:06:01 +00:00
Paul D'Ambra
41ba028f7a
fix: copy EE frontend files during dockerfile build (#18951)
* fix: try different import mechanism

* dockerfile copy

* but without concatenation

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-29 12:58:10 +00:00
Marius Andra
06e993818d
feat(apps): transpile via django (#18201) 2023-11-07 21:56:59 +00:00
Brett Hoerner
e3d7fa9e49
chore: add commit hash file to the built docker image (#17833) 2023-10-06 07:28:25 -06:00
Marius Andra
558b3b0e30
feat(hogvm): remove hogvm cohort matching (#16931) 2023-08-09 00:01:01 +02:00
Joe Martin
d1899c6005
fix: Removing some self-hosted upgrade paths and references (#16711)
* Remove self-hosted references

* Update messages in tests too

* Update query snapshots

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: Michael Matloka <michal@matloka.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-24 19:44:44 +02:00
Paul D'Ambra
a5f83972eb
feat: gzip support for plugin server kafka (#16239)
* chore: log librd kafka features on blob ingester start

* one line to rule them all

* wat

* feat: gzip support for plugin server kafka (#16240)

* feat: gzip support for plugin server kafka

* need to specify earth standard gravity
2023-06-26 15:15:18 +01:00
Xavier Vello
5e28ad5c3d
chore(plugin-server): patch unhandled exception in pg library (#15960) 2023-06-20 10:22:41 +02:00
Frank Hamand
0f12398137
fix: Set the posthog uid/gid to be hard-coded (#15347)
Set the posthog uid/gid to be hard-coded

Currently the uid and gid are 999/1000 respectively, but this could potentially
change when updating the base image, so hard-code these so that we can
rely on these not changing and breaking volume ownership
2023-05-03 11:05:48 +00:00
Xavier Vello
c4cd48b403
chore: upgrade pnpm to 8.3.1 (#15273) 2023-04-28 11:35:58 +02:00
Harry Waye
997b3ff9dd
fix(plugin-server): only set ssl config when defined (#15071)
* Revert "Revert "perf(recordings): use node-librdkafka for ingester production" (#15069)"

This reverts commit ac5e084f48.

* fix(plugin-server): only set ssl config when defined

Hopefully this means it will use the global CA bundle.

* hack: enable debug logs

* honor KAFKAJS_LOG_LEVEL envvar

* add SegfaultHandler

* disable ssl verification

* debug -> info

* only log brokers

* Revert "add SegfaultHandler"

This reverts commit b22f40b802.

---------

Co-authored-by: Xavier Vello <xavier@posthog.com>
2023-04-13 16:52:51 +01:00
Xavier Vello
ac5e084f48
Revert "perf(recordings): use node-librdkafka for ingester production" (#15069)
Revert "perf(recordings): use node-librdkafka for ingester production (#15041)"

This reverts commit 7f852ab618.
2023-04-13 11:23:22 +01:00
Xavier Vello
7f852ab618
perf(recordings): use node-librdkafka for ingester production (#15041) 2023-04-13 11:55:16 +02:00
Xavier Vello
adc0acc4bc
chore(recordings): revert: use node-librdkafka for ingester production (#15032)
Revert "chore(recordings): use node-librdkafka for ingester production (#14460)"

This reverts commit c34979853e.
2023-04-11 17:10:49 +00:00
Harry Waye
c34979853e
chore(recordings): use node-librdkafka for ingester production (#14460)
Previously we've been using the KafkaJS Producer with a wrapper around
it to handle batching. There are a number of issues with the batching
implementation e.g. not having a way to provide guarantees on delivery
and rather than fix that, we can simply use the librdkafka Producer
which is a lot more mature and battle-tested.
2023-04-11 16:44:39 +01:00
Frank Hamand
0dfc549f96
chore: Python 3.10 (#14360)
* Python 3.10

Performance gains go brrr

* Add missing SAML deps

* Add missing dep to dockerfile

* Update mypy to 0.981 for 3.10.7 compatibility

Needed this bug to be fixed: https://github.com/python/mypy/issues/13627

This also incidentally fixed the mypy bug in csv_exporter.py

* bump to 3.10.10
2023-02-24 09:14:09 +00:00
Frank Hamand
1d7afd3352
chore: Python 3.9 (#14336)
* Update to python 3.9

* Update pytest

6.2.2 doesn't support python 3.9+

* Add missing saml dependencies

* Update snapshots

* Update snapshots

* Update snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-22 09:23:22 +00:00
Guido Iaquinti
19d65fb005
chore(dockerfile): switch base image to non alpine (#13314) 2022-12-16 11:12:11 +01:00
Guido Iaquinti
ed59f8f23d
chore(frontend): fix dev/prod dependencies (#13328) 2022-12-14 15:30:48 +01:00
Thomas Obermüller
4a30e78b22
chore: use pnpm to manage dependencies (closes #12635) (#13190)
* chore: use pnpm to manage dependencies

* Fix CI errors

* Don't report Docker image size for external PRs

* Fix pnpm-lock.yaml formatting

* Fix module versions

* Ignore pnpm-lock.yaml

* Upgrade Cypress action for pnpm support

* Set up node and pnpm before Cypress

* Fix typescript issues

* Include patches directory in Dockerfile

* Fix Jest tests in CI

* Update lockfile

* Update lockfile

* Clean up Dockerfile

* Update pnpm-lock.yaml to reflect current package.json files

* remove yarn-error.log from .gitignore

* formatting

* update data exploration readme

* type jest.config.ts

* fix @react-hook issues for jest

* fix react-syntax-highlighter issues for jest

* fix jest issues from query-selector-shadow-dom

* fix transform ignore patterns and undo previous fixes

* add missing storybook peer dependencies

* fix nullish coalescing operator for storybook

* reorder storybook plugins

* update editor-update-tsd warning to new npm script

* use legacy ssl for chromatic / node 18 compatibility

* use pnpm for visual regression testing workflow

* use node 16 for chromatic

* add @babel/plugin-proposal-nullish-coalescing-operator as direct dependency

* try fix for plugin-server

* cleanup

* fix comment and warning

* update more comments

* update playwright dockerfile

* update plugin source types

* conditional image size reporting

* revert react-native instructions

* less restrictive pnpm verions

* use ref component name in line with style guide

Co-authored-by: Jacob Gillespie <jacobwgillespie@gmail.com>
2022-12-12 10:28:06 +01:00
Guido Iaquinti
c608e00943
chore(openssl): NodeJS upgrade to v18.12.1 (#12689) 2022-11-09 09:24:03 +00:00
Harry Waye
cd82caab01
feat(ingestion): remove Graphile worker as initial ingest dependency (#12075)
* feat(ingestion): remove Graphile worker as initial ingest dependency

At the moment if the Graphile enqueing of an anonymous event fails e.g.
due to the database that it is uing to store scheduling information
fails, then we end up pushing the event to the Dead Letter Queue and to
not do anything with it further.

Here, instead of directly sending the event to the DB, we first push it
to Kafka, an `anonymous_events_buffer`, which is then committed to the
Graphile database. This means that if the Graphile DB is down, but then
comes back up, we will end up with the same results as if it was always
up*

(*) not entirely true as what is ingested also depends on the timings of
other events being ingested

* narrow typing for anonymous event consumer

* fix types import

* chore: add comment re todos for consumer

* wip

* wip

* wip

* wip

* wip

* wip

* fix typing

* Include error message in warning log

* Update plugin-server/jest.setup.fetch-mock.js

Co-authored-by: Guido Iaquinti <4038041+guidoiaquinti@users.noreply.github.com>

* Update plugin-server/src/main/ingestion-queues/anonymous-event-buffer-consumer.ts

Co-authored-by: Guido Iaquinti <4038041+guidoiaquinti@users.noreply.github.com>

* include warning icon

* fix crash message

* Update plugin-server/src/main/ingestion-queues/anonymous-event-buffer-consumer.ts

* Update plugin-server/src/main/ingestion-queues/anonymous-event-buffer-consumer.ts

Co-authored-by: Yakko Majuri <38760734+yakkomajuri@users.noreply.github.com>

* setup event handlers as KafkaQueue

* chore: instrument buffer consumer

* missing import

* avoid passing hub to buffer consumer

* fix statsd reference.

* pass graphile explicitly

* explicitly cast

* add todo for buffer healthcheck

* set NODE_ENV=production

* Update comment re. failed batches

* fix: call flush on emitting to buffer.

* chore: flush to producer

* accept that we may drop some anonymous events

* Add metrics for enqueue error/enqueued

* fix comment

* chore: add CONVERSION_BUFFER_TOPIC_ENABLED_TEAMS to switch on buffer
topic

Co-authored-by: Guido Iaquinti <4038041+guidoiaquinti@users.noreply.github.com>
Co-authored-by: Yakko Majuri <38760734+yakkomajuri@users.noreply.github.com>
2022-10-10 15:40:43 +01:00
Harry Waye
f95f6107d3
chore(cloud): remove reference to posthog/posthog-cloud Dockerfile (#12032)
We don't use the dockerfile there any more, rather the Dockerfile.cloud
in this repo.
2022-09-29 13:03:04 +00:00
Guido Iaquinti
5855323203
chore(docker): update Node base image to 18.8-alpine3.16 (#11726) 2022-09-08 14:47:44 +02:00
Guido Iaquinti
7175510460
chore(python): update Python to version 3.8.14 (#11713) 2022-09-08 10:56:30 +00: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
Neil Kakkar
07f9cc2118
feat(feature-flags): Allow GeoIP property overrides for persons in decide (#10914)
* feat: add libmaxminddb0 as dependency. C library will speed things up significantly

* pin libmaxminddb to 1.5 for whats available from APK

* get geolite2 db during build

* add settings for geoip2 django contrib library

* black formatting

* consistently use share director

* isort fixes

* remove GeoLite2-City.mmdb from git and add script to ./bin/start to download it if file does not exist

* remove GeoLite2-City.mmdb from git

* add doc for share directory expaining why it exists

* relative path for curl in build

* shared vs share consistency

* feat(feature-flags): Allow GeoIP property overrides for persons in decide

* add geoip class

* Update snapshots

* add geoip to ci

* wrong place

* check where I am

* decompress database

* Update snapshots

* brotli decompress

* ..everywhere

* remove annoying ff snapshot

* make exception surface larger

* add permissions to view folder & read file for everyone

* make exception surface larger

Co-authored-by: James Greenhill <fuziontech@gmail.com>
Co-authored-by: neilkakkar <neilkakkar@users.noreply.github.com>
2022-07-26 14:52:36 -07:00
James Greenhill
8e5d1da3aa
feat: Add GeoIP2 capability to Django app (for feature flags) (#10890)
* feat: add libmaxminddb0 as dependency. C library will speed things up significantly

* pin libmaxminddb to 1.5 for whats available from APK

* get geolite2 db during build

* add settings for geoip2 django contrib library

* black formatting

* consistently use share director

* isort fixes

* remove GeoLite2-City.mmdb from git and add script to ./bin/start to download it if file does not exist

* remove GeoLite2-City.mmdb from git

* add doc for share directory expaining why it exists

* relative path for curl in build

* shared vs share consistency

* Update snapshots

* brotli decompress

* ..everywhere

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: neilkakkar <neilkakkar@users.noreply.github.com>
2022-07-25 17:20:11 -07:00
Paul D'Ambra
77ff6b3193
Revert "chore: updates the chromium version (#10712)" (#10715)
This reverts commit 7f0756eedd.
2022-07-11 15:02:26 +01:00
Paul D'Ambra
7f0756eedd
chore: updates the chromium version (#10712)
* chore: updates the chromium version

* spedicy exact version for alpine 3.14
2022-07-11 14:44:28 +02:00
Harry Waye
5f1ab5ff74
chore(dockerfile): make docker build multistage (#10488)
* chore(dockerfile): make docker build multistage

The built image is >4GB uncompressed atm, I'm pretty sure there is a lot
of cruft.

Plan is to split out the django, frontend, plugin-server builds and
hopefully get some gains in there to not include build deps.

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix dockerfile lints

* cache from branch

* add load :true

* Update production.Dockerfile

Co-authored-by: James Greenhill <fuziontech@gmail.com>

* Update production.Dockerfile

* update to use compressed size from remote repo

* tag with branch and sha

* add ref on pull_request events

* install python

* be a bit more lax with python version

* fix image size calc

* hardcode lower case image name

* use @

* only add sha on master branch, add master tag on master

* chore: use docker image in e2e tests

This is to try to add some guarantees to the docker image without having
to manually test it, so we can be a bit more aggressive with
improvements without, e.g. having to push to the playground or run
locally.

* wip

* add to summary

* wip

* chore: put cypress tests after docker build

I couldn't figure out a way to get workflow_run to run without merging
in, so I'm just putting after the build.

* wip

* wip

* wip

* remove quotes

* remove separate cypress install

* wip

* wip

* wip

* add gunicorn.config.py

* ci: run docker image build on master as well

This way we get the caching from the master build.

* wip

* wip

Co-authored-by: James Greenhill <fuziontech@gmail.com>
2022-06-27 18:12:32 +01:00
Rick Marron
75fdfa58f7
chore: move frontend install, build, and clean into single docker line (#10461)
* chore: remove plugin server node modules

* another try

* another go at it
2022-06-23 16:21:52 -07:00
Ben White
57874f9db2
feat(exports): Dashboard / Insight exporting (#9830)
* Adds chromium / selenium for image exporting
* Added uploading of downloads folder to artefacts
* Adds ExportButton to generate desired asset
2022-05-27 14:31:17 +02:00
Yakko Majuri
3ab69d23e3
chore(deps): upgrade node.js version to v16 (#8983)
* chore(deps): upgrade node.js version to v16

* update npm version'

* try to update alpine

* Revert "try to update alpine"

This reverts commit 58024968e2.

* don't update alpine, use node-current instead:

* go back to npm 7

* upgrade @google-cloud packages

* handle unhandled rejections :D

* add handling for unhandled promise rejections in the main thread as well
2022-03-15 09:48:56 +00:00
Paolo D'Amico
655c1ce9a4
refactor(enteprise): Removes conditional SAML dependencies (#8952) 2022-03-10 07:14:30 -06:00
Guido Iaquinti
8c355b5a37
Python: use version 3.8.12 (#8677) 2022-02-24 17:49:55 +01:00
Neil Kakkar
359843c198
Revert "Install scipy (#7897)" (#7902)
This reverts commit 6017a39d7e.
2022-01-05 15:52:31 +00:00
Neil Kakkar
6017a39d7e
Install scipy (#7897)
* install scipy
* pin
* sort out versions
2022-01-05 13:06:37 +00:00