22 Commits

Author SHA1 Message Date
Rafael Audibert
90175d0658 feat(devex): Introduce prettier-plugin-sort-imports to sort our imports (#35965) 2025-08-17 13:49:49 -03:00
Paul D'Ambra
2d55283812 fix: blob v2 dev flow (#36079)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-08-07 12:33:56 +01:00
Ben White
b9d7cdb28c fix(node): Flakey test and update jest (#36107) 2025-08-05 14:07:24 +02:00
Robbie
d661126723 feat(web-analytics): Add rust implementation of cookieless hash for use in rust flags endpoint (#29788) 2025-03-13 16:23:05 +00:00
Rafael Audibert
eda494ef12 fix: Silence several TS errors from plugin-server tests (#29200) 2025-02-25 18:46:02 +00:00
Robbie
9a18b87896 feat: Add cookieless server hash mode to pipeline and capture (#27290) 2025-01-27 14:33:30 +00:00
Robbie
8035e01766 feat(web-analytics): Add timestamp utils and uuidv7 code to plugin-server (#27070) 2024-12-20 13:22:34 +00:00
Michael Matloka
1aee725409 feat(webhooks): Support person display name preferences and nested properties (#15882)
* Use same logic for `[person]` webhook token as person display in the app

* Allow accessing nested properties in webhook message

* Update hooks.test.ts

* Fix team fetching test

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-05 16:25:39 +00:00
Michael Matloka
a26cbeaeff refactor(plugin-server): Don't print debug logs in dev by default (#13821) 2023-01-20 14:08:26 +01:00
Karl-Aksel Puulmann
8b0056192d chore(plugin-server): Update prettier and eslint to latest (#11288)
* chore(plugin-server): bump prettier and eslint

* Solve new warnings/errors
2022-08-16 09:44:52 +03:00
Michael Matloka
7bd3cac2f5 refactor(plugin-server): Unify event types (#10612)
* Simplify Event, ClickHouseEvent, PreIngestionEvent, IngestionEvent

* Unify `ClickhouseEventKafka` with `RawEvent`

* Fix imports

* Eliminate PostgresSessionRecordingEvent

* Parse `Event.elements_chain` too

* Update process-event.test.ts

* Update tests

* Make `IngestionEvent['timestamp']` consistent

* Update tests

* Restore `PreIngestionEvent` vs. `PostIngestionEvent` split

* Update worker.test.ts

* Improve typing a bit

* Update tests to work with mandatory `DateTime`

* Remove ClonableIngestionEvent

* Rename RawEvent -> RawClickHouseEvent

* Rename Event -> ClickHouseEvent

* Update prepareEventStep tests

* Update convertToIngestionEvent behavior back to master

* Update tests to compile

* Use branded types for ISO/Clickhouse timestamp string disambiguation

* Test for parseRawClickHouseEvent()

* Update each-batch tests

* Tests for clickHouseTimestampToDateTime()

Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
2022-08-15 10:54:09 +03:00
Michael Matloka
3578a0c1c2 perf(apps): Only load PluginSourceFiles instead of Plugin.archive (#10374)
* perf(apps): Cache app code at install instead of fetching `archive` blob

* Fix typing

* Add migration

* Use `cast()` instead of `assert`

* Update plugin test helpers

* Restore `reload_plugins_on_workers()`

* Save plugin source file rows separately from plugin rows

* Fix migration

* Update latest_migrations.manifest

* Update plugins.test.ts

* Separate `plugin60WithSource` from `plugin60`

* Handle `PluginSourceFile` at `insertRow()` level

* Unify `plugin60WithSource` and `plugin60` again

* Update sql.test.ts

* Fix and simplify reading files in `loadPlugin()`

* Update plugins.test.ts

* Update more tests

* Clean code up

* Specify `json_parse=True` in lower-level function tests

* Add tests for `update_or_create_from_plugin_archive()`

* Update migration with updated function

* Update plugin `upgrade` endpoint

* Remove leftover `print()`

* Add error handling to `0243_unpack_plugin_source_files`

* Add `upgrade` assertions

* Revert plugin server changes

* Fix typing

* perf(apps): Only load `PluginSourceFile`s instead of `Plugin.archive`

This reverts commit 180ed228b8cc59875ac426783a2f46e57eb1e69c.

* Update logging level and message

* Refactor `find_index_ts_in_archive()` and `extract_plugin_code()` out

* Don't select `latest_tag` and `latest_tag_checked_at`

* Use kwargs in logging

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

* Fix missing comma

* Only throw if `plugin_json_parsed` is `None`

* Fix `reverse_func`

* Accept empty files

* Make sure files which are deleted between version are gone

* Update 0243_unpack_plugin_source_files.py

* Update 0243_unpack_plugin_source_files.py

* Explain query counts

* Use `@snapshot_postgres_queries` instead of `assertNumQueries()`

Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>
2022-06-22 16:33:23 +02:00
Michael Matloka
313226838c revert: revert: Revert person properties updates refactor (#10349)
* Revert "revert: Revert person properties updates refactor (#10348)"

This reverts commit 6b3c4691b3.

* sanitizeEvent -> normalizeEvent

* Ensure we handle property updates from within plugins, test

Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
2022-06-20 09:49:11 +03:00
Neil Kakkar
6b3c4691b3 revert: Revert person properties updates refactor (#10348) 2022-06-17 17:48:20 +02:00
Karl-Aksel Puulmann
d6ec3aedc6 refactor(plugin-server): person state updating (#10321)
* Remove some excessive call signatures

* refactor: move property sanitization outside of .capture

* Move event sanitization into event sanitization logic

* Move person creation/updating logic outside of capture/createSnapshot

* refactor: remove personManager from arguments

* refactor: remove various properties from arguments

* Update `handleIdentifyOrAlias` signature

* refactor: inline timeoutGuard into personStateManager

* refactor: prefix pipeline steps with indexes

* Extract timestamp parsing logic from process-event.ts

* refactor: move timestamp tests over from process-event.ts

* refactor: update process-event.test.ts

* refactor: person-state-manager -> person-state

* Move sanitizeEvent to a more suitable module

* Fix some process-event tests
2022-06-17 09:17:08 +03:00
Michael Matloka
143e8e31c3 style: Reduce ESLint false positives (#9964)
* style: Make JS linting more accurate

* Don't lint autogenerated code
2022-05-25 14:38:44 +00:00
Yakko Majuri
1ad16d8d91 fix(ingestion): escape surrogate characters when producing to kafka (#9368)
* wip

* finish plugin server tests

* python

* fix code quality

* handle issue with types

* add comments to keep in sync

* Update posthog/api/capture.py

Co-authored-by: Tiina Turban <tiina303@gmail.com>

* Update posthog/api/capture.py

* fix typo

Co-authored-by: Tiina Turban <tiina303@gmail.com>
2022-04-11 14:59:38 +00:00
Yakko Majuri
77a3790abf chore(plugin-server-tests): refactor tests to use a top-level describe (#8955) 2022-03-10 11:18:24 +00:00
Yakko Majuri
ab8db472c5 handle dates better in plugin server (#6749)
* handle dates better in plugin server

* move to utils

* Delete reload.txt
2021-11-04 10:38:20 +00:00
James Greenhill
434e379f9a Add 'plugin-server/' from commit '01a99a4e26b0b11f068a7073d6b94e53a7214d33'
git-subtree-dir: plugin-server
git-subtree-mainline: 776b056b6d
git-subtree-split: 01a99a4e26
2021-10-28 14:59:19 -07:00
James Greenhill
145937a435 Revert "Monorepo with updated history" 2021-10-28 14:55:17 -07:00
James Greenhill
65512ae16f Pack up plugin-server for moving 2021-10-12 15:45:42 -07:00