Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhpillai committed Oct 17, 2024
2 parents 4dcec0a + c7dc6a1 commit 1ee2c43
Show file tree
Hide file tree
Showing 416 changed files with 8,644 additions and 2,468 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/container-images-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ jobs:
uses: aws-actions/amazon-ecr-login@v2

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: posthog
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push container image
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/copy-clickhouse-udfs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Trigger UDFs Workflow

on:
push:
branches:
- master
paths:
- 'posthog/user_scripts/**'

jobs:
trigger_udfs_workflow:
runs-on: ubuntu-latest
steps:
- name: Trigger UDFs Workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: .github/workflows/clickhouse-udfs.yml
repo: posthog/posthog-cloud-infra
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
ref: refs/heads/main
2 changes: 1 addition & 1 deletion .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: posthog
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- uses: aws-actions/configure-aws-credentials@v4
Expand Down
2 changes: 2 additions & 0 deletions .storybook/decorators/withKea/kea-story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { worker } from '~/mocks/browser'
import { teamLogic } from 'scenes/teamLogic'
import { userLogic } from 'scenes/userLogic'
import { projectLogic } from 'scenes/projectLogic'

export function resetKeaStory(): void {
worker.resetHandlers()
Expand All @@ -18,6 +19,7 @@ export function resetKeaStory(): void {
initKea({ routerLocation: history.location, routerHistory: history })
featureFlagLogic.mount()
teamLogic.mount()
projectLogic.mount()
userLogic.mount()
router.mount()
const { store } = getContext()
Expand Down
2 changes: 1 addition & 1 deletion bin/deploy-hobby
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export SENTRY_DSN="${SENTRY_DSN:-'https://[email protected]/1'}"
POSTHOG_SECRET=$(head -c 28 /dev/urandom | sha224sum -b | head -c 56)
export POSTHOG_SECRET

ENCRYPTION_KEY=$(openssl rand -hex 16)
ENCRYPTION_SALT_KEYS=$(openssl rand -hex 16)
export ENCRYPTION_SALT_KEYS

# Talk to the user
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/billingUpgradeCTA.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ describe('Billing Upgrade CTA', () => {
cy.reload()

cy.get('[data-attr=billing-page-core-upgrade-cta] .LemonButton__content').should('not.exist')
cy.get('[data-attr=manage-billing]').should('have.text', 'Manage card details and view past invoices')
cy.get('[data-attr=manage-billing]').should('have.text', 'Manage card details and invoices')
})
})
2 changes: 1 addition & 1 deletion cypress/e2e/dashboard-duplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('duplicating dashboards', () => {
let dashboardName, insightName, expectedCopiedDashboardName, expectedCopiedInsightName

beforeEach(() => {
cy.intercept('POST', /\/api\/projects\/\d+\/dashboards/).as('createDashboard')
cy.intercept('POST', /\/api\/environments\/\d+\/dashboards/).as('createDashboard')

dashboardName = randomString('dashboard-')
expectedCopiedDashboardName = `${dashboardName} (Copy)`
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/dashboard-shared.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { dashboards } from '../productAnalytics'

describe('Shared dashboard', () => {
beforeEach(() => {
cy.intercept('GET', /api\/projects\/\d+\/insights\/\?.*/).as('loadInsightList')
cy.intercept('PATCH', /api\/projects\/\d+\/insights\/\d+\/.*/).as('patchInsight')
cy.intercept('POST', /\/api\/projects\/\d+\/dashboards/).as('createDashboard')
cy.intercept('GET', /api\/environments\/\d+\/insights\/\?.*/).as('loadInsightList')
cy.intercept('PATCH', /api\/environments\/\d+\/insights\/\d+\/.*/).as('patchInsight')
cy.intercept('POST', /\/api\/environments\/\d+\/dashboards/).as('createDashboard')
cy.useSubscriptionStatus('unsubscribed')

cy.clickNavMenu('dashboards')
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { randomString } from '../support/random'

describe('Dashboard', () => {
beforeEach(() => {
cy.intercept('GET', /api\/projects\/\d+\/insights\/\?.*/).as('loadInsightList')
cy.intercept('PATCH', /api\/projects\/\d+\/insights\/\d+\/.*/).as('patchInsight')
cy.intercept('POST', /\/api\/projects\/\d+\/dashboards/).as('createDashboard')
cy.intercept('GET', /api\/environments\/\d+\/insights\/\?.*/).as('loadInsightList')
cy.intercept('PATCH', /api\/environments\/\d+\/insights\/\d+\/.*/).as('patchInsight')
cy.intercept('POST', /\/api\/environments\/\d+\/dashboards/).as('createDashboard')

cy.clickNavMenu('dashboards')
cy.location('pathname').should('include', '/dashboard')
Expand Down Expand Up @@ -306,7 +306,7 @@ describe('Dashboard', () => {
})

it('Move dashboard item', () => {
cy.intercept('PATCH', /api\/projects\/\d+\/dashboards\/\d+\/move_tile.*/).as('moveTile')
cy.intercept('PATCH', /api\/environments\/\d+\/dashboards\/\d+\/move_tile.*/).as('moveTile')

const sourceDashboard = randomString('source-dashboard')
const targetDashboard = randomString('target-dashboard')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/insights-saved.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('Insights - saved', () => {
})

it('If cache empty, initiate async refresh', () => {
cy.intercept('GET', /\/api\/projects\/\d+\/insights\/?\?[^/]*?refresh=async/).as('getInsightsRefreshAsync')
cy.intercept('GET', /\/api\/environments\/\d+\/insights\/?\?[^/]*?refresh=async/).as('getInsightsRefreshAsync')
let newInsightId: string
createInsight('saved insight').then((insightId) => {
newInsightId = insightId
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/insights.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('Insights', () => {
})

it('Create new insight and save and continue editing', () => {
cy.intercept('PATCH', /\/api\/projects\/\d+\/insights\/\d+\/?/).as('patchInsight')
cy.intercept('PATCH', /\/api\/environments\/\d+\/insights\/\d+\/?/).as('patchInsight')

const insightName = randomString('insight-name-')
createInsight(insightName)
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/notebooks.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { urls } from 'scenes/urls'
describe('Notebooks', () => {
beforeEach(() => {
cy.fixture('api/session-recordings/recordings.json').then((recordings) => {
cy.intercept('GET', /api\/projects\/\d+\/session_recordings\/?\?.*/, { body: recordings }).as(
cy.intercept('GET', /api\/environments\/\d+\/session_recordings\/?\?.*/, { body: recordings }).as(
'loadSessionRecordingsList'
)
})

cy.fixture('api/session-recordings/recording.json').then((recording) => {
cy.intercept('GET', /api\/projects\/\d+\/session_recordings\/.*\?.*/, { body: recording }).as(
cy.intercept('GET', /api\/environments\/\d+\/session_recordings\/.*\?.*/, { body: recording }).as(
'loadSessionRecording'
)
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/projectHomepage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Project Homepage', () => {
beforeEach(() => {
cy.intercept('GET', /\/api\/projects\/\d+\/dashboards\/\d+\//).as('getDashboard')
cy.intercept('GET', /\/api\/environments\/\d+\/dashboards\/\d+\//).as('getDashboard')
cy.clickNavMenu('projecthomepage')
})

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/trends.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Trends', () => {
})

it('Can load a graph from a URL directly', () => {
cy.intercept('POST', /api\/projects\/\d+\/query\//).as('loadNewQueryInsight')
cy.intercept('POST', /api\/environments\/\d+\/query\//).as('loadNewQueryInsight')

// regression test, the graph wouldn't load when going directly to a URL
cy.visit(
Expand Down
8 changes: 4 additions & 4 deletions cypress/productAnalytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const insight = {
cy.url().should('not.include', '/new')
},
clickTab: (tabName: string): void => {
cy.intercept('POST', /api\/projects\/\d+\/query\//).as('loadNewQueryInsight')
cy.intercept('POST', /api\/environments\/\d+\/query\//).as('loadNewQueryInsight')

cy.get(`[data-attr="insight-${(tabName === 'PATHS' ? 'PATH' : tabName).toLowerCase()}-tab"]`).click()
if (tabName !== 'FUNNELS') {
Expand All @@ -51,7 +51,7 @@ export const insight = {
}
},
newInsight: (insightType: string = 'TRENDS'): void => {
cy.intercept('POST', /api\/projects\/\d+\/query\//).as('loadNewQueryInsight')
cy.intercept('POST', /api\/environments\/\d+\/query\//).as('loadNewQueryInsight')

if (insightType === 'JSON') {
cy.clickNavMenu('savedinsights')
Expand Down Expand Up @@ -86,7 +86,7 @@ export const insight = {
cy.url().should('not.include', '/new') // wait for insight to complete and update URL
},
addInsightToDashboard: (dashboardName: string, options: { visitAfterAdding: boolean }): void => {
cy.intercept('PATCH', /api\/projects\/\d+\/insights\/\d+\/.*/).as('patchInsight')
cy.intercept('PATCH', /api\/environments\/\d+\/insights\/\d+\/.*/).as('patchInsight')

cy.get('[data-attr="save-to-dashboard-button"]').click()
cy.get('[data-attr="dashboard-searchfield"]').type(dashboardName)
Expand Down Expand Up @@ -158,7 +158,7 @@ export const dashboards = {

export const dashboard = {
addInsightToEmptyDashboard: (insightName: string): void => {
cy.intercept('POST', /api\/projects\/\d+\/insights\//).as('postInsight')
cy.intercept('POST', /api\/environments\/\d+\/insights\//).as('postInsight')

cy.get('[data-attr=dashboard-add-graph-header]').contains('Add insight').click()
cy.get('[data-attr=toast-close-button]').click({ multiple: true })
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ beforeEach(() => {
req.reply({ statusCode: 404, body: 'Cypress forced 404' })
)

cy.intercept('GET', /\/api\/projects\/\d+\/insights\/?\?/).as('getInsights')
cy.intercept('GET', /\/api\/environments\/\d+\/insights\/?\?/).as('getInsights')

cy.request('POST', '/api/login/', {
email: '[email protected]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"posthog_user"."first_name",
"posthog_user"."last_name",
"posthog_user"."is_staff",
"posthog_user"."is_active",
"posthog_user"."date_joined",
"posthog_user"."uuid",
"posthog_user"."current_organization_id",
Expand All @@ -19,6 +18,7 @@
"posthog_user"."is_email_verified",
"posthog_user"."has_seen_product_intro_for",
"posthog_user"."strapi_id",
"posthog_user"."is_active",
"posthog_user"."theme_mode",
"posthog_user"."partial_notification_settings",
"posthog_user"."anonymize_data",
Expand Down Expand Up @@ -193,7 +193,6 @@
"posthog_user"."first_name",
"posthog_user"."last_name",
"posthog_user"."is_staff",
"posthog_user"."is_active",
"posthog_user"."date_joined",
"posthog_user"."uuid",
"posthog_user"."current_organization_id",
Expand All @@ -205,6 +204,7 @@
"posthog_user"."is_email_verified",
"posthog_user"."has_seen_product_intro_for",
"posthog_user"."strapi_id",
"posthog_user"."is_active",
"posthog_user"."theme_mode",
"posthog_user"."partial_notification_settings",
"posthog_user"."anonymize_data",
Expand Down
5 changes: 5 additions & 0 deletions ee/clickhouse/queries/experiments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@
# If probability of a variant is below this threshold, it will be considered
# insignificant
MIN_PROBABILITY_FOR_SIGNIFICANCE = 0.9

# Trends only: If p-value is below this threshold, the results are considered significant
P_VALUE_SIGNIFICANCE_LEVEL = 0.05

CONTROL_VARIANT_KEY = "control"
Loading

0 comments on commit 1ee2c43

Please sign in to comment.