Commit Graph

197 Commits

Author SHA1 Message Date
Julian Bez
a0fc086175 chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
Neil Kakkar
9f43a3f4cd feat(ci): split out temporal, make tests faster (#21636) 2024-04-18 16:25:33 +01:00
Paul D'Ambra
f33f3db069 chore: switch back to GH runners (#21600) 2024-04-17 11:51:56 +01:00
Paul D'Ambra
15627818f6 revert: "chore(clickhouse): Capture final SQL in Sentry errors" (#21479)
Revert "chore(clickhouse): Capture final SQL in Sentry errors (#21436)"

This reverts commit 5edead90c0.
2024-04-10 22:13:50 +01:00
Michael Matloka
5edead90c0 chore(clickhouse): Capture final SQL in Sentry errors (#21436)
* chore(clickhouse): Capture final SQL in Sentry errors

* Upgrade Sentry and use the `clickhouse-driver` integration

* Turn `before_send_transaction` into `error_sampler`

* Update `escape_param_for_clickhouse`

* Fix Sentry init

* Revert "Turn `before_send_transaction` into `error_sampler`"

This reverts commit 8810b49416bf2cd8433a3ccd67a7684ea40d0f31.

* Fix order of pip installations in migration checks
2024-04-10 21:04:39 +02:00
James Greenhill
5c323f1b4e feat: Bump version of CH to 23.12.5.81 (#21318)
* feat: Bump version of CH to 23.12.5.81

* test both right now

* Test 24.3.2.23

* back to 23.12.5.81
2024-04-08 18:05:41 -07:00
Paul D'Ambra
2190c51888 revert: "chore(CI): revert "chore: syphar is deprecated. fangle python actions"" (#21389)
* Revert "chore(CI): revert "chore: syphar is deprecated. fangle python actions…"

This reverts commit 1f2ff4ac32.

* not on depot?

* was missing a syphar removal :/

* was missing a syphar removal :/

* Update query snapshots

* back to depot

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-08 09:54:08 +00:00
Xavier Vello
1f2ff4ac32 chore(CI): revert "chore: syphar is deprecated. fangle python actions" (#21267)
Revert "chore: syphar is deprecated. fangle python actions (#21249)"

This reverts commit ea522d89d4.
2024-04-02 10:25:49 +00:00
Paul D'Ambra
ea522d89d4 chore: syphar is deprecated. fangle python actions (#21249) 2024-04-01 13:02:12 +01:00
James Greenhill
5e3c3b96e8 chore: test new migrations to see if an existing migration already exists with that index for CH (#21236)
* chore: catch bad indexes for CH migrations

* loggin instead of print

* update exit states

* include changes to ci

* add more details to logger

* git it

* checkpoint

* nicer logs

* don't use branch on ci

* handle git states more gracefully

* looking pretty good

* remove test migration
2024-03-29 08:08:38 -07:00
Paul D'Ambra
597144ddf3 chore(ci): switch some workflows entirely to depot (#21187)
* chore(ci): switch some workflows entirely to depot

* yolo
2024-03-28 09:16:14 +00:00
Paul D'Ambra
1778471986 chore(ci): report workflow running time to PostHog (#21002) 2024-03-19 15:55:13 +00:00
James Greenhill
03e9500778 chore: remove 23.6 from CI matrix, no longer needed 🎉 (#19852) 2024-01-23 12:36:09 -08:00
Julian Bez
fb0562da2f feat(types): Add mypy GitHub problem matcher (#19706) 2024-01-17 11:09:02 +00:00
Paul D'Ambra
f236e2513a fix: cannot read body twice (#19750)
* fix: cannot read body twice

* only read it once no matter what

* fix tests but yucky

* nicer

* does this mean backend checks won't incorrectly run

* comment
2024-01-15 07:44:43 +00:00
Julian Bez
7cabe21ae3 chore: Upgrade pydantic, mypy, and others (#19660)
* Upgrade pydantic and all related
* Upgrade mypy
* Add mypy-baseline

To update baseline when you fix something (only then!) use:

    [mypy cmd] | mypy-baseline sync
2024-01-10 08:32:55 +00:00
James Greenhill
32d7162459 feat: Bump dev clickhouse version to 23.11 (#19434)
* feat: Bump dev clickhouse version to 23.11

* add 23.11.2.11-alpine to ci matrix as well

* async migrations count of queries 4->5

* Update query snapshots

* Update query snapshots

* debug

* matrix async migrations

* update tests

* improve test assert to actually be able to debug it when failes

* update async migration tests

* sequential tests of operations

* new partition determination is different maybe?

* tweak

* omit inconsistent partition

* remove index 2 test (inconsitent and not important)

* Update query snapshots

* Update query snapshots

* remove comment

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-03 17:51:27 -08:00
Paul D'Ambra
9af89cd98f fix: remove deprecated pip cache action (#19552)
* fix: remove deprecated pip cache action

* with wildcard

* fix
2024-01-02 15:02:29 +00:00
Ben White
4ad3928c74 feat: Added ability to import code from ee folder (#18841)
We want to experiment with some conditional licensing of frontend code via the ee folder.

---------

Co-authored-by: Paul D'Ambra <paul@posthog.com>
2023-11-23 16:40:46 +00:00
Tomás Farías Santana
a8f6d92318 refactor: Structlog batch exports logging (#18458)
* fix: Checkout master before checking for hogql changes

* fix: But go back to branch after done

* fix: Instead just diff with origin/master

* fix: Install libantlr, what's the worst that can happen?

* fix: Install antlr the hogql-way

* fix: Let's just checkout everything

* feat(batch-exports): Add backfill model and service support

* test(batch-exports-backfills): Add Workflow test

* chore(batch-exports-backfill): Bump migration

* feat(batch-exports): Add RedshiftBatchExportWorkflow

* feat(batch-exports): Add Redshift to BatchExport destinations

* feat(batch-exports): Support properties_data_type Redshift plugin parameter

* refactor(batch-exports): Insert rows instead of using COPY

* fix: Remove unused migration

* chore: Require aiokafka

* feat: Implement new structlog batch exports logger

* refactor: Use new structlog logger everywhere

* test: Add tests, fix things

* fix: Remove old tests

* chore: Change typing of return logger

* chore: Bump structlog

* chore: Extend docstrings

* fix: Don't use async logging as it's unsupported by temporal runtime

* test: Add logger tests

* fix: Mix pytestmark lists

* fix: Remove unused imports

* fix: Cleanup  pytest warnings

* fix: Create and drop dataset for bigquery tests

* fix: Typing issue?

* fix: Let's just checkout everything

* fix: Use global event loop in tests

* fix: Blow-up cache

* fix: Truncate only if table exists

* revert-me: Skip all postgres tests

* fix: Connect to kafka in localhost

* fix: Lazily connect to Kafka

* fix: Resolve conflicts

* fix: Capture temporal context once and bind it to the logger

* fix: Make configure logger sync

* fix: Keep strong reference to background tasks

* fix: Continue consuming from log queue even if we fail to produce

* fix: Also catch the producer not starting

* fix: Remove unused await

* fix: Log kafka producer error after logger is configured
2023-11-13 16:07:35 +01:00
Marius Andra
06e993818d feat(apps): transpile via django (#18201) 2023-11-07 21:56:59 +00:00
Michael Matloka
243cf56766 feat(3000): Show the 3000 index-less navbar with labels (#18263)
* feat(3000): Show the 3000 index-less navbar with labels

* Use new icons and move "Event explorer"

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* feat: Allow new nav to be collapsed (#18343)

* Add alpha/beta tags, move "Toolbar", rename "Persons"

* Fix tooltips not showing when navbar collapsed

* Align "Session replay" in using sentence case

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ben White <ben@posthog.com>
2023-11-02 22:38:00 +01:00
Ellie Huxtable
0257b2bcb9 chore: Use ruff formatter (#18207)
* Use ruff formatter

Ruff is now also a formatter! And it runs in a fraction of a second
across our whole codebase vs "I waited more than 30s and cancelled it
because I got bored".

* Config and command -> ruff

* Run 'ruff format .'

* Update query snapshots

* Run 'ruff format .'

* Fix format after commit hook

* Update query snapshots

* Fix type error - ignore comment moved

* Exclude hogql grammar from formatting and reverted grammar

* Run format

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tom Owers <tom@paace.co>
2023-10-31 13:41:57 +00:00
Tomás Farías Santana
27b0ee3dfe feat: Add jitter to s3-export schedule (#18141)
Co-authored-by: Frank Hamand <frankhamand@gmail.com>
2023-10-23 18:04:21 +02:00
Tom Owers
8577e13599 feat: allow placeholders in place of ratio expressions in hogql (#17973)
* Allow placeholders in place of ratio expressions in hogql

* Added C++ changes for RatioExpr

* Bump `hogql_parser` version

* Upgrade ANTLR version to align with brew latest

* Update query snapshots

* Fix parser change message body

The quotes weren't right, so the step failed instead of posting a comment.

* Revert "Update query snapshots"

This reverts commit 1302d3b24f138e36590cf5ff45769323379a4f95.

* Update MD5 sum

* Bump version again

* Use new hogql-parser version

---------

Co-authored-by: Michael Matloka <michal@matloka.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2023-10-19 15:37:32 +00:00
Paul D'Ambra
e94ea2a015 fix: console log fiddling (#17996)
* fix: use kea for debouncing

* explicitly capture exception
2023-10-16 14:33:51 +00:00
Michael Matloka
16a71f60c9 perf: Parse HogQL with C++ for a huge speedup (#17659)
* Add partial C++ parser of HogQL

* Support all the rules and add proper error handling

* Use `AlignAfterOpenBracket: BlockIndent`

* Reuse all the parser tests for the C++ backend

* Fix relationship between headers and implementations

* Add more error handling and fix minor issues

* Build both Python and C++ parsers in the package.json script

* Update ARRAY JOIN error assertion

* Improve timeit

* Move the C extension to the top level

* Refactor `vector_to_list_string`

* Build the parser on Linux

* Build wheels for the parser

* Simplify Linux build and fix macOS

* Fix Homebrew paths on x86 and don't fail fast in CI

* Set MACOSX_DEPLOYMENT_TARGET for C++20

* Set up QEMU for Linux ARM builds

* Publish the wheels on PyPI

* Avoiding Linux ARM emulation in CI for now

* Build sdist too

* Revert Dockerfile changes

* Fix PyPI publish

* Add README and optimize sdist build

* Use setup.py directly instead of build

* Use PyPI hogql-parser instead of local

* Also revert production-unit.Dockerfile

* Fix sdist upload and add Linux ARM back

* No Linux ARM build in the end

* Fix artifact uploading

* Do try building Linux ARM

We need this for prod.

* Use `npm` in `grammar:build`

`pnpm` is not available in that job.

* Fix formatting of hogql_parser

* Build everything on macOS

* Revert "Build everything on macOS"

Not so fast actually.

* Use hogql-parser=0.1.1

* Fix dylib in macOS wheel

* Bump hogql-parser version

* Fix missing module error

* Delete timeit.py

* Make error handling robust

* Format the C++

* Use `hogql-parser==0.1.1`

* Fix reserved keyword error assertions

* Use HEAD hogql_paresr in CI

* Fix `apt` usage

* Add some sudo in CI

* Ensure package will be releasable before build

* Bump version to 0.1.3

* Cover C++ `unquote_string` with tests

* Use BuildJet ARM runners for ARM builds

* Add some instructions

* Add HogQL version check to backend CI

* Update requirements.txt

* Use `setuptools` instead of the deprecated `distutils`

* Fix working dir in backend CI

* Align ANTLR versions

* Add test for "mismatched input"

This is thrown differently than other HogQLSyntaxExceptions in C++, so might help reveal what's going on with tests failing only on Linux CI and not macOS dev

* Add types and bump version

* Comment instead of failing version check

* Automate hogql-release version bump

* Fix checkout token

* Don't build hogql-parser if there were no changes

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Improve documentation

* Use new hogql-parser version

* Fix error start and end initialization

* Note `antlr4-cpp-runtime`

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

* Also remove NUL chars in C++

* Check ANTLR4 runtime archive checksum for security

* Note more decrefs to add

* Add vector size checks

* Use new hogql-parser version

* Don't support the `start` arg in C++ `parse_expr`

* Use new hogql-parser version

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
2023-10-13 13:58:08 +00:00
Paul D'Ambra
3c57a44411 chore: longer timeout (#17666) 2023-09-28 10:59:24 +00:00
Tomás Farías Santana
17c5ec1710 feat: S3 BatchExports missing features (#17233) 2023-09-01 16:19:02 +02:00
Michael Matloka
6b40fee757 chore: Even less BuildJet (#17249) 2023-08-30 18:45:18 +02:00
Paul D'Ambra
fdd3059c5b chore: remove buildjet (#17247)
* chore: remove buildjet

* fix

* fix

* fix
2023-08-30 14:53:52 +02:00
Michael Matloka
c098d4b0ba ci(vrt): Better await in a few more stories (#17244)
* ci(vrt): Better await in a few more stories

* Optimize CI concurrency

* Explain mechanics
2023-08-30 11:49:15 +02:00
Paul D'Ambra
1fd03b04b1 chore(speed): don't run all tests in PoE and EE runs (#17223)
chore (speed): don't run all tests in PoE and EE runs
2023-08-29 08:45:42 +01:00
Ellie Huxtable
377018539d feat: Use buildjet for ci-backend (#17069)
* ci-backend runs-on -> buildkite

* Use buildjet runners

* Go away old cache

* Fix deps

* Ensure to update the package registry

* Use bigger runners for django tests

* Use ARM for jobs with less concurrency

* Revert "Use ARM for jobs with less concurrency"

This reverts commit bcbf0d752412d4231b7b86c3413022b1d12facb4.

* Fix typo
2023-08-17 15:16:43 +01:00
Michael Matloka
74435d4999 fix: Clean JSON responses from NaN system-wide, with markers (#16911)
* fix: Clean JSON responses from NaN system-wide, with markers

* Fix typing

* Remove exclamations
2023-08-08 13:56:50 +02:00
James Greenhill
522a08ac77 chore: bump clickhouse for local dev and ci to 23.6 (#16361)
* chore: bump clickhouse for local dev and ci to 23.6

* test to see if race condition

* it is a race
2023-07-03 19:04:57 -07:00
Marius Andra
42bbc5a94d feat(hogql): bunch of improvements (HogVM part 1) (#16274) 2023-06-28 10:55:58 +02:00
Harry Waye
b9d45de99a ci(temporal): add logging to backend tests for docker compose (#16072)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-15 12:52:33 +02:00
Ben White
4783dec288 chore: Step 1 to remove posthog-cloud repo (#15898) 2023-06-15 10:33:19 +02:00
Harry Waye
b761a34b23 ci: fix waiting for temporal to be up in backend tests (#16039)
* ci: fix waiting for temporal to be up in backend tests

I think it got merged before because we weren't running the backend
tests on these script changes so I've also added them to the list of
paths to watch for changes.

* increase timeout to 180 seconds
2023-06-14 06:07:49 +00:00
Michael Matloka
2f83622dd2 ci: Always cancel previous runs, except for snapshot updates (#15981) 2023-06-13 12:36:02 +02:00
Neil Kakkar
9fb1aa7295 feat(usage-report): Add decide usage report (#15956) 2023-06-09 11:04:04 +01:00
James Greenhill
81d8c2134e chore: revert back to default runners for GitHub Actions (#15950) 2023-06-07 16:14:58 -07:00
James Greenhill
a2b88e66f1 chore: Remove ClickHouse 22.8 and settle on 23.4.2.11 (#15929)
* chore: Remove ClickHouse 22.8 and settle on 23.4.2.11

* snuck a ci change in there - removed

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* adjust service version requirements for clickhouse

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-06 16:40:24 -07:00
James Greenhill
cb7b1082be chore: split tests onto their own dedicated GitHub runners (#15919) 2023-06-06 10:01:49 -07:00
Harry Waye
ac1d3e7b52 feat(batch_exports): add backend API and S3 temporal workflow (#15649)
* feat(batch_exports): add backend API and S3 temporal workflow

This adds the backend API for batch exports, which will handle reverse
ETL exports to e.g. S3, Snowflake etc.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-01 17:05:37 +01:00
Marius Andra
e23d4f562e feat(hogql): window functions (#15132) 2023-05-31 12:53:31 +02:00
Michael Matloka
47669ac94a ci: Commit query snapshot updates all at once (#15757) 2023-05-30 15:01:29 +02:00
James Greenhill
9e5b92e7d8 feat: bump clickhouse version to 23.4 for really exciting features (#15574)
* feature: bump clickhouse version to 23.4 for really exciting features

* remove default for kafka table

* Update query snapshots

* don't use defaults on kafka tables

* Update query snapshots

* clickhouse formatDateTime string has changed

* run both 22.8 and 23.4 for now

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-17 11:00:08 -07:00
Paul D'Ambra
5efd14441e chore: upgrade drf (#15433) 2023-05-10 09:37:53 +01:00