Currently this would throw on a fresh install with an error similar to
```
│ posthog-events Migration would get applied: 0024_materialize_window_and_session_id │
│ posthog-events Traceback (most recent call last): │
│ posthog-events File "manage.py", line 21, in <module> │
│ posthog-events main() │
│ posthog-events File "manage.py", line 17, in main │
│ posthog-events execute_from_command_line(sys.argv) │
│ posthog-events File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", li │
│ posthog-events utility.execute() │
│ posthog-events File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", li │
│ posthog-events self.fetch_command(subcommand).run_from_argv(self.argv) │
│ posthog-events File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 3 │
│ posthog-events self.execute(*args, **cmd_options) │
│ posthog-events File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 3 │
│ posthog-events output = self.handle(*args, **options) │
│ posthog-events File "/home/posthog/code/ee/management/commands/migrate_clickhouse.py", line 41, in │
│ posthog-events self.migrate(CLICKHOUSE_HTTP_URL, options) │
│ posthog-events File "/home/posthog/code/ee/management/commands/migrate_clickhouse.py", line 57, in │
│ posthog-events sql = getattr(op, "_sql") │
│ posthog-events AttributeError: 'RunPython' object has no attribute '_sql'
```
This is due to the command not working with `RunPython` commands.
* Make clickhouse server image version configurable
* Attempt to use a reusable workflow for backend tests
* Try a composite action
* Add missing shell: bash
* Temporarily remove a step
* Cache id parameter
* Include the action when needing to rerun
* Move checking migrations to separate file
This didn't work in composite actions tests and slows down every
parallelized test execution for no reason. This should have been
separate in the first place.
* Rename job
* Improve check-migrations
* Start stack in the new job
* Remove shell
* Solve flaky test
* Remove unused file
* Create a test timings job
* Use checkout@v2 - https://github.com/cds-snc/github-actions/issues/23
* Ignore coverage files
* Save backend test durations
* Install pytest-split
* Clean up ci-backend
* Move actions code around
* wording improvement
* Save backend test durations
* Add a comment
* Make it possible to run tests with a different clickhouse version
* Remove debugging code
* Fix typo
* Boolean inputs please work
Fixes overeager test running as per https://github.com/actions/runner/issues/1483
Co-authored-by: PostHog Bot <hey@posthog.com>
* Remove dead querying methods
* Remove a dead filtering method
* Remove capability to filter events from property_to_Q
Note I've also duplicated test_filter tests to ensure we still have
sufficient coverage (via persons now) on property_to_Q but also have the
existing tests for EE
* Remove test-only SQL
* Remove events-related cruft
* Remove Event dependency on action api tests
* Remove a dead function
* Remove BaseQuery
* Remove dead imports
* Remove Event creation from posthog/test/test_person_model.py
* Remove Event.earliest_timestamp function
* Remove some unused event model methods
* Remove query_db_by_action + associated migration code
* Remove dead filtering methods from Events model
* Remove a dead test class
* Remove some event model usage
* Remove events model usage from actions test
* Remove session recording related views
* Remove model usage in posthog/queries/session_recordings/session_recording.py
* Remove old pg-session recording code
* Remove dead import
* Re-add missing dependency
* Make lint/tests pass
* Make filter tests uuid-based
* Use LemonSelect for Template
* Add mini pay gate for dashboard permissions
* Use "advanced permissioning" instead of "collaboration features"
* Rename "Collaboration restrictions" to "Collaboration settings"
* add the fix and let CI say if that breaks any tests
* allow getting team IDS without direct substitution and mark all the places to check with TODOs
* pass team id in from everywhere and see what tests fail in CI
* named params everywhere
* address mypyc
* get tests passing
* fix tests after merge from master
* remove SQL query that's not referenced from anywhere
* check some marked queries are templated correctly now
* remove unused SQL
* check some marked queries are templated correctly now
* no optional team id
* more passing of team id into things
* don't trust autocomplete
* address review
* Remove event admin
* Move posthog/tasks/test/test_org_usage_report.py clickhouse version inline
* Remove postgres-specific code from org usage report
* Kill dead on_perform method
* Remove dead EventSerializer
* Remove a dead import
* Remove a dead command
* Clean up test, dont create a model
* Remove dead code
* Clean up test_element
* Clean up test event code
* Remove a dead function
* Clean up dead imports
* Remove dead code
* Code style cleanup
* Fix foss test
* Simplify fn
* Org usage fixup #3
* fill postgres only if cohort is used in feature flag
* update relevant cohorts when feature flag is updated or created
* move calls
* call count test ff
* add ff test
* snapshots
* update types
* get person cohorts
* api all working
* fix tests
* typing and frontend
* capitalize constant
* perf(cohorts): reduce select batch size, and sleep 1 between
Previously we were hammering the database, see
https://github.com/PostHog/product-internal/issues/256 for details. Now
we:
1. reduce the batch by 5 times
2. have a little sleep(1) between batches
We also add a little bit of logging for instance in failure cases.
* include stack trace info in warning
* just reraise so we don't lose stack trace
* use monotonic for timings, not time
* update snapshots
* add test
* update func
* add include and settings
* diff method
* some prelim changes to make backend work
* add tests and logic for handling groups
* setup basic mixin parsing
* add tests
* types and switchover
* adjustment
* update snapshots
* update more snapshots
* update more snapshots
* update more snapshots
* typing
* snapshots
* clean up TODOs and types
* separate to_dict
* another property dict fix
* use operator dependening on condition
* fix tests
* update tests
* remove dummy condition
* update tests
* change name to groups
* another label
* rename filter_group to property_group
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
* feat(healthchecks): add clickhouse as a dependency
* feat(healthchecks): add celery broker healthcheck
* feat(healthchecks): add cache healthcheck, plus some misc updates
* add missing typing
* add missing typing
* add role cast
* Add logging for kafka connectivity check
* actually add healthcheck as middleware
* fix postgres failure check
* simplify postgres migration return value
* verboise -> verbose
Co-authored-by: Guido Iaquinti <4038041+guidoiaquinti@users.noreply.github.com>
* put interface validation at top of view
* remove unused imports
* show resp.content on status failures
* test(healthchecks): set log level to debug to pytest displays it
* restore logger level
* Bring up redis for backend ci tests
* up redis in non-cloud tests
Co-authored-by: Guido Iaquinti <4038041+guidoiaquinti@users.noreply.github.com>
* test(snapshots): update clickhouse snapshot comments
It looks like Clickhouse has been removed from clickhouse sql comments,
but the snapshots haven't been updated. Not sure how this got past CI.
* missed a couple
* version insights
* version and lock update
* make sure all tests work
* restore exception
* fix test
* fix test
* add specific id
* update plugin server test utils
* cleanup
* match filtering
* use timestamp comparison
* make tests work
* one more test field
* fix more tests
* more cleanup
* lock frontend when updating and restore refresh
* pass undefined
* add timestamp to background update
* use incrementer
* add field
* snapshot
* types
* more cleanup
* update tests
* remove crumbs
* use expressions
* make nullable
* batch delete
* fill null for static cohorts
* batch_delete
* typing
* remove queryset function
* fetch person properties via clickhouse
* cleaner queries
* fix some types
* parse up to 100k persons with this prop, add back counts
* ignore something that's bound to error anyway
* no point making it too flat now
* revert flattening of lists
* add statsd
* ignore type
* add back conversion
* mypy
* better mypy
* refactor
* add support for Experiment groups
* update styling
* incl groups in property selection
* set participant type and respect FF group type on backend
* remove aggregation select
* Revert "Revert "Adds reserved properties for filtering property definitions (#8291)" (#8340)"
This reverts commit cb6839fe21.
* limit reserved properties to events table, include this in unit tests
* add api level tests for datetime and reserved word filtering of trends
* remove unused constant
* make the cypress test even looser
* delete file that is no longer in master
* extract a query object
* implement reserved attribute querying for date filters
* update datetime cypress test
* separate and clarify tests and ensure date queries only use reserved attributes on event filters
* delete file that isn't in master