Skip to content

Commit

Permalink
Merge branch 'master' into feat/dynamic-cohorts-rust
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarticus authored Nov 15, 2024
2 parents 0a409f4 + 7d94cb5 commit 0dd1c0b
Show file tree
Hide file tree
Showing 557 changed files with 14,965 additions and 8,614 deletions.
18 changes: 9 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = {
},
plugins: [
'react',
"react-hooks",
'react-hooks',
'cypress',
'@typescript-eslint',
'compat',
Expand All @@ -52,8 +52,8 @@ module.exports = {
'unused-imports',
],
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// PyCharm always adds curly braces, I guess vscode doesn't, PR reviewers often complain they are present on props that don't need them
// let's save the humans time and let the machines do the work
// "never" means if the prop does not need the curly braces, they will be removed/errored
Expand Down Expand Up @@ -116,7 +116,7 @@ module.exports = {
{
name: 'dayjs',
message: 'Do not directly import dayjs. Only import the dayjs exported from lib/dayjs.',
}
},
],
},
],
Expand Down Expand Up @@ -282,8 +282,8 @@ module.exports = {
node: true,
'jest/globals': true,
},
"plugins": ["jest"],
"extends": ["plugin:jest/recommended"],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
globals: {
...globals,
given: 'readonly',
Expand All @@ -310,8 +310,8 @@ module.exports = {
node: true,
'jest/globals': true,
},
"plugins": ["jest"],
"extends": ["plugin:jest/recommended"],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
globals: {
...globals,
given: 'readonly',
Expand All @@ -320,7 +320,7 @@ module.exports = {
// don't complain about unknown expect statements
'jest/valid-expect': 'off',
// don't warn about missing expect
'jest/expect-expect': 'off'
'jest/expect-expect': 'off',
},
},
{
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/rust-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64,linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: BIN=${{ matrix.image }}

- name: Container image digest
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ plugin-transpiler/dist
# Ignore any log files that happen to be present
*.log
# pyright config (keep this until we have a standardized one)
pyrightconfig.json
pyrightconfig.json
.temporal-worker-settings
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ node_modules/
pnpm-lock.yaml
posthog/templates/email/*
hogvm/typescript/src/stl/bytecode.ts
rust/
livestream/
8 changes: 4 additions & 4 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@ async function expectLocatorToMatchStorySnapshot(
* as it doesn't work with local Storybook (the live reload feature keeps up a long-running request, so we aren't idle).
*/
async function waitForPageReady(page: Page): Promise<void> {
await page.waitForLoadState("domcontentloaded");
await page.waitForLoadState("load");
await page.waitForLoadState('domcontentloaded')
await page.waitForLoadState('load')
if (process.env.CI) {
await page.waitForLoadState("networkidle");
await page.waitForLoadState('networkidle')
}
await page.evaluate(() => document.fonts.ready);
await page.evaluate(() => document.fonts.ready)
}
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Frontend: Debug Jest Tests",
"type": "node-terminal",
"command": "pnpm test:unit --runInBand",
"request": "launch",
"cwd": "${workspaceFolder}"
},
{
"name": "(lldb) Attach",
"type": "cppdbg",
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module.exports = {
plugins: [
'@babel/plugin-transform-runtime',
"@babel/plugin-transform-class-properties",
'@babel/plugin-transform-class-properties',
'@babel/plugin-transform-private-property-in-object',
'@babel/plugin-transform-nullish-coalescing-operator',
],
Expand Down
18 changes: 6 additions & 12 deletions cypress/e2e/alerts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ describe('Alerts', () => {
upperThreshold: string = '200',
condition?: string
): void => {
cy.get('[data-attr=more-button]').click()
cy.contains('Manage alerts').click()
cy.contains('Alerts').click()
cy.contains('New alert').click()

cy.get('[data-attr=alertForm-name]').clear().type(name)
Expand Down Expand Up @@ -52,18 +51,16 @@ describe('Alerts', () => {
}

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=manage-alerts-button]').should('have.attr', 'aria-disabled', 'true')
cy.contains('Alerts').should('have.attr', 'aria-disabled', 'true')

setInsightDisplayTypeAndSave('Number')

createAlert()
cy.reload()

// Check the alert has the same values as when it was created
cy.get('[data-attr=more-button]').click()
cy.contains('Manage alerts').click()
cy.contains('Alerts').click()
cy.get('[data-attr=alert-list-item]').contains('Alert name').click()
cy.get('[data-attr=alertForm-name]').should('have.value', 'Alert name')
cy.get('[data-attr=alertForm-lower-threshold').should('have.value', '100')
Expand Down Expand Up @@ -93,24 +90,21 @@ describe('Alerts', () => {
cy.contains('span', 'Funnels').click()
cy.get('[data-attr=insight-save-button]').contains('Save').click()

cy.get('[data-attr=more-button]').click()
cy.contains('Manage alerts').click()
cy.contains('Alerts').click()
cy.contains('Alert to be deleted because of a changed insight').should('not.exist')
})

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

setInsightDisplayTypeAndSave('Bar chart')

createAlert('Alert name', '10', '20', 'increases by')
cy.reload()

// Check the alert has the same values as when it was created
cy.get('[data-attr=more-button]').click()
cy.contains('Manage alerts').click()
cy.contains('Alerts').click()
cy.get('[data-attr=alert-list-item]').contains('Alert name').click()
cy.get('[data-attr=alertForm-name]').should('have.value', 'Alert name')
cy.get('[data-attr=alertForm-lower-threshold').should('have.value', '10')
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/billing.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ describe('Billing', () => {
cy.get('[data-attr=more-button]').first().click()
cy.contains('.LemonButton', 'Unsubscribe').click()
cy.get('.LemonModal h3').should('contain', 'Unsubscribe from Product analytics')
cy.get('[data-attr=unsubscribe-reason-too-expensive]').click()

cy.get('[data-attr=unsubscribe-reason-survey-textarea]').type('Product analytics')
cy.contains('.LemonModal .LemonButton', 'Cancel').click()

cy.get('[data-attr=more-button]').eq(1).click()
cy.contains('.LemonButton', 'Unsubscribe').click()
cy.get('.LemonModal h3').should('contain', 'Unsubscribe from Session replay')
cy.get('[data-attr=unsubscribe-reason-too-expensive]').click()
cy.get('[data-attr=unsubscribe-reason-survey-textarea]').type('Session replay')
cy.contains('.LemonModal .LemonButton', 'Cancel').click()

Expand Down
32 changes: 11 additions & 21 deletions cypress/e2e/experiments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,6 @@ describe('Experiments', () => {
.type('test-variant-2')
.should('have.value', 'test-variant-2')

// Continue to step 2
cy.get('[data-attr="continue-experiment-creation"]').click()

// Goal type selection is visible
cy.get('[data-attr="experiment-goal-type-select"]')
.should('be.visible')
.within(() => {
cy.contains('Conversion funnel').should('be.visible')
cy.contains('Trend').should('be.visible')
})

// Goal input is visible
cy.get('[data-attr="experiment-goal-input"]')
.should('be.visible')
.within(() => {
cy.get('li.ActionFilterRow').should('exist')
cy.get('button').contains('Add funnel step').should('exist')
})

// Save experiment
cy.get('[data-attr="save-experiment"]').first().click()
})
Expand Down Expand Up @@ -98,10 +79,19 @@ describe('Experiments', () => {
.type('test-variant-2')
.should('have.value', 'test-variant-2')

// Continue creation
cy.get('[data-attr="continue-experiment-creation"]').first().click()
// Save experiment
cy.get('[data-attr="save-experiment"]').first().click()

// Set the experiment goal once the experiment is drafted
cy.get('[data-attr="add-experiment-goal"]').click()

// Wait for the goal modal to open and click the confirmation button
cy.get('.LemonModal__layout').should('be.visible')
cy.contains('Change experiment goal').should('be.visible')
cy.get('.LemonModal__footer').contains('button', 'Save').should('have.attr', 'aria-disabled', 'true')
cy.get('.LemonModal__content').contains('button', 'Add funnel step').click()
cy.get('.LemonModal__footer').contains('button', 'Save').should('not.have.attr', 'aria-disabled', 'true')
cy.get('.LemonModal__footer').contains('button', 'Save').click()
}

it('create, launch and stop experiment with new ui', () => {
Expand Down
Loading

0 comments on commit 0dd1c0b

Please sign in to comment.