:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(ci): purge blacksmith from ci (#57991)
Georges-Antoine Assi874b6a197d56
diff --git a/.agents/skills/debugging-ci-failures/SKILL.md b/.agents/skills/debugging-ci-failures/SKILL.mdindex 1df19cc26344..28266abb209d 100644--- a/.agents/skills/debugging-ci-failures/SKILL.md+++ b/.agents/skills/debugging-ci-failures/SKILL.md@@ -117,9 +117,6 @@ Do NOT run `hogli test` with no arguments. Do NOT run `hogli nuke` orthat agents can query in this environment.- If a job fails before `Checkout` completes (no app code ran), classify as`infra / runner`. Do not propose code fixes.-- Shadow workflows are non-blocking even when red. Known shadows:- `ci-blacksmith-shadow.yml`, `ci-test-selection-shadow.yml`. Call this out- explicitly in the report so the user does not chase a non-blocker.- PostHog CI frequently parallelizes the same test class across N shards(`backend-tests (3/10)` style). Reproduce from the specific failing testpath, not the shard index.diff --git a/.github/scripts/compare-ci-runners.py b/.github/scripts/compare-ci-runners.pyindex 8abeb6b3ea85..517195acd7be 100755--- a/.github/scripts/compare-ci-runners.py+++ b/.github/scripts/compare-ci-runners.py@@ -1,5 +1,10 @@#!/usr/bin/env python3# ruff: noqa: T201 print is the intended output of this CLI+#+# THIS SCRIPT IS NO LONGER USED!+# The Blacksmith trial period is over and we no longer run Blacksmith+# runners alongside Depot, so there is nothing to pair.+## Pair Depot and Blacksmith job durations for the 7-day CI trial.## Usage:@@ -46,7 +51,6 @@ WORKFLOWS = ["ci-rust-flags-integration.yml","ci-rust.yml","ci-storybook.yml",- "ci-blacksmith-shadow.yml",]# Matches a runner label at the end of a job name, either alone in trailing parensdiff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.ymlindex 56085a648f9b..ce239d206474 100644--- a/.github/workflows/ci-backend.yml+++ b/.github/workflows/ci-backend.yml@@ -516,13 +516,8 @@ jobs:needs: [changes]if: needs.changes.outputs.backend == 'true'timeout-minutes: 10- name: Repo checks (${{ matrix.runner }})- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false},{"runner":"blacksmith-2vcpu-ubuntu-2404","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ name: Repo checks (depot-ubuntu-latest)+ runs-on: depot-ubuntu-lateststeps:- uses: actions/checkout@v6@@ -1874,13 +1869,12 @@ jobs:retention-days: 90async-migrations:- name: Async migrations tests - ${{ matrix.clickhouse-server-image }} (${{ matrix.runner }})+ name: Async migrations tests - ${{ matrix.clickhouse-server-image }} (depot-ubuntu-latest)needs: [changes, turbo-discover, get_clickhouse_versions]strategy:fail-fast: falsematrix:clickhouse-server-image: ${{ fromJson(needs.get_clickhouse_versions.outputs.oldest_supported) }}- runner: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('["depot-ubuntu-latest","blacksmith-2vcpu-ubuntu-2404"]') || fromJson('["depot-ubuntu-latest"]') }}# Run if legacy code changed, product changes affect legacy, or turbo-discover failedif: |always() &&@@ -1888,8 +1882,7 @@ jobs:(needs.changes.outputs.legacy == 'true' ||needs.turbo-discover.outputs.run_legacy == 'true' ||(needs.turbo-discover.result != 'success' && needs.turbo-discover.result != 'skipped'))- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ startsWith(matrix.runner, 'blacksmith') }}+ runs-on: depot-ubuntu-latesttimeout-minutes: 30steps:- name: 'Checkout repo'@@ -1976,7 +1969,7 @@ jobs:- name: Upload test resultsuses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0- if: always() && !startsWith(matrix.runner, 'blacksmith')+ if: always()with:name: junit-results-async-migrationspath: junit.xmldiff --git a/.github/workflows/ci-blacksmith-shadow.yml b/.github/workflows/ci-blacksmith-shadow.ymldeleted file mode 100644index 725d772328d1..000000000000--- a/.github/workflows/ci-blacksmith-shadow.yml+++ /dev/null@@ -1,379 +0,0 @@-# Blacksmith shadow jobs for Depot-labeled CI jobs that are too complex to matrix-expand-# in-place (dynamic matrices, many side effects, etc.). Remove this whole file at end of trial.-#-# Gated by repo variable BLACKSMITH_SHADOW_ENABLED (Settings → Variables → Actions → Variables).-# All jobs:-# - run with continue-on-error: true-# - strip side effects (no artifact uploads, no PR comments, no commits, no snapshot patches)-# - use trimmed matrices where the original has dynamic fan-out-# - NOT referenced by any `needs:` list or branch-protection status check-#-# Pairs with same-SHA Depot runs in ci-backend.yml.-# Use compare-ci-runners.py to produce the apples-to-apples comparison report.--name: Blacksmith Shadow--on:- pull_request:- push:- branches:- - master- merge_group:--concurrency:- group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}- cancel-in-progress: ${{ github.event_name == 'pull_request' }}--env:- SECRET_KEY: '6b01eee4f945ca25045b5aab440b953461faf08693a9abbf1166dc7c6b9772da' # unsafe - for testing only- DATABASE_URL: 'postgres://posthog:posthog@localhost:5432/posthog'- REDIS_URL: 'redis://localhost'- CLICKHOUSE_HOST: 'localhost'- CLICKHOUSE_SECURE: 'False'- CLICKHOUSE_VERIFY: 'False'- TEST: 1- OBJECT_STORAGE_ENABLED: 'True'- OBJECT_STORAGE_ENDPOINT: 'http://localhost:19000'- OBJECT_STORAGE_ACCESS_KEY_ID: 'object_storage_root_user'- OBJECT_STORAGE_SECRET_ACCESS_KEY: 'object_storage_root_password'- UV_HTTP_TIMEOUT: 120- DISPLAY: ':99.0'- OIDC_RSA_PRIVATE_KEY: ${{ vars.OIDC_RSA_FAKE_PRIVATE_KEY }}- RUNS_ON_INTERNAL_PR: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }}- SANDBOX_JWT_PRIVATE_KEY: ${{ vars.OIDC_RSA_FAKE_PRIVATE_KEY }}--permissions:- contents: read--jobs:- # Paper shadow: even though ubuntu-latest is free, we need ONE place that detects paths- # so shadow jobs know whether to run. Mirrors the change detection in ci-backend.yml.- changes:- runs-on: ubuntu-latest- timeout-minutes: 5- if: vars.BLACKSMITH_SHADOW_ENABLED == 'true'- outputs:- backend: ${{ steps.filter.outputs.backend }}- steps:- - uses: actions/checkout@v6- - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1- id: app-token- if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository- with:- client-id: ${{ secrets.GH_APP_POSTHOG_PATHS_FILTER_APP_ID }}- private-key: ${{ secrets.GH_APP_POSTHOG_PATHS_FILTER_PRIVATE_KEY }}- - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1- id: filter- with:- token: ${{ steps.app-token.outputs.token || github.token }}- filters: |- backend:- # Avoid running backend tests for irrelevant changes- # NOTE: we are at risk of missing a dependency here. We could make- # the dependencies more clear if we separated the backend/frontend- # code completely- # really we should ignore ee/frontend/** but dorny doesn't support that- # - '!ee/frontend/**'- # including the negated rule appears to work- # but makes it always match because the checked file always isn't `ee/frontend/**` 🙈- - 'ee/**/*'- - 'common/__init__.py'- - 'tools/hogli/**'- - 'tools/hogli-commands/**'- - 'common/hogql_parser/**'- - 'common/hogvm/**'- - 'common/ingestion/**'- - 'common/migration_utils/**'- - 'common/plugin_transpiler/**'- - 'posthog/**/*'- - 'products/**/backend/**/*'- - bin/build-schema-latest-versions.py- - bin/build-taxonomy-json.py- - bin/check_uv_python_compatibility.py- - bin/find_python_dependencies.py- - bin/unit_metrics.py- - pyproject.toml- - uv.lock- - requirements.txt- - requirements-dev.txt- - mypy.ini- - pytest.ini- - .test_durations # Used for pytest-split sharding- # generates posthog/schema.py- - frontend/src/queries/schema.json- # Operator parity check- - rust/feature-flags/src/properties/property_models.rs- - frontend/src/products.json # Loaded at runtime by posthog/products.py- - 'products/*/manifest.tsx' # Generates products.json- # Make sure we run if someone is explicitly changing the workflow- - .github/workflows/ci-backend.yml- - .github/clickhouse-versions.json- # We use docker compose for tests, make sure we rerun on- # changes to docker-compose.dev.yml e.g. dependency- # version changes- - docker-compose.dev.yml- - docker-compose.profiles.yml- - docker-compose.base.yml- - bin/wait-for-docker- - bin/ci-wait-for-docker- - frontend/public/email/*- - 'docker/clickhouse/**'-- # --- turbo-discover-shadow ---- # Original: ci-backend.yml turbo-discover (depot-ubuntu-latest). Has outputs.- # Shadow is measurement-only — drops outputs.- turbo-discover-shadow:- name: Discover product tests (blacksmith shadow)- needs: changes- if: needs.changes.outputs.backend == 'true'- runs-on: blacksmith-2vcpu-ubuntu-2404- continue-on-error: true- timeout-minutes: 20- steps:- - uses: actions/checkout@v6- - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0- - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0- with:- node-version-file: .nvmrc- cache: pnpm- cache-dependency-path: |- pnpm-lock.yaml- .github/workflows/ci-backend.yml- - run: pnpm install --frozen-lockfile --filter=@posthog/root- - name: Discover products to test- env:- LEGACY_CHANGED: ${{ github.event_name != 'pull_request' || needs.changes.outputs.backend }}- run: node .github/scripts/turbo-discover.js-- # --- turbo-tests-shadow ---- # Original: ci-backend.yml turbo-tests — matrix via fromJson. Shadow runs a minimal single group- # to measure end-to-end turbo-backed product test timing on blacksmith.- turbo-tests-shadow:- name: Product tests (blacksmith shadow)- needs: changes- if: needs.changes.outputs.backend == 'true'- runs-on: blacksmith-2vcpu-ubuntu-2404- continue-on-error: true- timeout-minutes: 30- steps:- - uses: actions/checkout@v6- - run: |- [ -d "data" ] && docker run --rm -v "$(pwd)/data:/data" alpine sh -c "rm -rf /data/seaweedfs /data/minio" || true- continue-on-error: true- - name: Start services- env:- COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml- COMPOSE_PROFILES: temporal,azure- CLICKHOUSE_SERVER_IMAGE: clickhouse/clickhouse-server:26.3.9.8- run: |- cp posthog/user_scripts/latest_user_defined_function.xml docker/clickhouse/user_defined_function.xml- bin/ci-wait-for-docker launch --background --down db redis7 clickhouse zookeeper kafka objectstorage feature-flags temporal elasticsearch objectstorage-azure- - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0- - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0- with:- node-version-file: .nvmrc- cache: pnpm- cache-dependency-path: |- pnpm-lock.yaml- .github/workflows/ci-backend.yml- - run: pnpm install --frozen-lockfile --filter=@posthog/root- - uses: actions/setup-python@v6- with:- python-version: 3.12.12- - id: setup-uv- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0- with:- version: '0.10.2'- enable-cache: true- cache-dependency-glob: uv.lock- save-cache: false # shadow never saves cache- - if: steps.setup-uv.outputs.cache-hit != 'true'- run: sudo apt-get update && sudo apt-get install -y libxml2-dev libxmlsec1-dev libxmlsec1-openssl- - uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e- with:- toolchain: 1.91.1- components: cargo- - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1- with:- shared-key: 'v2-rust-backend-blacksmith' # separate key from depot- workspaces: rust- save-if: false- - uses: ./.github/actions/setup-sqlx-cli- - run: UV_PROJECT_ENVIRONMENT=$pythonLocation uv sync --frozen --dev- - run: echo "127.0.0.1 db redis7 kafka clickhouse clickhouse-coordinator objectstorage temporal" | sudo tee -a /etc/hosts- - run: |- mkdir -p frontend/dist- touch frontend/dist/index.html frontend/dist/layout.html frontend/dist/exporter.html- ./bin/download-mmdb- - name: Wait for Docker services- env:- COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml- COMPOSE_PROFILES: temporal,azure- CLICKHOUSE_SERVER_IMAGE: clickhouse/clickhouse-server:26.3.9.8- run: bin/ci-wait-for-docker wait- - name: Register Temporal search attributes- run: |- bin/wait-for-docker temporal- python manage.py register_temporal_search_attributes- # Run one representative product's tests via turbo (pick a small/medium one).- # This doesn't match every PR's matrix but gives runner timing signal.- - name: Run a representative product test- env:- PYTEST_ADDOPTS: --reuse-db- run: pnpm turbo run backend:test --concurrency=1 --output-logs=full --force --log-order=stream --filter='@posthog/products-data-warehouse'-- # --- check-migrations-shadow ---- # Original: ci-backend.yml check-migrations — complex single-shot with many PR side effects.- # Shadow runs the same migration/OpenAPI checks but skips: PR comments, migration risk analysis,- # OpenAPI commit, artifact uploads.- check-migrations-shadow:- name: Validate migrations & OpenAPI types (blacksmith shadow)- needs: changes- if: needs.changes.outputs.backend == 'true'- runs-on: blacksmith-2vcpu-ubuntu-2404- continue-on-error: true- timeout-minutes: 20- steps:- - uses: actions/checkout@v6- with:- clean: false- - run: |- [ -d "data" ] && docker run --rm -v "$(pwd)/data:/data" alpine sh -c "rm -rf /data/seaweedfs /data/minio" || true- continue-on-error: true- - name: Stop/Start stack with Docker Compose- env:- COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml- COMPOSE_PROFILES: temporal,azure- run: bin/ci-wait-for-docker launch --background --down- - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0- with:- python-version: 3.12.12- - id: setup-uv- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0- with:- version: '0.10.2'- enable-cache: true- cache-dependency-glob: uv.lock- save-cache: false- - if: steps.setup-uv.outputs.cache-hit != 'true'- run: sudo apt-get update && sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl- - uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e- with:- toolchain: 1.91.1- components: cargo- - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1- with:- shared-key: 'v2-rust-backend-blacksmith'- workspaces: rust- save-if: false- - uses: ./.github/actions/setup-sqlx-cli- - run: UV_PROJECT_ENVIRONMENT=$pythonLocation uv sync --frozen --dev- - name: Wait for Docker services- env:- COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml- COMPOSE_PROFILES: temporal,azure- run: bin/ci-wait-for-docker wait- - name: Run migrations- run: |- python manage.py migrate- DATABASE_URL="postgres://posthog:posthog@localhost:5432/posthog_persons" sqlx migrate run --source rust/persons_migrations/- - name: Check migrations (no PR comment)- if: github.event_name != 'push'- run: |- DATABASE_URL="postgres://posthog:posthog@localhost:5432/posthog_persons" sqlx migrate info --source rust/persons_migrations/- python manage.py makemigrations --check --dry-run- - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0- - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0- with:- node-version-file: .nvmrc- cache: pnpm- cache-dependency-path: |- pnpm-lock.yaml- .github/workflows/ci-backend.yml- - run: pnpm --filter=@posthog/root --filter=@posthog/frontend... --filter=@posthog/mcp... install --frozen-lockfile- - name: Build OpenAPI types (no commit)- run: |- ./bin/hogli build:openapi- pnpm --filter=@posthog/mcp run scaffold-yaml -- --sync-all-- # --- django-shadow ---- # Original: ci-backend.yml django — dynamic matrix of Python × ClickHouse × segment × shard.- # Shadow runs ONE hardcoded shard to measure core pytest timing on blacksmith.- django-shadow:- name: Django tests (blacksmith shadow, core 1/5)- needs: changes- if: needs.changes.outputs.backend == 'true'- runs-on: blacksmith-2vcpu-ubuntu-2404- continue-on-error: true- timeout-minutes: 30- steps:- - uses: actions/checkout@v6- with:- fetch-depth: 1- lfs: true- clean: false- - run: |- [ -d "data" ] && docker run --rm -v "$(pwd)/data:/data" alpine sh -c "rm -rf /data/seaweedfs /data/minio" || true- continue-on-error: true- - name: Stop/Start stack with Docker Compose- env:- COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml- COMPOSE_PROFILES: temporal,azure- CLICKHOUSE_SERVER_IMAGE: clickhouse/clickhouse-server:24.8- WAIT_FOR_DOCKER_LAUNCH_RETRIES: 3- WAIT_FOR_DOCKER_LAUNCH_RETRY_DELAY: 5- run: |- cp posthog/user_scripts/latest_user_defined_function.xml docker/clickhouse/user_defined_function.xml- bin/ci-wait-for-docker launch --background --down-all-profiles- - run: echo "127.0.0.1 db redis7 kafka clickhouse clickhouse-coordinator objectstorage seaweedfs temporal" | sudo tee -a /etc/hosts- - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0- with:- python-version: 3.12.12- - id: setup-uv- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0- with:- version: '0.10.2'- enable-cache: true- cache-dependency-glob: uv.lock- save-cache: false- - if: steps.setup-uv.outputs.cache-hit != 'true'- run: sudo apt-get update && sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl- - uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e- with:- toolchain: 1.91.1- components: cargo- - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1- with:- shared-key: 'v2-rust-backend-blacksmith'- workspaces: rust- save-if: false- - uses: ./.github/actions/setup-sqlx-cli- - uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 # v1.6.0- with:- packages: libegl1 libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 x11-utils libxcb-cursor0 libopengl0- version: 1.0- - run: UV_PROJECT_ENVIRONMENT=$pythonLocation uv sync --frozen --dev- - run: |- mkdir -p frontend/dist- touch frontend/dist/index.html frontend/dist/layout.html frontend/dist/exporter.html- ./bin/download-mmdb- - name: Wait for Docker services- env:- COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml- COMPOSE_PROFILES: temporal,azure- CLICKHOUSE_SERVER_IMAGE: clickhouse/clickhouse-server:24.8- run: bin/ci-wait-for-docker wait- - name: Run Core tests (shard 1/5)- run: |- set +e- pytest -v --tb=short posthog ee/ -m "not async_migrations" \- --ignore=posthog/temporal \- --ignore=posthog/dags \- --ignore=common/hogvm/python/test \- --splits 5 --group 1 \- --durations=100 --durations-min=1.0 \- --splitting-algorithm=duration_based_chunks \- --reruns 2 --reruns-delay 1 \- -r fEsxX- exit_code=$?- [ $exit_code -eq 5 ] && exit 0 || exit $exit_codediff --git a/.github/workflows/ci-mcp.yml b/.github/workflows/ci-mcp.ymlindex 7b9e4c08dd36..c7ac2ee0b87d 100644--- a/.github/workflows/ci-mcp.yml+++ b/.github/workflows/ci-mcp.yml@@ -227,13 +227,8 @@ jobs:if-no-files-found: ignoreintegration-tests:- name: Integration Tests (${{ matrix.runner }})- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-latest-4","is_shadow":false},{"runner":"blacksmith-4vcpu-ubuntu-2404","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-latest-4","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ name: Integration Tests (depot-ubuntu-latest-4)+ runs-on: depot-ubuntu-latest-4needs: changestimeout-minutes: 30if: needs.changes.outputs.mcp == 'true'diff --git a/.github/workflows/ci-nodejs.yml b/.github/workflows/ci-nodejs.ymlindex e767e5561af3..a4b53eb1dc2a 100644--- a/.github/workflows/ci-nodejs.yml+++ b/.github/workflows/ci-nodejs.yml@@ -64,14 +64,9 @@ jobs:lint:if: needs.changes.outputs.nodejs == 'true'- name: Node.js Code quality (${{ matrix.runner }})+ name: Node.js Code quality (depot-ubuntu-latest)needs: changes- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false},{"runner":"blacksmith-2vcpu-ubuntu-2404","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ runs-on: depot-ubuntu-latesttimeout-minutes: 10steps:- uses: actions/checkout@v6@@ -110,14 +105,9 @@ jobs:build:if: needs.changes.outputs.nodejs == 'true'- name: Node.js Build (${{ matrix.runner }})+ name: Node.js Build (depot-ubuntu-latest)needs: changes- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false},{"runner":"blacksmith-2vcpu-ubuntu-2404","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ runs-on: depot-ubuntu-latesttimeout-minutes: 10steps:- uses: actions/checkout@v6@@ -164,17 +154,14 @@ jobs:tests:if: needs.changes.outputs.nodejs == 'true'- name: Node.js Tests ${{matrix.shard}}/3 (${{ matrix.runner }})+ name: Node.js Tests ${{matrix.shard}}/3 (depot-ubuntu-latest-4)needs: changes- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ runs-on: depot-ubuntu-latest-4timeout-minutes: 30 # We know tests don't take this long-strategy:fail-fast: falsematrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"shard":1,"runner":"depot-ubuntu-latest-4","is_shadow":false},{"shard":2,"runner":"depot-ubuntu-latest-4","is_shadow":false},{"shard":3,"runner":"depot-ubuntu-latest-4","is_shadow":false},{"shard":1,"runner":"blacksmith-4vcpu-ubuntu-2404","is_shadow":true},{"shard":2,"runner":"blacksmith-4vcpu-ubuntu-2404","is_shadow":true},{"shard":3,"runner":"blacksmith-4vcpu-ubuntu-2404","is_shadow":true}]') || fromJson('[{"shard":1,"runner":"depot-ubuntu-latest-4","is_shadow":false},{"shard":2,"runner":"depot-ubuntu-latest-4","is_shadow":false},{"shard":3,"runner":"depot-ubuntu-latest-4","is_shadow":false}]') }}-+ shard: [1, 2, 3]env:REDIS_URL: 'redis://localhost'CLICKHOUSE_HOST: 'localhost'@@ -222,8 +209,7 @@ jobs:version: '0.10.2' # pinned: unpinned setup-uv calls GH API on every job, exhausts rate limitenable-cache: truecache-dependency-glob: uv.lock- # Avoid cross-runner pollution: shadow restores but never saves- save-cache: ${{ github.ref == 'refs/heads/master' && !matrix.is_shadow }}+ save-cache: ${{ github.ref == 'refs/heads/master' }}- name: Install rustuses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e@@ -235,8 +221,7 @@ jobs:with:shared-key: 'v2-rust-backend'workspaces: rust- # Avoid cross-runner pollution: shadow restores but never saves- save-if: ${{ github.ref == 'refs/heads/master' && !matrix.is_shadow }}+ save-if: ${{ github.ref == 'refs/heads/master' }}- name: Install sqlx-cliworking-directory: rustdiff --git a/.github/workflows/ci-proto.yml b/.github/workflows/ci-proto.ymlindex 30e048cc84bd..94fc1451903e 100644--- a/.github/workflows/ci-proto.yml+++ b/.github/workflows/ci-proto.yml@@ -45,15 +45,10 @@ jobs:- '.github/workflows/ci-proto.yml'lint:- name: Lint proto definitions (${{ matrix.runner }})+ name: Lint proto definitions (depot-ubuntu-22.04-4)needs: changesif: needs.changes.outputs.proto == 'true'- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false},{"runner":"blacksmith-4vcpu-ubuntu-2204","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ runs-on: depot-ubuntu-22.04-4timeout-minutes: 5steps:@@ -71,15 +66,10 @@ jobs:run: buf lint proto/breaking:- name: Check for breaking changes (${{ matrix.runner }})+ name: Check for breaking changes (depot-ubuntu-22.04-4)needs: changesif: needs.changes.outputs.proto == 'true'- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false},{"runner":"blacksmith-4vcpu-ubuntu-2204","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ runs-on: depot-ubuntu-22.04-4timeout-minutes: 5steps:@@ -97,15 +87,10 @@ jobs:run: buf breaking proto/ --against 'https://github.com/PostHog/posthog.git#branch=master,subdir=proto'python-codegen:- name: Check Python proto stubs are up to date (${{ matrix.runner }})+ name: Check Python proto stubs are up to date (depot-ubuntu-22.04-4)needs: changesif: needs.changes.outputs.proto == 'true'- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false},{"runner":"blacksmith-4vcpu-ubuntu-2204","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ runs-on: depot-ubuntu-22.04-4timeout-minutes: 10steps:diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.ymlindex 228703142f91..7c0bce4b8701 100644--- a/.github/workflows/ci-python.yml+++ b/.github/workflows/ci-python.yml@@ -75,13 +75,8 @@ jobs:if: needs.changes.outputs.python == 'true'timeout-minutes: 30- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false},{"runner":"blacksmith-2vcpu-ubuntu-2404","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false}]') }}- name: Python code quality (${{ matrix.runner }})- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ name: Python code quality (depot-ubuntu-latest)+ runs-on: depot-ubuntu-lateststeps:- uses: actions/checkout@v6@@ -164,8 +159,7 @@ jobs:mypy --version && mypy --cache-fine-grained .- name: Save mypy cache- # Shadow restores the saved cache for apples-to-apples timing.- if: github.ref == 'refs/heads/master' && !matrix.is_shadow+ if: github.ref == 'refs/heads/master'uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5with:path: .mypy_cache@@ -193,7 +187,7 @@ jobs:- name: Upload test resultsuses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0- if: always() && !matrix.is_shadow+ if: always()with:name: junit-results-hoglipath: |@@ -207,7 +201,7 @@ jobs:- name: Upload test results for dependency detectionuses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0- if: always() && !matrix.is_shadow+ if: always()with:name: junit-results-dependency-detectionpath: junit-dependency-detection.xmldiff --git a/.github/workflows/ci-rust-flags-integration.yml b/.github/workflows/ci-rust-flags-integration.ymlindex f76ab9d8ee43..4c6caed4e83a 100644--- a/.github/workflows/ci-rust-flags-integration.yml+++ b/.github/workflows/ci-rust-flags-integration.yml@@ -40,13 +40,8 @@ env:jobs:rust-flags-integration:- name: Rust /flags Integration Tests (${{ matrix.runner }})- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false},{"runner":"blacksmith-2vcpu-ubuntu-2404","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ name: Rust /flags Integration Tests (depot-ubuntu-latest)+ runs-on: depot-ubuntu-latesttimeout-minutes: 30services:diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.ymlindex 3fceef1c0955..3ec56921f1fa 100644--- a/.github/workflows/ci-rust.yml+++ b/.github/workflows/ci-rust.yml@@ -141,15 +141,10 @@ jobs:f.write(f"matrix={json.dumps(matrix)}\n")build:- name: Build Rust services (${{ matrix.runner }})+ name: Build Rust services (depot-ubuntu-22.04-4)needs: changesif: needs.changes.outputs.rust == 'true'- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false},{"runner":"blacksmith-4vcpu-ubuntu-2204","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ runs-on: depot-ubuntu-22.04-4timeout-minutes: 15permissions:contents: read@@ -317,107 +312,11 @@ jobs:echo "::endgroup::"done- # Blacksmith shadow of `test` with a trimmed 2-package subset. Dynamic matrix above- # prevents matrix-expansion, so this is a separate shadow job. continue-on-error,- # no artifacts, not in rust_tests collate list.- test-blacksmith:- name: Test Rust (${{ matrix.packages }}) (blacksmith shadow)- needs: changes- if: needs.changes.outputs.rust == 'true' && vars.BLACKSMITH_SHADOW_ENABLED == 'true'- runs-on: blacksmith-4vcpu-ubuntu-2404- continue-on-error: true- timeout-minutes: 20- permissions:- contents: read- strategy:- fail-fast: false- matrix:- # Representative subset — feature-flags (241s, biggest) + common-hypercache (93s, medium).- # Widen if signal is noisy.- packages:- - feature-flags- - common-hypercache- defaults:- run:- working-directory: rust- steps:- - uses: actions/checkout@v6- with:- clean: false- - name: Clean up data directories with container permissions- working-directory: .- run: |- [ -d "data" ] && docker run --rm -v "$(pwd)/data:/data" alpine sh -c "rm -rf /data/seaweedfs /data/minio" || true- continue-on-error: true- - name: Setup main repo and dependencies- env:- COMPOSE_FILE: ../docker-compose.dev.yml:../docker-compose.profiles.yml- COMPOSE_PROFILES: etcd- WAIT_FOR_DOCKER_LAUNCH_RETRIES: 3- WAIT_FOR_DOCKER_LAUNCH_RETRY_DELAY: 10- run: |- ../bin/ci-wait-for-docker launch --down- ../bin/ci-wait-for-docker wait- echo "127.0.0.1 db redis7 kafka clickhouse clickhouse-coordinator objectstorage seaweedfs temporal" | sudo tee -a /etc/hosts- - name: Install rust- uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e- with:- toolchain: 1.91.1- - name: Install protoc- uses: ./.github/actions/setup-protoc- - name: Install sccache- uses: ./.github/actions/setup-sccache- - name: Set up Python- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0- with:- python-version-file: 'pyproject.toml'- - name: Install uv- id: setup-uv- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0- with:- version: '0.10.2'- enable-cache: true- cache-dependency-glob: uv.lock- save-cache: false # shadow never writes cache- - name: Install SAML deps- if: steps.setup-uv.outputs.cache-hit != 'true'- run: sudo apt-get update && sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl postgresql-client- - name: Install python dependencies- run: UV_PROJECT_ENVIRONMENT=$pythonLocation uv sync --frozen --dev --directory ..- - name: Install sqlx-cli- uses: ./.github/actions/setup-sqlx-cli- - name: Set up databases- env:- DEBUG: 'true'- TEST: 'true'- SECRET_KEY: 'abcdef'- DATABASE_URL: 'postgres://posthog:posthog@localhost:5432/posthog'- run: cd ../ && python manage.py setup_test_environment- - name: Run sqlx migrations- env:- DATABASE_URL: 'postgres://posthog:posthog@localhost:5432/posthog_persons'- run: |- sqlx migrate run --source persons_migrations/- DATABASE_URL='postgres://posthog:posthog@localhost:5432/test_posthog' sqlx migrate run --source behavioral_cohorts_migrations/- - name: Download MaxMind Database- run: cd ../ && ./bin/download-mmdb- - name: Run cargo test- env:- RUST_BACKTRACE: 1- PERSONS_READ_DATABASE_URL: ${{ contains(format(' {0} ', matrix.packages), ' feature-flags ') && 'postgres://posthog:posthog@localhost:5432/posthog_persons' || '' }}- PERSONS_WRITE_DATABASE_URL: ${{ contains(format(' {0} ', matrix.packages), ' feature-flags ') && 'postgres://posthog:posthog@localhost:5432/posthog_persons' || '' }}- run: cargo test -p "${{ matrix.packages }}"-linting:- name: Lint Rust services (${{ matrix.runner }})+ name: Lint Rust services (depot-ubuntu-22.04-4)needs: changesif: needs.changes.outputs.rust == 'true'- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false},{"runner":"blacksmith-4vcpu-ubuntu-2204","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-22.04-4","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ runs-on: depot-ubuntu-22.04-4timeout-minutes: 15permissions:contents: readdiff --git a/.github/workflows/ci-storybook.yml b/.github/workflows/ci-storybook.ymlindex 101e0a13962d..69cfc609141e 100644--- a/.github/workflows/ci-storybook.yml+++ b/.github/workflows/ci-storybook.yml@@ -99,13 +99,8 @@ jobs:echo "matrix=$MATRIX" >> $GITHUB_OUTPUTbuild-storybook:- name: Build Storybook (${{ matrix.runner }})- strategy:- fail-fast: false- matrix:- include: ${{ vars.BLACKSMITH_SHADOW_ENABLED == 'true' && fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false},{"runner":"blacksmith-2vcpu-ubuntu-2404","is_shadow":true}]') || fromJson('[{"runner":"depot-ubuntu-latest","is_shadow":false}]') }}- runs-on: ${{ matrix.runner }}- continue-on-error: ${{ matrix.is_shadow }}+ name: Build Storybook (depot-ubuntu-latest)+ runs-on: depot-ubuntu-latesttimeout-minutes: 15needs: changesif: needs.changes.outputs.frontend == 'true'@@ -148,16 +143,13 @@ jobs:pnpm --filter=@posthog/storybook build --test- name: Save webpack build cache- # Avoid cross-runner pollution- if: github.ref == 'refs/heads/master' && !matrix.is_shadow+ if: github.ref == 'refs/heads/master'uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5with:path: common/storybook/node_modules/.cache/key: ${{ runner.os }}-webpack-storybook-${{ hashFiles('pnpm-lock.yaml') }}- name: Upload Storybook build artifact- # Shadow skips upload, would conflict with storybook-build artifact name- if: ${{ !matrix.is_shadow }}uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0with:name: storybook-build