* feat: view insights list filtered by dashboard
* make dashboards match AND
* sort the assertion
* Update posthog/api/insight.py
Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* Add a feature flag for onboarding v2
* Support a 'technical' state
to store if the user can add the snippet
* Add a panel to invite team if not technical
* Show the invite panel if the flag is on
* Fix where this was always returning true
* Make navigation work
* couple fixes
* fix buttons
* Move all v2 stuff to its own folder
* Fix up the imports
* Fix more imports
* Create component to handle flag before using logic
When both V1 & V2 logics ran side-by-side their functions conflicted
* Let ppl get to the bookmarklet from invite panel
* Add invite members button to all onboarding panels
* Limit the width of the panels
* Change language to talk about value, not features
* Fix ts error
* Fix some spacing
* Add better description & link to HTTP API instrctn
* Add the invite button to the verify panel
* Show a more sane msg after completing onboarding
* move v1 onboarding to own folder
* fix imports
* fix more imports
* move types to top folder
* improve imports
Co-authored-by: Emanuele Capparelli <k@emkpp.com>
Co-authored-by: Emanuele Capparelli <kappa90@users.noreply.github.com>
Problem
Via customer feedback: If someone is deleting a dashboard they want to delete the insights too. At the moment that means they have to delete them one at a time.
Changes
Introduces a modal when deleting a dashboard that lets you choose whether to delete the insights on the dashboard
Soft-deletes the insights as appropriate
Sometimes they look like numbers and get misidentified as such. This
makes them always strings.
Parially resolves https://github.com/PostHog/posthog/issues/12529 except
we do not update old property definitions. I'll do this separately.
* fix(plugin-server): add shutdown failsave timeout
We were having an issue where a Kafka version upgrade caused the
plugin-server to hang on shutdown. This was because the Kafka producer
was not able to flush its messages to Kafka. This commit adds a timeout
to the shutdown process, so that the plugin-server will exit even if
something hangs.
See https://posthog.slack.com/archives/C046SERP277/p1667878901739969 for
details
I wasn't exactly sure how to make this a little more testable, but there
is clearly a blind spot for certain failure cases.
* Actually call the shutdown sequence
* wip
* refactor(plugin-server): separate api from functional_tests
This just moves the api helpers to a separate file, such that we can
import from other files.
* test(plugin-server): add functional tests for property definitions
I was going to take a stab at
https://github.com/PostHog/posthog/issues/12529 but I wasn't sure how
the definition bits worked, so thought I'd add some tests first.
This doesn't just add tests but also:
1. starts demonstrating how we can split up the tests into
different files, thereby also allowing jest test isolation.
2. removes --runInBand, such that isolated tests can run in parallel
* chore(api): return 400 on entity_id not provided by requests
Previously we were raising a ValueError for this case, which results in
a 500 HTTP status code when caught by django-rest-framework. Instead we
raise a ValidationError which should result in a 400 status code along
with the validation error message.
This change was prompted by [this slack
conversation](https://posthogusers.slack.com/archives/C01GLBKHKQT/p1667802817723279)
where the user was missing an `entity_id` and `entity_type` param.
* wip
* feat(person-on-events): track groups-on-events separately using instance setting
We want to release persons-on-events but we found groups-related issues
in incoming data that need to be fixed to release the feature for
groups.
Instead of delaying the release further, this change allows us to turn
persons-on-events on only for persons and handle groups separately
* Update CI
* fix ee/clickhouse/models/test/test_property.py tests
* add GROUPS_JOIN_QUERY if needed for breakdowns
* Excluse a breakdown test
* Skip some funnels breakdown tests with mat group columns
* Skip groups-related breakdown tests
* Skip a group property test
* Undo changes to breakdown_props.py
* Update test_property.py
* Update snapshots
* groups_on_events off by default
* Update snapshots
* Remove override_instance_config
* Add a docstring
* Make setting editable
* Fix breakdowns issue
* Update snapshots
* Update snapshots
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* fix(trends): Support hourly "Compare to previous period" properly
* Update snapshots
* Keep week-by-week hack, with extensive commentary
* Fix typing
* Fix missing words in comment
* Limit addition of 1 day to relative ranges
* Update snapshots
* Make special case handling mores specific
* Satisfy mypy
* Update tests
* Sprinkle on `@snapshot_clickhouse_queries`
* Update snapshots
* Update snapshots
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Problem
Getting a dashboard shows up in Sentry as having an n+1 query on team. Loading the team once per insight tile on the dashboard
https://sentry.io/organizations/posthog/issues/3708033962/events/231b0122bd834e54b44cfb6d2c6ff561/?project=1899813&query=is%3Aunresolved&referrer=previous-event&statsPeriod=14d
Changes
simplifies the existing n+1 test to make it clear that the query is still far from optimised
reads tiles off the dashboard in the serializer context to reduce several queries
the loading is still n+1 but far less than it was
we started at 10 additional queries for the first tile on a dashboard and three more for each subsequent tile
now we're on 8 for the first and 1 for each subsequent tile
Changed contributors badge style of the to fit others
The Contributors badge had a flat-square style and all of the rest had a flat style.
I changed it to be like the rest.
Hope it's ok, saw the section had a comment not to change or move anything, so double-check it...
chore(plugin-server): Enforce strict timestamp types throughout ingestion
We have had multiple bugs relating to various timestamp formats in the past - most systems use iso8601 whilst clickhouse uses its own format. See https://github.com/PostHog/posthog/pull/12547 for a recent example.
We have had a pattern for a while for the use of specific types (ClickHouseTimestamp, ISOTimestamp) in the code, but this was not enforced and some functions in the code did not return appropriate values.
This PR changes that