Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aspicer/trends udf #24542

Closed
wants to merge 131 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
aa57fb6
feat: make group identify props easier to find in replay (#24497)
pauldambra Aug 21, 2024
795380b
fix(insights): check in the breakdown_value to find the "other" break…
skoob13 Aug 21, 2024
bd414ed
feat(insights): Add v2 cache warming for recently viewed shared insig…
webjunkie Aug 21, 2024
112aa68
chore: abstract property methods (#24490)
daibhin Aug 21, 2024
8a6020d
feat(capture-rs): implement replay capture in capture-rs (#24461)
frankh Aug 21, 2024
beb0a47
refactor(insights): clean up after query based insights refactor (#24…
thmsobrmlr Aug 21, 2024
1024d82
fix: label query execution time with query kind (#24501)
anirudhpillai Aug 21, 2024
f063d4d
feat(cdp): Notify if template updates are available (#24386)
benjackwhite Aug 21, 2024
406ed6e
fix: Use posthog.version in heatmap logic (#24484)
robbie-c Aug 21, 2024
888fca6
fix: All events filter (#24507)
benjackwhite Aug 21, 2024
1eea80b
fix: fix check for $0 billing limit (#24506)
zlwaterfield Aug 21, 2024
8a65548
chore: remove unnaccessible api endpoints and rate limit snapshots (#…
daibhin Aug 21, 2024
8535a96
fix: latest version warnings can be less eager (#24504)
pauldambra Aug 21, 2024
8f3d31c
fix: add check for no tier (#24508)
zlwaterfield Aug 21, 2024
e1def6e
fix: show visibility less (#24488)
pauldambra Aug 21, 2024
9734a40
feat: cyclotron (#24228)
oliverb123 Aug 21, 2024
69d6754
fix: Fix column order difference between creation and migration in ra…
robbie-c Aug 21, 2024
020a49a
fix(insights): Fix flapping insight viz sizing (#24503)
Twixes Aug 21, 2024
c802071
fix: fix the null billing limit (#24515)
zlwaterfield Aug 21, 2024
47e59ca
trends wip
aspicer Aug 21, 2024
a336eb0
udf returning timestamps and success / failure
aspicer Aug 21, 2024
8ca6403
feat(queries): Adjust cache warming schedule (#24514)
webjunkie Aug 22, 2024
85c6235
fix: bump max wait time for flakey cyclotron test, add RUST_BACKTRACE…
bretthoerner Aug 22, 2024
5ee45fc
feat: preview dashboard filter changes (#24303)
anirudhpillai Aug 22, 2024
34d0da7
chore(deps): Upgrade mypy, stubs, and ruff (#24500)
webjunkie Aug 22, 2024
1e9dde7
chore(nav): Rename "People" to "People and groups" (#24499)
Twixes Aug 22, 2024
b54b749
fix: tag cohort queries (#24523)
anirudhpillai Aug 22, 2024
bb997bc
fix(insights): Expire cache warming tasks at a fixed time (#24519)
webjunkie Aug 22, 2024
eadb2c7
fix(batch-exports): Do not attempt to decode empty values (#24520)
tomasfarias Aug 22, 2024
0ffd816
fix(batch-exports): Retry up to 5 times on postgres connection (#24518)
tomasfarias Aug 22, 2024
1d7949e
fix: Fix broken columns (#24510)
timgl Aug 22, 2024
dcf38bb
fix(batch-exports): Do not allow backfills in the future (#24517)
tomasfarias Aug 22, 2024
8f4a6e6
chore: refactor cyclotron-core (#24526)
oliverb123 Aug 22, 2024
c66f9e4
chore: Re-enable Django model order lint rule (#24525)
webjunkie Aug 22, 2024
4d3d6d2
chore(experiments): Trend results UI tweaks (#24482)
jurajmajerik Aug 22, 2024
d6ad9fa
feat(flags): return real feature flag evaluation for basic matching w…
dmarticus Aug 22, 2024
f22a225
chore: allow log entry properties (#24487)
daibhin Aug 22, 2024
57e8f3f
fix(data-warehouse): Only limit dwh source when actually chunking (#2…
Gilbert09 Aug 22, 2024
21ff961
chore(batch-exports): Log decode errors (#24534)
tomasfarias Aug 22, 2024
a7da933
chore: add rate limit to the sync to billing (#24539)
zlwaterfield Aug 22, 2024
d2115ff
start of interval logic
aspicer Aug 22, 2024
2d34776
returning trends
aspicer Aug 22, 2024
64afdd3
funnels query runner
aspicer Aug 23, 2024
4f3c247
max steps ordered
aspicer Aug 23, 2024
db59c81
min
aspicer Aug 23, 2024
9f4228a
new test files
aspicer Aug 23, 2024
e6ad4a9
fix(cyclotron): make all config envconfig (#24538)
bretthoerner Aug 23, 2024
4a0dbb1
chore(cyclotron): publish docker images (#24537)
bretthoerner Aug 23, 2024
8d710d7
feat(insights): Remove insight cache tasks from schedule (#24532)
webjunkie Aug 23, 2024
7ff654c
fix(integrations): load double the number of slack channels (#24529)
thmsobrmlr Aug 23, 2024
2f61308
breakdowns, working on join
aspicer Aug 23, 2024
eca510d
feat(cdp): Automatic migration of plugin destinations (#24366)
benjackwhite Aug 23, 2024
e0bba1e
fix(api): add scopes for persons api access (#24528)
thmsobrmlr Aug 23, 2024
c568328
fix(insights): Attribute cache warming queries (#24543)
webjunkie Aug 23, 2024
4c4ece6
fix(batch-exports): Retryable errors on specific code and log error m…
tomasfarias Aug 23, 2024
dfc67cc
fix: Handle raw string as JSON (#24541)
tomasfarias Aug 23, 2024
bb35804
fix(insights): migrate PersonsNode to ActorsQuery (#24524)
skoob13 Aug 23, 2024
cc8a193
fix: add spacing between breakdown and compare value labels (#24540)
Itsindigo Aug 23, 2024
c25b571
fix(insights): use exclude_none flag for cleaner queries (#24546)
thmsobrmlr Aug 23, 2024
88003f8
feat: cyclotron metrics (#24531)
oliverb123 Aug 23, 2024
3714d5a
fix(batch-exports): Exception handling of intermittent errors (#24416)
tomasfarias Aug 23, 2024
c8d8bdb
feat(experiments): "Make decision" touch ups (#24480)
jurajmajerik Aug 23, 2024
b0b4a69
fix(docs): Remove responses from all actions (#24548)
timgl Aug 23, 2024
577f7ab
fix(batch-exports): Catch JSONDecodeError, not JSONEncodeError (#24552)
tomasfarias Aug 23, 2024
f68218a
refactor(insights): remove query-based-insights-saving flag (#24547)
thmsobrmlr Aug 23, 2024
f0abc88
feat(web-analytics): Add new session bounce rate calculation into Hog…
robbie-c Aug 23, 2024
187d37d
breakdowns working
aspicer Aug 23, 2024
a97fefd
undo test rig
aspicer Aug 23, 2024
145cacf
feat: cyclotron fetch and janitor run migrations (#24559)
oliverb123 Aug 23, 2024
aef455c
breakdowns working, 5 tests failing for funnel trends
aspicer Aug 23, 2024
42bed52
Update query snapshots
github-actions[bot] Aug 23, 2024
041ee84
Update query snapshots
github-actions[bot] Aug 23, 2024
ce8ca2e
timezone parsing correct
aspicer Aug 23, 2024
89b0371
Merge branch 'aspicer/trends-udf' of github.com:PostHog/posthog into …
aspicer Aug 23, 2024
ebadbdf
qq
aspicer Aug 23, 2024
f3731be
Update query snapshots
github-actions[bot] Aug 23, 2024
cb253ec
testing
aspicer Aug 23, 2024
93d69db
Merge branch 'aspicer/trends-udf' of github.com:PostHog/posthog into …
aspicer Aug 23, 2024
96bde73
Update query snapshots
github-actions[bot] Aug 23, 2024
38d7a3b
fix(data-warehouse): Use better mechanics for resyncing a table (#24557)
Gilbert09 Aug 24, 2024
46b18ba
chore(sessions-v2): Increase timeout to 2 hours (#24571)
robbie-c Aug 25, 2024
1ff06d0
chore: bump version of CH for local dev (#24566)
fuziontech Aug 25, 2024
fc00dd0
feat(cdp): Added docs links for hog functions (#24545)
benjackwhite Aug 26, 2024
d71d24d
fix(data-warehouse): De-nest hubspot tables (#24423)
Gilbert09 Aug 26, 2024
3057194
switch to json
aspicer Aug 27, 2024
3430f4a
lala
aspicer Aug 27, 2024
f97d8f5
Update query snapshots
github-actions[bot] Aug 27, 2024
39b7220
Update query snapshots
github-actions[bot] Aug 27, 2024
f0d94b0
feat: Pull event/property definitions into its own service, so we can…
oliverb123 Aug 27, 2024
1e9c32d
feat(capture): handle empty string UUIDs for `/batch` endpoint (#24586)
dmarticus Aug 27, 2024
2b3dbf6
reduce files
aspicer Aug 27, 2024
112444a
Merge branch 'aspicer/trends-udf' of github.com:PostHog/posthog into …
aspicer Aug 27, 2024
e9e3441
feat(hogvm): serialize the stack between async operations (#24574)
mariusandra Aug 27, 2024
615c435
feat(cyclotron): Change dead-letter strategy, adopt in fetch and jani…
oliverb123 Aug 27, 2024
4cb0b9e
fix: refactor the inspector list filtering (#24580)
pauldambra Aug 27, 2024
397919d
feat(hog): parser updates for lambdas (#24575)
mariusandra Aug 27, 2024
f685cec
fix(insights): hide delete series button when there is a single serie…
skoob13 Aug 27, 2024
92a86ec
fix: don't show doctor events in everything mode (#24594)
pauldambra Aug 27, 2024
fb1cb6f
feat(insights): Record alert checks and track state (#24446)
webjunkie Aug 27, 2024
c50a791
feat: allow configuring max.message.bytes for rust capture (#24599)
frankh Aug 27, 2024
b8dd904
feat: Add ci/cd for capture-replay (#24604)
frankh Aug 27, 2024
af509c8
chore(data-warehouse): Dont allow S3 protocol for linking data source…
Gilbert09 Aug 27, 2024
686f534
fix(hogql): use new hogql parser version (#24606)
mariusandra Aug 27, 2024
5a571d7
fix: horizontal bar chart breakdown label show series name (#24603)
anirudhpillai Aug 27, 2024
b09b469
chore: switch recording filtering to be a query (#24292)
daibhin Aug 27, 2024
b7105b6
feat(hog): bytecode versions (#24584)
mariusandra Aug 27, 2024
f5b03ab
feat(web-analytics): Add a setting to use the uniq_page_screen_autoca…
robbie-c Aug 27, 2024
dcfbd8e
chore(batch-exports): Do not retry on endpoint errors (#24544)
tomasfarias Aug 27, 2024
3575a9e
feat: replay UX wins (#24483)
daibhin Aug 27, 2024
26e3e0e
fix(hog): bytecode starts with _H as well (#24610)
mariusandra Aug 27, 2024
547d9f5
chore: remove event properties from subquery (#24558)
daibhin Aug 27, 2024
4d99a9c
perf: Rewrite comparison operations that use property group values to…
tkaemming Aug 27, 2024
a43f6b1
fix(redux): disable devtools (#24611)
mariusandra Aug 27, 2024
ce43b85
fix(data-warehouse): Revert "fix(data-warehouse): De-nest hubspot tab…
Gilbert09 Aug 27, 2024
1fb4e7f
chore(cyclotron): change columns to bytes, add blob column (#24563)
bretthoerner Aug 27, 2024
b434bb8
feat(web-analytics): Default onto sessions v2 (#24615)
robbie-c Aug 27, 2024
54b2bc4
feat: Add soft delete column to events (#24581)
fuziontech Aug 27, 2024
8dde90a
feat(flags): adding support for GeoIP and person property overrides t…
dmarticus Aug 27, 2024
b7ac533
timezones working
aspicer Aug 27, 2024
f4497a7
chore: Make avg response times more visible in support form (#24588)
slshults Aug 27, 2024
6dfb5aa
Update query snapshots
github-actions[bot] Aug 27, 2024
8c07c63
Update query snapshots
github-actions[bot] Aug 27, 2024
14f4452
chore: Add workflow run timestamp (#24618)
danielxnj Aug 27, 2024
a8f250b
merge
aspicer Aug 27, 2024
71f6177
remove pypy
aspicer Aug 27, 2024
775c2e5
fix test
aspicer Aug 27, 2024
03a0617
Update query snapshots
github-actions[bot] Aug 28, 2024
d940fc5
i c
aspicer Aug 28, 2024
8dc53dc
Merge branch 'aspicer/trends-udf' of github.com:PostHog/posthog into …
aspicer Aug 28, 2024
499b5be
Update query snapshots
github-actions[bot] Aug 28, 2024
253f3e8
Update query snapshots
github-actions[bot] Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@
!test-runner-jest.config.js
!test-runner-jest-environment.js
!patches
!rust
rust/.env
rust/.github
rust/docker
rust/target
rust/cyclotron-node/dist
rust/cyclotron-node/node_modules
rust/cyclotron-node/index.node
2 changes: 1 addition & 1 deletion .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ runs:

- name: Upload updated timing data as artifacts
uses: actions/upload-artifact@v4
if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.5.81-alpine' }}
if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.6.19-alpine' }}
with:
name: timing_data-${{ inputs.segment }}-${{ inputs.group }}
path: .test_durations
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-backend-update-test-timing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
group: 1
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
python-version: '3.11.9'
clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.5.81-alpine'
clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.6.19-alpine'
segment: 'FOSS'
person-on-events: false

- name: Upload updated timing data as artifacts
uses: actions/upload-artifact@v4
if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.5.81-alpine' }}
if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.6.19-alpine' }}
with:
name: timing_data-${{ inputs.segment }}-${{ inputs.group }}
path: .test_durations
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.11.9']
clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.5.81-alpine']
clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.6.19-alpine']
segment: ['Core']
person-on-events: [false, true]
# :NOTE: Keep concurrency and groups in sync
Expand All @@ -242,7 +242,7 @@ jobs:
include:
- segment: 'Temporal'
person-on-events: false
clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.5.81-alpine'
clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.6.19-alpine'
python-version: '3.11.9'
concurrency: 1
group: 1
Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:
strategy:
fail-fast: false
matrix:
clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.5.81-alpine']
clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.6.19-alpine']
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-hog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ jobs:
antlr | grep "Version"
npm run grammar:build && git diff --exit-code
env:
# Installing a version of ANTLR compatible with what's in Homebrew as of October 2023 (version 4.13),
# Installing a version of ANTLR compatible with what's in Homebrew as of August 2024 (version 4.13.2),
# as apt-get is quite out of date. The same version must be set in hogql_parser/pyproject.toml
ANTLR_VERSION: '4.13.1'
ANTLR_VERSION: '4.13.2'

- name: Run HogVM Python tests
if: needs.changes.outputs.hog == 'true'
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/container-images-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ jobs:
"release": "posthog",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": ${{ steps.labels.outputs.labels }}
"labels": ${{ steps.labels.outputs.labels }},
"timestamp": "${{ github.event.head_commit.timestamp }}"
}

- name: Check for changes in plugins directory
Expand All @@ -124,7 +125,8 @@ jobs:
"release": "ingestion",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": ${{ toJson(steps.labels.outputs.labels) }}
"labels": ${{ toJson(steps.labels.outputs.labels) }},
"timestamp": "${{ github.event.head_commit.timestamp }}"
}

- name: Check for changes that affect batch exports temporal worker
Expand All @@ -149,7 +151,8 @@ jobs:
"release": "temporal-worker",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": ${{ steps.labels.outputs.labels }}
"labels": ${{ steps.labels.outputs.labels }},
"timestamp": "${{ github.event.head_commit.timestamp }}"
}

- name: Check for changes that affect general purpose temporal worker
Expand All @@ -174,7 +177,8 @@ jobs:
"release": "temporal-worker-general-purpose",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": ${{ steps.labels.outputs.labels }}
"labels": ${{ steps.labels.outputs.labels }},
"timestamp": "${{ github.event.head_commit.timestamp }}"
}

- name: Check for changes that affect data warehouse temporal worker
Expand All @@ -199,5 +203,6 @@ jobs:
"release": "temporal-worker-data-warehouse",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": ${{ steps.labels.outputs.labels }}
"labels": ${{ steps.labels.outputs.labels }},
"timestamp": "${{ github.event.head_commit.timestamp }}"
}
3 changes: 2 additions & 1 deletion .github/workflows/livestream-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ jobs:
},
"release": "livestream",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }}
"repository": ${{ toJson(github.repository) }},
"timestamp": "${{ github.event.head_commit.timestamp }}"
}
41 changes: 40 additions & 1 deletion .github/workflows/rust-docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build rust container images
name: Build and deploy rust container images

on:
workflow_dispatch:
Expand All @@ -19,12 +19,18 @@ jobs:
- hook-api
- hook-janitor
- hook-worker
- cyclotron-janitor
- cyclotron-fetch
- property-defs-rs
runs-on: depot-ubuntu-22.04-4
permissions:
id-token: write # allow issuing OIDC tokens for this workflow run
contents: read # allow reading the repo contents
packages: write # allow push to ghcr.io

outputs:
digest: ${{ steps.docker_build.outputs.digest }}

defaults:
run:
working-directory: rust
Expand Down Expand Up @@ -88,3 +94,36 @@ jobs:

- name: Container image digest
run: echo ${{ steps.docker_build.outputs.digest }}

deploy:
name: Deploy capture-replay
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: get deployer token
id: deployer
uses: getsentry/action-github-app-token@v3
with:
app_id: ${{ secrets.DEPLOYER_APP_ID }}
private_key: ${{ secrets.DEPLOYER_APP_PRIVATE_KEY }}

- name: Trigger livestream deployment
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.deployer.outputs.token }}
repository: PostHog/charts
event-type: commit_state_update
client-payload: |
{
"values": {
"image": {
"sha": "${{ needs.build.outputs.digest }}"
}
},
"release": "capture-replay",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": [],
"timestamp": "${{ github.event.head_commit.timestamp }}"
}
2 changes: 1 addition & 1 deletion .github/workflows/rust-hook-migrator-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
uses: depot/build-push-action@v1
with:
context: ./rust/
file: ./rust/Dockerfile.migrate
file: ./rust/Dockerfile.migrate-hooks
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- '.github/workflows/rust.yml'
- '.github/workflows/rust-docker-build.yml'
- '.github/workflows/rust-hook-migrator-docker.yml'
- '.github/workflows/rust-cyclotron-migrator-docker.yml'
- 'posthog/management/commands/setup_test_environment.py'
- 'posthog/migrations/**'
- 'ee/migrations/**'
Expand Down Expand Up @@ -164,11 +165,17 @@ jobs:
DATABASE_URL: 'postgres://posthog:posthog@localhost:5432/posthog'
run: cd ../ && python manage.py setup_test_environment --only-postgres

- name: Download MaxMind Database
if: needs.changes.outputs.rust == 'true'
run: |
mkdir -p ../share
curl -L "https://mmdbcdn.posthog.net/" --http1.1 | brotli --decompress --output=../share/GeoLite2-City.mmdb

- name: Run cargo test
if: needs.changes.outputs.rust == 'true'
run: |
echo "Starting cargo test"
cargo test --all-features ${{ matrix.package == 'feature-flags' && '--package feature-flags' || '--workspace --exclude feature-flags' }}
RUST_BACKTRACE=1 cargo test --all-features ${{ matrix.package == 'feature-flags' && '--package feature-flags' || '--workspace --exclude feature-flags' }}
echo "Cargo test completed"

linting:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/vector-docker-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,6 @@ jobs:
"release": "replay-capture-vector",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": []
"labels": [],
"timestamp": "${{ github.event.head_commit.timestamp }}"
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ plugin-transpiler/dist
*-esbuild-bundle-visualization.html
.dlt
*.db
# Ignore any log files that happen to be present
*.log
21 changes: 21 additions & 0 deletions bin/start-cyclotron
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -ex

trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT

cd rust

cargo build

export RUST_LOG=${DEBUG:-debug}
SQLX_QUERY_LEVEL=${SQLX_QUERY_LEVEL:-warn}
export RUST_LOG=$RUST_LOG,sqlx::query=$SQLX_QUERY_LEVEL

export DATABASE_URL=${DATABASE_URL:-postgres://posthog:posthog@localhost:5432/posthog}
export ALLOW_INTERNAL_IPS=${ALLOW_INTERNAL_IPS:-true}

./target/debug/cyclotron-fetch &
./target/debug/cyclotron-janitor &

wait
12 changes: 5 additions & 7 deletions cypress/e2e/alerts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ describe('Alerts', () => {

const createAlert = (
name: string = 'Alert name',
email: string = '[email protected]',
lowerThreshold: string = '100',
upperThreshold: string = '200'
): void => {
cy.get('[data-attr=more-button]').click()
cy.contains('Alerts').click()
cy.contains('Manage alerts').click()
cy.contains('New alert').click()

cy.get('[data-attr=alert-name]').clear().type(name)
cy.get('[data-attr=alert-notification-targets').clear().type(email)
cy.get('[data-attr=subscribed-users').click().type('{downarrow}{enter}')
cy.get('[data-attr=alert-lower-threshold').clear().type(lowerThreshold)
cy.get('[data-attr=alert-upper-threshold').clear().type(upperThreshold)
cy.contains('Create alert').click()
cy.get('.Toastify__toast-body').should('contain', 'Alert saved')
cy.url().should('not.include', '/new')

cy.get('[aria-label="close"]').click()
Expand All @@ -38,14 +38,15 @@ describe('Alerts', () => {
cy.get('[data-attr=insight-edit-button]').click()
cy.get('[data-attr=chart-filter]').click()
cy.contains(displayType).click()
cy.get('.insight-empty-state').should('not.exist')
cy.get('[data-attr=insight-save-button]').contains('Save').click()
cy.url().should('not.include', '/edit')
}

it('Should allow create and delete an alert', () => {
cy.get('[data-attr=more-button]').click()
// Alerts should be disabled for trends represented with graphs
cy.get('[data-attr=disabled-alerts-button]').should('exist')
cy.get('[data-attr=manage-alerts-button]').should('have.attr', 'aria-disabled', 'true')

setInsightDisplayTypeAndSave('Number')

Expand All @@ -54,10 +55,8 @@ describe('Alerts', () => {

// Check the alert has the same values as when it was created
cy.get('[data-attr=more-button]').click()
cy.contains('Alerts').click()
cy.contains('Manage alerts').click()
cy.get('[data-attr=alert-list-item]').contains('Alert name').click()
cy.get('[data-attr=alert-notification-targets]').should('have.value', '[email protected]')
cy.get('[data-attr=alert-name]').should('have.value', 'Alert name')
cy.get('[data-attr=alert-lower-threshold').should('have.value', '100')
cy.get('[data-attr=alert-upper-threshold').should('have.value', '200')
Expand Down Expand Up @@ -90,7 +89,6 @@ describe('Alerts', () => {

// Assert that saving an insight in an incompatible state removes alerts
cy.get('[data-attr=more-button]').click()
cy.contains('Alerts').click()
cy.contains('Manage alerts').click()
cy.contains('Alert to be deleted because of a changed insight').should('not.exist')
})
Expand Down
32 changes: 32 additions & 0 deletions cypress/e2e/billing-limits.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,38 @@ describe('Billing Limits', () => {
)
})

it('Show existing limit and allow user to change set to $0', () => {
cy.intercept('GET', '/api/billing/', (req) => {
req.reply({
statusCode: 200,
body: {
...require('../fixtures/api/billing/billing.json'),
custom_limits_usd: { product_analytics: 100 },
},
})
}).as('getBilling')
cy.visit('/organization/billing')
cy.wait('@getBilling')

cy.intercept('PATCH', '/api/billing/', (req) => {
req.reply({
statusCode: 200,
body: {
...require('../fixtures/api/billing/billing.json'),
custom_limits_usd: { product_analytics: 0 },
},
})
}).as('patchBilling')

cy.get('[data-attr="billing-limit-input-wrapper-product_analytics"]').scrollIntoView()
cy.get('[data-attr="billing-limit-set-product_analytics"]').should('be.visible')
cy.contains('Edit limit').click()
cy.get('[data-attr="billing-limit-input-product_analytics"]').clear().type('0')
cy.get('[data-attr="save-billing-limit-product_analytics"]').click()
cy.wait('@patchBilling')
cy.get('[data-attr="billing-limit-set-product_analytics"]').should('contain', 'You have a $0 billing limit set')
})

it('Show existing limit and allow user to remove it', () => {
cy.intercept('GET', '/api/billing/', (req) => {
req.reply({
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
// refresh the dashboard by changing date range
cy.get('[data-attr="date-filter"]').click()
cy.contains('span', 'Last 14 days').click()
cy.contains('span', 'Apply and save dashboard').click()
cy.contains('span', 'Save').click()

cy.contains('span[class="text-primary text-sm font-medium"]', 'Refreshing').should('not.exist')
cy.get('span').contains('Refreshing').should('not.exist')
Expand Down Expand Up @@ -163,7 +163,7 @@
cy.get('[data-attr=date-filter]').contains('No date range override').click()
cy.get('div').contains('Yesterday').should('exist').click()
cy.get('[data-attr=date-filter]').contains('Yesterday')
cy.get('button').contains('Apply and save dashboard').click()
cy.get('button').contains('Save').click()
cy.get('.InsightCard h5').should('have.length', 1).contains('Yesterday')
// Cool, now back to A and make sure the insight is still using the original range there, not the one from B
cy.clickNavMenu('dashboards')
Expand Down Expand Up @@ -347,7 +347,7 @@
* This throws the error Code: 386. DB::Exception: There is no supertype for types String, Float64 because some of them are String/FixedString and some of them are not. (NO_COMMON_TYPE)
* All the 'app_ratings' are extracted as strings and 5. is a float
*/
// it('Opens dashboard item in insights', () => {

Check warning on line 350 in cypress/e2e/dashboard.cy.ts

View workflow job for this annotation

GitHub Actions / Code quality checks

Some tests seem to be commented
// cy.get('[data-attr=dashboard-name]').contains('App Analytics').click()
// cy.get('.InsightCard [data-attr=insight-card-title]').first().click()
// cy.location('pathname').should('include', '/insights')
Expand Down
4 changes: 4 additions & 0 deletions cypress/e2e/trends.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,8 @@ describe('Trends', () => {
cy.get('[data-attr=math-monthly_active-0]').trigger('mouseenter') // Activate warning tooltip
cy.get('.Tooltip').contains('we recommend using "Unique users" here instead').should('exist')
})

it('Does not show delete button on single series insight', () => {
cy.get('[data-attr=delete-prop-filter-0]').should('not.exist')
})
})
Loading
Loading