Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master: (118 commits)
  Sync and remove all non-FOSS parts
  chore: Do not retry on S3 ClientError (#17291)
  feat: Frontend support for S3 compression and exclude events (#17269)
  feat: access previous & next nodes from every node (#17286)
  feat: insight viz view props (#17279)
  feat: S3 BatchExports missing features (#17233)
  feat: change filters to work based off container style (#17280)
  chore: realtime sources observability (#17284)
  fix: player preview freezes big recordings (#17202)
  chore: Update announcementLogic to match incident guidelines (#17181)
  feat: HogQL insights in notebooks (#17111)
  chore(ci): remove recording-ingestion-load-test step (#17277)
  feat: onboarding steps, navigation, & sdk logic (#17253)
  fix: persons id value dropdown (#17268)
  feat(notebook): Allow creating early access from notebooks (#17264)
  feat: expand on click (#17266)
  feat(notebooks): Create early access management component (#17252)
  fix: Exclude invalid keys from Temporal Schedule update (#17261)
  feat: data table view props (#17185)
  feat: add uniqueKey as a prop to query rendering (#17187)
  ...
  • Loading branch information
karambir committed Sep 1, 2023
2 parents 61583e8 + 5e776d3 commit 3ae45f5
Show file tree
Hide file tree
Showing 951 changed files with 23,792 additions and 22,933 deletions.
45 changes: 35 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
/* global module */

const env = {
browser: true,
es6: true,
'cypress/globals': true,
}

const globals = {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
}

module.exports = {
ignorePatterns: ['node_modules', 'plugin-server'],
env: {
browser: true,
es6: true,
'cypress/globals': true,
},
env,
settings: {
react: {
version: 'detect',
},
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:eslint-comments/recommended',
'plugin:storybook/recommended',
'prettier',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
globals,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
Expand All @@ -30,7 +36,7 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['prettier', 'react', 'cypress', '@typescript-eslint', 'no-only-tests'],
plugins: ['prettier', 'react', 'cypress', '@typescript-eslint', 'no-only-tests', 'jest'],
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-debugger': 'error',
Expand Down Expand Up @@ -168,11 +174,30 @@ module.exports = {
element: 'Collapse',
message: 'use <LemonCollapse> instead',
},
{
element:'MonacoEditor',
message: 'use <CodeEditor> instead',
}
],
},
],
'no-constant-condition': 0,
'no-prototype-builtins': 0,
'no-irregular-whitespace': 0,
},
overrides: [
{
files: ['**/test/**/*', '**/*.test.*'],
env: {
...env,
node: true,
'jest/globals': true,
},
globals: {
...globals,
given: 'readonly',
},
},
{
// disable these rules for files generated by kea-typegen
files: ['*Type.ts', '*Type.tsx'],
Expand Down
59 changes: 30 additions & 29 deletions .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,27 @@ runs:
run: echo "127.0.0.1 kafka" | sudo tee -a /etc/hosts

- name: Set up Python
id: python
uses: buildjet/setup-python@v4
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
token: ${{ inputs.token }}
cache: pip

- name: Install SAML (python3-saml) dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl
if: steps.python.outputs.cache-hit != 'true'
- uses: syphar/restore-virtualenv@v1
id: cache-backend-tests
with:
custom_cache_key_element: v1

- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-backend-tests.outputs.cache-hit != 'true'

- name: Install python dependencies
if: steps.cache-backend-tests.outputs.cache-hit != 'true'
shell: bash
run: |
python -m pip install -r requirements-dev.txt
Expand Down Expand Up @@ -97,13 +103,29 @@ runs:
PERSON_ON_EVENTS_V2_ENABLED: ${{ inputs.person-on-events }}
GROUPS_ON_EVENTS_ENABLED: ${{ inputs.person-on-events }}
shell: bash
run: | # async_migrations are covered in ci-async-migrations.yml
pytest hogvm posthog -m "not async_migrations" \
run: | # async_migrations covered in ci-async-migrations.yml
pytest ${{
inputs.person-on-events == 'true'
&& './posthog/clickhouse/ ./posthog/hogql/ ./posthog/queries/ ./posthog/api/test/test_insight* ./posthog/api/test/dashboards/test_dashboard.py'
|| 'hogvm posthog'
}} -m "not async_migrations" \
--splits ${{ inputs.concurrency }} --group ${{ inputs.group }} \
--durations=100 --durations-min=1.0 \
$PYTEST_ARGS
- name: Run EE tests
if: ${{ inputs.segment == 'EE' }}
env:
PERSON_ON_EVENTS_V2_ENABLED: ${{ inputs.person-on-events }}
GROUPS_ON_EVENTS_ENABLED: ${{ inputs.person-on-events }}
shell: bash
run: | # async_migrations covered in ci-async-migrations.yml
pytest ${{ inputs.person-on-events == 'true' && 'ee/clickhouse/' || 'ee/' }} -m "not async_migrations" \
--splits ${{ inputs.concurrency }} --group ${{ inputs.group }} \
--durations=100 --durations-min=1.0 --store-durations \
--durations=100 --durations-min=1.0 \
$PYTEST_ARGS
- name: Run Decide read replica tests
- name: Run /decide read replica tests
if: ${{ inputs.segment == 'FOSS' && inputs.group == 1 && inputs.person-on-events != 'true' }}
env:
POSTHOG_DB_NAME: posthog
Expand All @@ -116,24 +138,3 @@ runs:
pytest posthog/api/test/test_decide.py::TestDecideUsesReadReplica \
--durations=100 --durations-min=1.0 \
$PYTEST_ARGS
- name: Run EE tests
if: ${{ inputs.segment == 'EE' }}
env:
PERSON_ON_EVENTS_V2_ENABLED: ${{ inputs.person-on-events }}
GROUPS_ON_EVENTS_ENABLED: ${{ inputs.person-on-events }}
shell: bash
run: | # async_migrations are covered in ci-async-migrations.yml
pytest ee -m "not async_migrations" \
--splits ${{ inputs.concurrency }} --group ${{ inputs.group }} \
--durations=100 --durations-min=1.0 --store-durations \
$PYTEST_ARGS
# Post-tests

- name: Upload updated timing data as artifacts
uses: actions/upload-artifact@v2
if: ${{ inputs.segment == 'EE' && inputs.person-on-events != 'true'}}
with:
name: timing_data-${{ inputs.group }}
path: .test_durations
3 changes: 2 additions & 1 deletion .run/PostHog.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
<env name="KAFKA_HOSTS" value="localhost" />
<env name="KEA_VERBOSE_LOGGING" value="false" />
<env name="PRINT_SQL" value="1" />
<env name="PYDEVD_USE_CYTHON" value="NO" />
<env name="PYTHONUNBUFFERED" value="1" />
<env name="SESSION_RECORDING_KAFKA_COMPRESSION" value="gzip" />
<env name="SESSION_RECORDING_KAFKA_HOSTS" value="localhost" />
<env name="SESSION_RECORDING_KAFKA_MAX_REQUEST_SIZE_BYTES" value="524288" />
<env name="SKIP_SERVICE_VERSION_REQUIREMENTS" value="1" />
<env name="PYDEVD_USE_CYTHON" value="NO" />
<env name="REPLAY_EVENTS_NEW_CONSUMER_RATIO" value="1" />
</envs>
<option name="SDK_HOME" value="$PROJECT_DIR$/env/bin/python" />
<option name="SDK_NAME" value="Python 3.10 (posthog)" />
Expand Down
38 changes: 16 additions & 22 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import type { StorybookConfig } from '@storybook/react/types'
import { createEntry } from '../webpack.config'
import { StorybookConfig } from '@storybook/react-webpack5'

const config: StorybookConfig = {
stories: ['../frontend/src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],

addons: [
{
name: '@storybook/addon-docs',
options: {
sourceLoaderOptions: {
injectStoryParameters: false,
},
},
},
'@storybook/addon-docs',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-storysource',
'@storybook/addon-a11y',
'storybook-addon-pseudo-states',
],

staticDirs: ['public'],

webpackFinal: (config) => {
const mainConfig = createEntry('main')
return {
Expand All @@ -32,23 +28,21 @@ const config: StorybookConfig = {
...config.module,
rules: [
...mainConfig.module.rules,
...config.module!.rules.filter((rule) => rule.test!.toString().includes('.mdx')),
{
test: /\.stories\.tsx?$/,
use: [
{
loader: require.resolve('@storybook/source-loader'),
options: { parser: 'typescript' },
},
],
enforce: 'pre',
},
...(config.module?.rules?.filter(
(rule: any) => 'test' in rule && rule.test.toString().includes('.mdx')
) ?? []),
],
},
}
},
features: {
postcss: false,

framework: {
name: '@storybook/react-webpack5',
options: {},
},

docs: {
autodocs: 'tag',
},
}

Expand Down
29 changes: 28 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '~/styles'
import './storybook.scss'
import type { Meta, Parameters } from '@storybook/react'
import type { Meta, Parameters, Preview } from '@storybook/react'
import { Title, Subtitle, Description, Primary, Controls, Stories } from '@storybook/blocks'
import { worker } from '~/mocks/browser'
import { loadPostHogJS } from '~/loadPostHogJS'
import { getStorybookAppContext } from './app-context'
Expand Down Expand Up @@ -75,3 +76,29 @@ export const decorators: Meta['decorators'] = [
// Allow us to easily set feature flags in stories.
withFeatureFlags,
]

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
docs: {
page: () => (
<>
<Title />
<Subtitle />
<Description />
<Primary />
<Controls />
<Stories />
</>
),
},
},
}

export default preview
Loading

0 comments on commit 3ae45f5

Please sign in to comment.