0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-30 19:41:46 +01:00
Commit Graph

404 Commits

Author SHA1 Message Date
Frank Hamand
cc94b2d35b
feat: Automatically create deploys for labelled PRs seeded with demo data (#14935)
* Automatically create deploys for labelled PRs seeded with demo data

* Remove debug

* if
2023-03-30 14:27:58 +00:00
James Greenhill
03eaed4390
chore: remove isort - ruff is doing the job now (#14849) 2023-03-21 11:53:45 -06:00
Tiina Turban
e87d6e652b
chore: Migrations to trigger snapshot updates (#14481) 2023-03-21 17:59:40 +01:00
James Greenhill
9a2a087a9c
feat: Migrate flake8 -> ruff (#14838)
* feat: Migrate flake8 -> ruff

* move the exclude to configs instead of CI
2023-03-20 23:00:54 -06:00
Paul D'Ambra
c832162fa5
chore(ci): skip service version requirements when running CI E2E tests (#14822) 2023-03-20 10:57:22 +00:00
Paul D'Ambra
bc7899e18c
chore(ci): no need to wait for image when on master (#14820) 2023-03-20 10:26:25 +00:00
Paul D'Ambra
6034591945
chore(ci): chose correct commit wsha on master (#14813) 2023-03-20 09:17:44 +00:00
Paul D'Ambra
0e1668bbe9
chore(ci): upgrade all storybook to latest v6 (#14731)
* chore(ci): upgrade all storybook to latest v6

* computers 🙈

* run storybook if package.json changes too:

* pin storybook addon pseudo states to a specific version

* pin storybook back to 6.5.14

* build works locally

* and if we add the source loader?

* remove debug, loosen package versions

* lock pseduo states package version again
2023-03-14 11:37:56 +00:00
Harry Waye
2e4c4d4bb3
chore: print session messages as we go, save memory (#14671)
* chore: print session messages as we go, save memory

Wanted to make sure we're not getting close to any memory limits when
generating, stream to Kafka asap

* wip

* wip
2023-03-10 10:52:48 +00:00
Frank Hamand
391e6e2574
chore: Get deployer bot token instead of using hazzadous (#14656)
Get deployer bot token instead of using hazzadous
2023-03-09 14:12:26 +00:00
Harry Waye
a26a87cf40
chore: add profiler to session recordings load test (#14649)
chore: add profiler to session recordings load test
2023-03-09 14:07:54 +00:00
Harry Waye
9609d0bf59
chore(recordings): fix no team found on load test (#14626)
* chore(recordings): fix no team found on load test

For some reason it's not picking up the team from the token. I assume
there's some env var difference because it seems to work fine locally.

* wip

* wip

* fix ci

* increase session count

* no need for test data

* reduce session count
2023-03-08 14:22:04 +00:00
Harry Waye
a29e137069
chore(recordings): add command to generate session recording events (#14496)
* chore(recordings): add command to generate session recording events

The intention of this is to be able to generate somewhat realistic
session recording events to test the ingestion pipeline performance,
such that we don't need to rely on pushing to production.

This command just outputs for stdout a single JSON encoded line per
event, which can then e.g. be piped into kafkacat or
kafka-console-producer, or put to a file to then be used by vegeta to
perform load testing on the capture endpoint.
2023-03-08 11:46:56 +00:00
Michael Matloka
24baba9e10
ci: Fix email render artifact uploads (#14563)
* ci: Fix email render artifact uploads

* Reduce artifact retention period from 30 to 5 days
2023-03-06 14:34:08 +00:00
Thomas Obermüller
028ce1c7b9
ci(e2e): wait for test server before running cypress (#14539)
* try waiting for posthog

* fix typo
2023-03-03 16:58:32 +00:00
Harry Waye
b4b1b80cc7
ci(e2e): run e2e tests on master (#14502)
We seem to have some failures on branches, but I can't see where the
issue was introduced as we're not running on master.
2023-03-03 13:48:05 +00:00
Michael Matloka
631ba8c946
test(frontend): Improve reliability of visual regression tests (#14422)
* test(frontend): Ensure 100% reliability of visual regression tests

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Use OptiPNG in CI

* Update UI snapshots for `chromium` (1)

* Don't rely on pre-commit hook for image compression

* Allow waiting for selector instead of constant delay

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Add extra insight rendering conditions

* Set strict timeouts for visual regression test jobs

* Optimize OptiPNG step

* Fix histogram selector

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Ensure non-blank canvas

* Fix blank canvas detection and auto-detect `waitForLoadersToDisappear`

* Use `Spinner` for loading state in `MonacoEditor`

* Make timeout limits less strict

* Update UI snapshots for `chromium` (2)

* Improve blank canvas detection further

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Tune selectors

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Try a different way of ensuring graphs are rendered

* Update UI snapshots for `webkit` (2)

* Increase `waitForLoadersToDisappear` initial UI wait

* Update UI snapshots for `webkit` (2)

* Make it easier to see what file wasn't pushed

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Fix `timeout-minutes`

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Add extra wait for canvases

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-02 21:11:03 +00:00
Thomas Obermüller
79fa0d6949
test(unit): fix running only files of given chunk (jest built-in) (#14484) 2023-03-02 10:15:37 +00:00
Michael Matloka
1c2d74fe8b
test(frontend): Automatically update UI snapshots in CI (#14391)
* Update UI snapshots with comment instead of failing on change

* Make a few stories more reliable

* Remove unused snapshots in CI

* Update query snapshots

* Update `webkit` UI snapshots

* Update `chromium` UI snapshots

* Update `firefox` UI snapshots

* Shard visual regression tests

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `webkit` (2)

* Fix remaining issues

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Improve reliability of insights snapshots

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Improve reliability of login/signup snapshots

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update .github/workflows/storybook-chromatic.yml

Co-authored-by: Thomas Obermüller <thomas.obermueller@gmail.com>

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Obermüller <thomas.obermueller@gmail.com>
2023-02-24 19:33:39 +00: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
Tomás Farías Santana
1703ee5c7c
fix(ci): Bump Ubuntu to fix GH runner in CI Plugin Server (#14312)
fix(ci): Bump Ubuntu in Plugin Server CI
2023-02-20 16:43:55 +01:00
Michael Matloka
0ae6902c4a
test(frontend): Optionally track snapshots for Firefox and Safari (#14175) 2023-02-10 12:50:43 +01:00
Paul D'Ambra
7187355236
feat: use annotation creation type (#14156)
* feat: use annotation creation type

* show Github on annotation card as well

* use version of the github action that sends creation_type

* ts fangling for tests

* Update frontend/src/scenes/annotations/Annotations.tsx

Co-authored-by: Michael Matloka <dev@twixes.com>

* don't add fake email

* show a nice profile pic for bots

* only one type at a time

* icon source

---------

Co-authored-by: Michael Matloka <dev@twixes.com>
2023-02-09 20:23:21 +00:00
Paul D'Ambra
f32838b21e
chore: correct API key for report PR as annotation workflow (#14151) 2023-02-08 19:06:13 +00:00
Paul D'Ambra
b68bfcf006
chore: add more info when reporting pr age (#14149) 2023-02-08 18:49:38 +00:00
Marius Andra
6af31d41bc
feat(hogql): antlr grammar (#13971) 2023-02-07 17:02:29 +01:00
Michael Matloka
b4b3453525
ci: Use POSTHOG_BOT_GITHUB_TOKEN for actions/setup-python (#14033) 2023-02-06 12:36:00 +01:00
Michael Matloka
2b90826d26
fix(data-exploration): Ensure query schema sync (#14081) 2023-02-03 16:50:17 +01:00
Marius Andra
1795652f9a
chore(data-exploration): add CI scripts to check if schema files are built (#13960)
* chore(data-exploration): add CI scripts to check if schema files are built

* remove timestamp

* Update snapshots

* Update snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-27 23:24:10 +01:00
Michael Matloka
adacf8ffb4
test(frontend): Automatically test Storybook stories with snapshots (#13839) 2023-01-27 15:51:35 +01:00
Michael Matloka
57f06ae479
ci(frontend): Delete storybook-chromatic-baselines-to-master.yml (#13936) 2023-01-26 15:03:58 +00:00
Tiina Turban
3cdad732fd
feat: PoE placeholder for ingestion and testing enabling (#13881) 2023-01-26 15:18:25 +01:00
Harry Waye
c970a2e071
ci(snapshots): also update snapshots from clickhouse schema changes (#13898)
* ci(snapshots): also update snapshots from clickhouse schema changes

`posthog/clickhouse/test/__snapshots__` wasn't included previously, this
fixes that.

* Update snapshots

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-24 15:04:24 +00:00
Harry Waye
c693c8484f
chore(person-merges): add person merges ClickHouse table (#13753)
* chore(person-merges): add person merges ClickHouse table

To enable speeding up queries we want to include a person merges table
which we can use to join on to be able to "correct" event person_ids
that may be needed due to person merges happening.

The specific difference from this implementation and the distinct_id
lookup is the cardinality of the table should be :fingerscrossed: much
lower, with the majority of events already having the correct person_id
associated with them.

The distinct_id joining is particularly problematic in that the join key
on the right hand side of a join needs to be loaded into memory as a
Hash map, for the purposes of ClickHouse performing a HashJoin.

 1. distinct_ids are arbitrary length strings
 2. every event needed to be joined via a distinct_id. With the
    person_id join we can use an left outer join making the right hand
    side much smaller if we simply omit person ids we think are the
    "canonical" id.

* add some todos

* empty __init__

* wip

* Add Kafka and Materialized views

* add some comments

* exclude created_at field

* duplicate materialized view schema from kafka table

* fix default now

* whitespace

* remove EMPTY AS

* Use EMPTY AS

* Update schema snapshots

* update name extract

* fix table name escaping

* update snapshots

* fix escaping

* create kafka tables late

* Add posthog clickhouse migrations to github actions change list

* Add tombstone flag

* add missing comma

* update snapshots

* partition by oldest_event

* make kafka table names consistent with others

* Update posthog/models/person_overrides/sql.py

Co-authored-by: Xavier Vello <xavier@posthog.com>

* Align naming with existing variables and add a test

* add missing override changes

* Update test

* Update snapshots

* delete kafka and mv tables at end of tests

* fix date formatting issue

* assert results is list

* Update snapshots

* Update snapshots

* Add comment re. using EMPTY AS SELECT

* Add comment about where version will come from

* Update posthog/clickhouse/test/test_person_overrides.py

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

* Update snapshots

Co-authored-by: Xavier Vello <xavier@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: James Greenhill <fuziontech@gmail.com>
2023-01-24 09:20:14 +00:00
Harry Waye
48eace5452
chore(clickhouse): update from 22.3 to 22.8 (#13819)
We're updated both in production and [in the Helm
chart](https://github.com/PostHog/charts-clickhouse/pull/663) so I guess
we also want to update here as well?

The thing that brought my here was wanting to use [`EMPTY
AS`](https://github.com/ClickHouse/ClickHouse/pull/38272)
2023-01-19 14:19:50 +00:00
Michael Matloka
ea84a58fb0
refactor(e2e-vrt): Optimize Playwright usage (#13714) 2023-01-16 10:00:05 +01:00
Thomas Obermüller
b36aa3dc46
fix(e2e-vrt): use playwright image (#13701)
* fix(e2e-vrt): use playwright image

* Update ci-e2e-vrt.yml
2023-01-13 11:18:18 +00:00
Thomas Obermüller
03fa4a1777
fix(e2e-vrt): update reference images and add commit sha to storybook build (#13676)
* fix insight layout changes

* fix properties timeline for no properties

* fix docs

* use sha in storybook repo commit message
2023-01-12 15:01:49 +01:00
Harry Waye
a27d452171
feat(person-on-events): add option to delay all events (#13505)
* feat(person-on-events): add option to delay all events

This change implements the option outlined in
https://github.com/PostHog/product-internal/pull/405

Here I do not try to do any large structural changes to the code, I'll
leave that for later although it does mean the code has a few loose
couplings between pipeline steps that probably should be strongly
coupled. I've tried to comment these to try to make it clear about the
couplings.

I've also added a workflow to run the functional tests against both
configurations, which we can remove once we're happy with the new
implementation.

Things of note:

 1. We can't enable this for all users yet, not without the live events
    view and not without verifying that the buffer size is sufficiently
    large. We can however enable this for the test team and verify that
    it functions as expected.
 2. I have not handled the case mentioned in the above PR regarding
    guarding against processing the delayed events before all events in
    the delay window have been processed.

wip

test(person-on-events): add currently failing test for person on events

This test doesn't work with the previous behaviour of the
person-on-events implementation, but should pass with the new delay all
events behaviour.

* add test for KafkaJSError behaviour

* add comment re delay

* add test for create_alias

* chore: increase exports timeout

It seems to fail in CI, but only for the delayed events enabled tests.
I'm not sure why, but I'm guessing it's because the events are further
delayed by the new implementation.

* chore: fix test

* add test for ordering of person properties

* use ubuntu-latest-8-cores runner

* add tests for plugin processEvent

* chore: ensure plugin processEvent isn't run multiple times

* expand on person properties ordering test

* wip

* wip

* add additional test

* change fullyProcessEvent to onlyUpdatePersonIdAssociations

* update test

* add test to ensure person properties do not propagate backwards in time

* simplicfy person property tests

* weaken guarantee in test

* chore: make sure we don't update properties on the first parse

We should only be updating person_id and asociated distinct_ids on first
parse.

* add tests for dropping events

* increase export timeout

* increase historical exports timeout

* increase default waitForExpect interval to 1 second
2023-01-05 16:38:43 +00:00
Alex Gyujin Kim
a284d3b0a3
feat(recordings): add static session recording model (#13231) 2023-01-04 16:49:36 +01:00
Guido Iaquinti
f81cc52ad6
chore(ci/cd): FOSS build multi-arch images (#13558) 2023-01-04 15:50:58 +01:00
Guido Iaquinti
f08f76db23
chore(ci/cd): switch deployment action (#13545) 2023-01-04 13:37:00 +01:00
Paul D'Ambra
75eec5ddfb
revert: "feat: run e2e tests on beefy runner" (#13551)
Revert "feat: run e2e tests on beefy runner (#13520)"

This reverts commit 127054ff11.
2023-01-03 22:05:08 +00:00
Guido Iaquinti
207e069bc8
chore(CD): rename and consolidate container build workflows (#13543) 2023-01-03 12:03:41 +01:00
Guido Iaquinti
04631eb407
chore(CD): fix typo in new GH workflow (#13542) 2023-01-03 10:21:03 +00:00
Guido Iaquinti
c2e37e1003
chore(CI/CD): split workflows to test, build and push container images (#13532) 2023-01-03 10:59:17 +01:00
Paul D'Ambra
127054ff11
feat: run e2e tests on beefy runner (#13520) 2022-12-30 13:32:42 +00:00
Thomas Obermüller
67b0ce7fdc
fix(ci): use bundled version of playwright (closes microsoft/playwright#19562) (#13462)
fix(ci): use bundled version of playwright
2022-12-22 12:39:16 +00:00
Thomas Obermüller
cdf4db4ba0
fix(ci): use cypress built-in cache (#13410) 2022-12-22 11:31:01 +01:00