Skip to content

Commit

Permalink
Merge branch 'master' into feature/celery-queue-configure
Browse files Browse the repository at this point in the history
# Conflicts:
#	requirements.txt
  • Loading branch information
webjunkie committed Jan 8, 2024
2 parents c2c054a + e3a3138 commit 5853227
Show file tree
Hide file tree
Showing 2,953 changed files with 36,381 additions and 17,071 deletions.
36 changes: 8 additions & 28 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,14 @@ module.exports = {
'plugin:eslint-comments/recommended',
'plugin:storybook/recommended',
'plugin:compat/recommended',
'prettier',
'prettier', // Disables any formatting rules to let prettier do its job
],
globals,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
project: 'tsconfig.json',
},
plugins: [
'prettier',
'react',
'cypress',
'@typescript-eslint',
Expand Down Expand Up @@ -120,19 +114,14 @@ module.exports = {
},
{
name: 'antd',
importNames: ['Tooltip'],
message: 'Please use Tooltip from @posthog/lemon-ui instead.',
},
{
name: 'antd',
importNames: ['Alert'],
message: 'Please use LemonBanner from @posthog/lemon-ui instead.',
importNames: ['Card', 'Col', 'Row', 'Alert', 'Tooltip'],
message: 'please use the Lemon equivalent instead',
},
],
},
],
'react/forbid-dom-props': [
'warn',
'error',
{
forbid: [
{
Expand All @@ -147,23 +136,10 @@ module.exports = {
'warn',
{
forbid: [
{
element: 'Row',
message:
'use flex utility classes instead, e.g. <Row align="middle"> could be <div className="flex items-center">',
},
{
element: 'Col',
message: 'use flex utility classes instead - most of the time can simply be a plain <div>',
},
{
element: 'Divider',
message: 'use <LemonDivider> instead',
},
{
element: 'Card',
message: 'use utility classes instead',
},
{
element: 'Button',
message: 'use <LemonButton> instead',
Expand Down Expand Up @@ -215,6 +191,10 @@ module.exports = {
element: 'Badge',
message: 'use LemonBadge instead',
},
{
element: 'InputNumber',
message: 'use LemonInput with type="number" instead',
},
{
element: 'Collapse',
message: 'use <LemonCollapse> instead',
Expand Down
16 changes: 0 additions & 16 deletions .github/actions/build-n-cache-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ outputs:
build-id:
description: The ID of the build
value: ${{ steps.build.outputs.build-id }}
unit-build-id:
description: The ID of the unit build
value: ${{ steps.build-unit.outputs.build-id }}

runs:
using: 'composite'
Expand All @@ -42,16 +39,3 @@ runs:
save: ${{ inputs.save }}
env:
ACTIONS_ID_TOKEN_REQUEST_URL: ${{ inputs.actions-id-token-request-url }}

- name: Build unit image
id: build-unit
uses: depot/build-push-action@v1
with:
buildx-fallback: false # buildx is so slow it's better to just fail
file: production-unit.Dockerfile
tags: posthog/posthog:unit-${{ github.sha }}
platforms: linux/amd64,linux/arm64
build-args: COMMIT_HASH=${{ github.sha }}
save: ${{ inputs.save }}
env:
ACTIONS_ID_TOKEN_REQUEST_URL: ${{ inputs.actions-id-token-request-url }}
9 changes: 4 additions & 5 deletions .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ runs:
run: echo "127.0.0.1 kafka" | sudo tee -a /etc/hosts

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: pip
cache-dependency-path: '**/requirements*.txt'
token: ${{ inputs.token }}

- name: Determine if hogql-parser has changed compared to master
Expand All @@ -70,7 +72,7 @@ runs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 18.12.1
cache: pnpm

- name: Install plugin-transpiler
Expand All @@ -85,9 +87,6 @@ runs:
with:
custom_cache_key_element: v2

- 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
Expand Down
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: weekly
39 changes: 32 additions & 7 deletions .github/pr-deploy/hobby.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ spec:
imagePullPolicy: Always
securityContext:
privileged: true
resources:
requests:
cpu: 250m
memory: 500M
ports:
- containerPort: 2375
- containerPort: 80
Expand All @@ -28,23 +32,44 @@ spec:
value: $REGISTRY_URL
- name: DOCKER_TAG
value: $DOCKER_TAG
- name: SUBDOMAIN
value: $HOSTNAME

---
apiVersion: v1
kind: Service
metadata:
name: hobby-service-$HOSTNAME
annotations:
tailscale.com/expose: "true"
tailscale.com/hostname: hobby-$HOSTNAME
tailscale.com/tags: tag:service
finalizers:
- tailscale.com/finalizer
spec:
selector:
app: hobby-$HOSTNAME
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
type: NodePort

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hobby-ingress-$HOSTNAME
annotations:
kubernetes.io/ingress.class: "alb"
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
alb.ingress.kubernetes.io/ssl-redirect: '443'
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:169684386827:certificate/698851fd-36de-4d28-8d75-cb75cc7a92f2
external-dns.alpha.kubernetes.io/hostname: $HOSTNAME.dev.posthog.dev
spec:
ingressClassName: alb
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hobby-service-$HOSTNAME
port:
number: 80
9 changes: 4 additions & 5 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,16 @@ jobs:
docker compose -f docker-compose.dev.yml up -d
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.10.10
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
id: cache-benchmark-tests

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

- name: Install SAML (python3-saml) dependencies
shell: bash
run: |
Expand Down Expand Up @@ -137,7 +136,7 @@ jobs:

- name: Find Comment
if: ${{ github.event_name == 'pull_request' }}
uses: peter-evans/find-comment@v1
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.number }}
Expand Down
33 changes: 18 additions & 15 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,18 @@ jobs:
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.10.10
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
id: cache-backend-tests
with:
custom_cache_key_element: v2-

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

- name: Install SAML (python3-saml) dependencies
run: |
sudo apt-get update
Expand Down Expand Up @@ -181,19 +180,18 @@ jobs:
docker compose -f docker-compose.dev.yml up -d
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.10.10
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- 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 SAML (python3-saml) dependencies
run: |
sudo apt-get update
Expand Down Expand Up @@ -240,7 +238,8 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.10.10']
clickhouse-server-image: ['clickhouse/clickhouse-server:23.6.1.1524']
clickhouse-server-image:
['clickhouse/clickhouse-server:23.6.1.1524', 'clickhouse/clickhouse-server:23.11.2.11-alpine']
segment: ['FOSS', 'EE']
person-on-events: [false, true]
# :NOTE: Keep concurrency and groups in sync
Expand Down Expand Up @@ -308,8 +307,13 @@ jobs:
retention-days: 5

async-migrations:
name: Async migrations tests
name: Async migrations tests - ${{ matrix.clickhouse-server-image }}
needs: changes
strategy:
fail-fast: false
matrix:
clickhouse-server-image:
['clickhouse/clickhouse-server:23.6.1.1524', 'clickhouse/clickhouse-server:23.11.2.11-alpine']
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
steps:
Expand All @@ -320,24 +324,23 @@ jobs:

- name: Start stack with Docker Compose
run: |
export CLICKHOUSE_SERVER_IMAGE_VERSION=${{ inputs.clickhouse-server-image-version }}
export CLICKHOUSE_SERVER_IMAGE_VERSION=${{ matrix.clickhouse-server-image }}
docker compose -f docker-compose.dev.yml down
docker compose -f docker-compose.dev.yml up -d
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.10.10
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
id: cache-backend-tests
with:
custom_cache_key_element: v2-

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

- name: Install SAML (python3-saml) dependencies
run: |
sudo apt-get update
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ jobs:
outputs:
tag: ${{ steps.build.outputs.tag }}
build-id: ${{ steps.build.outputs.build-id }}
unit-build-id: ${{ steps.build.outputs.unit-build-id }}
steps:
- name: Checkout
if: needs.changes.outputs.shouldTriggerCypress == 'true'
Expand Down Expand Up @@ -124,7 +123,7 @@ jobs:
if: needs.changes.outputs.shouldTriggerCypress == 'true'
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 18.12.1

- name: Get pnpm cache directory path
if: needs.changes.outputs.shouldTriggerCypress == 'true'
Expand Down Expand Up @@ -171,7 +170,7 @@ jobs:
if: needs.changes.outputs.shouldTriggerCypress == 'true'
uses: depot/pull-action@v1
with:
build-id: ${{ needs.container.outputs.unit-build-id }}
build-id: ${{ needs.container.outputs.build-id }}
tags: ${{ needs.container.outputs.tag }}

- name: Write .env # This step intentionally has no if, so that GH always considers the action as having run
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
filters: |
frontend:
# Avoid running frontend tests for irrelevant changes
# NOTE: we are at risk of missing a dependency here.
# NOTE: we are at risk of missing a dependency here.
- 'bin/**'
- 'frontend/**'
- 'ee/frontend/**'
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
if: needs.changes.outputs.frontend == 'true'
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 18.12.1

- name: Get pnpm cache directory path
if: needs.changes.outputs.frontend == 'true'
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
if: needs.changes.outputs.frontend == 'true'
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 18.12.1
cache: pnpm

- name: Install package.json dependencies with pnpm
Expand Down
Loading

0 comments on commit 5853227

Please sign in to comment.