* override feature flags in the API
* improve types (thanks mypy!)
* remove unrelated code
* better comment
* fix test query count
* remove v2 in get_active_feature_flags_v2
* store `$feature/{key}` in properties
* Move feature flag overrides to their own model
* little bit of cleanup
* some type check + test cleanup
* respond to comments, add tests, add team permission checks
* add basic analytics
* add team to override model and simplify endpoints
* cleanup
* fix up instrumentation
* restrict a user to only their own overrides
* override query now works for all distinct ids
* typing fix
* fix tests
* sort flags by created date
* fix tests
* Clean up
* remove defualt from override_value field
* update migration
* fix migration dependancy
* run black on feature_flag.py
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* Trigram fuzzy search for property definitions
* support empty search param
* Only use pg_trgm search if pg extension is installed
* suppress exceptions if migration does not succeed
* checks for index
* troubleshooting
* wip: change migration number; strip out conditionals
* wip: copy code from #4110
* remove is_pg_trgm_installed
* try ngram search on CH
* add AND before ngram
* correct some check failures
* remove ordering
* remove ordering from tests
* fix ordering
* rewrite queries for psql, add test bypass for EE features
* remove ordering filter bc of bugs
* remove test code
* check if isinstance of RawQuerySet
* cleanup sql
* add ordering
* typing
* test for ee prop definition
* adjustments to test_ee_property_definition
* add test_ee_event_definition
* restore this prop
* convert to simple term filter
* use term search in EE
* fix EE tests
* fix non-EE tests
* fix test
* fix filter types
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* add description and tag fields to event and property definitions
* set up description and tagging on models
* frontend functionality for description editing
* connect backend and kea logic for description editing
* update event and property definitions model and migration
* delete set null instead of cascade
* migration merge fix
* add owner column
* undo posthog event property taxonomy migrations
* set up definitions on enterprise level
* allow enterprise definitions description editing
* fix licensing conditions and add tests
* proper get and update methods for the multi inheritance table and new column fields for enterprise event model
* check for license to separate routes
* migrate existing definitions to ee definitions tables and render ee vs non-ee definition views based on existing feature conditional
* all the working backend updates
* updated tests
* frontend fixes and linting updates
* feature flag it
* Save Organization.available_features as a DB column
* `update_available_features()` before an organization is created too
* Run the task half past the hour
* Adjust tests and fix available_features sync on start
* Remove redundant null=False
* Fix `Organization.update_available_features()`
* Run Cloud tests in respect to `posthog-cloud` `4426-fix` branch
* Revert "Run Cloud tests in respect to `posthog-cloud` `4426-fix` branch"
This reverts commit 421e8541b3.
* Extract function for capture
* Add capability to capture internal metrics
- This is behind an environment variable, we'll turn this on by default
on clickhouse-based installation.
- A special Org/Team gets created for this lazily, which is not accessible for
anyone. This makes avoiding issues with stats/billing/properties and easier.
* Capture some useful metrics into posthog
* Set up an unique constraint for for_internal_metrics organization
This avoids some nasty race conditions
* internal_metrics fixes
* Extract component OverviewTab
* New tabbing system for system status page
* Embed ClickhouseTab
* Generate a dashboard for internal metrics on demand
* More metrics
* Add more internal metrics, add tests
* Fix migration files
* Adjust copy
* Update task definitions
* Fix a typing issue
* Rename a component
* Migration fixup
* Try reset patch after test ends
* Clear lru_cache between tests
* Refactor plugin installation and reloading logic
* Preinstall and autoenable plugins (only GeoIP one for now)
* Fix PluginManager.install issues
* Add tests
* Disable plugin preinstallation on Cloud
* Check plugins access level before preinstallation
* Rename field `preinstalled` to `is_preinstalled`
* Adjust tests for Cloud v. self-hosted
* Fix test_preinstalled_are_autoenabled
* Ensure install plugins access level for preinstallation tests
* Bump migration
* Bump migration
* Add and use Plugin.get_default_config, with tests
* Refactor private PluginConfigSerializer methods out of the class
* Skip preinstallation of plugin if it couldn't be done (e.g. airgapped)
* Don't hit GitHub API in tests
* Satisfy mypy
* Fix a test on Cloud CI
* Revert "Revert "Increase Element model varchar limits (#3912)" (#3923)"
This reverts commit e30681bade.
* Use RunSQL to avoid ORM crap
* Fix attr_class being converted from varchar[] to varchar
* Bump migration
* Simplify migration and remove attr_class alter due to locking
* Bump migration
Error:
```
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0147_fix_stickiness_dashboard_items, 0147_plugin_logs in posthog).
To fix them run 'python manage.py makemigrations --merge'
```
* migration to add delayed jobs to sync team event properties
* remove .delay
* update latest migrations
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* remove event & properties endpoint from team endpoint
* event definition model
* sync events from Team with EventDefinition
* fix typing
* missing commit
* event definition API
* add querying capabilities
* property definition model
* sync property definitions
* temp: bring back event properties to Team model to split PR
* PropertyDefinition API + tests
* fix tests for Python 3.7 & more deprecation notices
* default values to 0 instead of null
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* initial refactor
* simple serializer for teams
* basic team in front-end
* use basicTeam where applicable
* refactor UserSerializer to UserBasicSerializer
* abstract UserBasicSerializer
* add uuid to users
* move event properties methods to Team model
* basic V2 user endpoint
* update current user
* update current team and org
* post-merge fix
* fix load logic
* change password
* add some extra tests
* undo all frontend changes from this PR
* remove last frontend change
* update preflight tests
* remove team basic fetch
* fix foss tests
* adjust migration & add distinct ID to payload
* add deprecation notice
* add uuid to UserBasic serializer & update memberships
* add available features to org serializer
* address feedback
* endpoint -> `users/@me/`
* address feedback
* Use UUIDClassicModel abstract model when adding uuid field
Co-authored-by: Michael Matloka <dev@twixes.com>
* add `important_data_attributes`
* fix undefined bug
* important data attributes in setup
* add dashes
* remove dead code
* scarier exampe
* support multiple data attributes in the toolbar
* update to simmer that supports wildcards
* rename "important_data_attributes" -> "data_attributes", store as a json array
* update ts blacklist
* another one
* use a tag select for data attributes
* remove needless string serialization
* implement text feedback
* data attribute setup style improvement
* better default handling
* fix out of sync migration
* Better handle extra info buttons during plugin reordering
* Fix UI bug in first time plugin enabling
* Give very new Cloud org config access to plugins
* Add migration
* Disable useless InsecureRequestWarning
* Disallow ASYNC_EVENT_ACTION_MAPPING on CH and make it default otherwise
* Return early from calculate_actions_from_last_calculation if CH
* Optimize Action.calculate_events and fire hooks from it
* Run calculate_event_action_mappings every 30 s instead of 5 min
* Optimize post_event_to_webhook thanks to new actions approach
* Add Event.site_url field for reworked Postgres webhooks
* Adjust tests by using sync calls to actions calculation
* Update calculate_action.py
* Use assertEntityResponseEqual more
* Update test_capture_new_person for Cloud
* Don't async calculate actions that haven't finished last calculation
* Fix is_calculating condition place
* Improve calculate_actions_from_last_calculation logging
* Clean up event_query, params
* Fix .only usage
* Update migration
* WIP auto filter test accounts
* finish off
* Fix tests
* Non generic emails
* add list of generic emails
* Move location to below property filters
* Fix typescript errors
* as any
* fix tests
* filters
* fix tests
* Featureflag doesn't really makes sense for this feature
* fix tests
* fix test
* Add clickhouse + tests for each insight
* Fix lifecycle and paths
* Fix sessions
* Fix session tests
* fix sesisons test
* fix migrations
* fix migration chain
* refactor path & remove stale console.log
* adjust useAnchor & minor copy
* rename to avoid confusion with inline component
* test account filter tweaks
* fix filters
* hardcode
* Add tests for funnel trends
* Make generic emails super fast
* Fix migrations
* Default to false for now
* Default to false, remember a user's preference
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* DashboardHeader to ts
* Convert files to typescript
* Use BindLogic instead of passing logics as arguments
* Improve typing for dashboards
* Fix DashboardHeader types
* Improve typing: DashboardItem
* Fix InsightHistoryPanel, SharedDashboard types
* Add WIP code for date ranges on dashboards
* DateFilter/dateFilterLogic to typescript
* Show 'Custom' daterange by default on a dashboard
* Border for dates in Dashboard
* Add dashboard.filters field
* Populate dashboard.filters, use it in code
* Fix some type errors in dashboardItemsModel
* Fetch dashboard items again on date change
* Make dashboard items refresh as dashboard gets updated
* Add refresh button to DashboardHeader
* Make saving dashboard items work again
* Update dashboard type
* Don't update URL in DateFilter
* Update selected time range on load
* Avoid flickering in DateFilter
* Only show 'Custom' in dashboards
* Show calendar icon next to date filter in dashboard
* Avoid double-loading results due to date change
* Kill some duplicated code
* Avoid cache when filters change
(datefilters on dashboard)
* Test individual update_cache method
* Add test for import_from and attributes being updated
* Fix typing errors
* Update api/dashboard tests
* Avoid redirects when changing date range for funnels or retention
Previously funnelLogic might be mounted in the background, causing a
reload
* Add a missing breakpoint
* Reformat with black
* Remove deprecated Team.opt_out_capture
* Remove obsolete and unused Team.users
* Make Team.organization, api_token and name stricter
* Add migration
* Add Team.api_token min length
* Adjust 0124_stricter_team for opt_out_capture removal
* Don't remove Team fields
* Update migration
* Update migration
* Set org ID of orgless teams to first org instead of deleting
* Update migration
* Fix
* Ensure that each project has a name before migration
* Rename prepare_teams