Skip to content

: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.

chore(devex): prune redundant CI overhead across workflows (#65235)

Julian Bez80f90a43aece
diff --git a/.github/workflows/ci-agent-skills.yml b/.github/workflows/ci-agent-skills.yml
index 78660ef91391..adb5199820b6 100644
--- a/.github/workflows/ci-agent-skills.yml
+++ b/.github/workflows/ci-agent-skills.yml
@@ -98,13 +98,6 @@ jobs:
toolchain: stable
components: cargo
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-skills'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
uses: ./.github/actions/setup-sqlx-cli
@@ -190,13 +183,6 @@ jobs:
toolchain: stable
components: cargo
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-skills'
- workspaces: rust
- save-if: false
-
- name: Install sqlx-cli
uses: ./.github/actions/setup-sqlx-cli
diff --git a/.github/workflows/ci-ai.yml b/.github/workflows/ci-ai.yml
index 9fec7673cafd..bf0260b62ce9 100644
--- a/.github/workflows/ci-ai.yml
+++ b/.github/workflows/ci-ai.yml
@@ -115,13 +115,6 @@ jobs:
toolchain: 1.91.1
components: cargo
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-backend'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
uses: ./.github/actions/setup-sqlx-cli
diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml
index 271b7951125c..308c05c3a002 100644
--- a/.github/workflows/ci-backend.yml
+++ b/.github/workflows/ci-backend.yml
@@ -655,7 +655,7 @@ jobs:
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 \
+ db redis7 clickhouse zookeeper kafka objectstorage \
temporal elasticsearch objectstorage-azure
- name: Mint setup-action GitHub token
@@ -698,13 +698,6 @@ jobs:
toolchain: 1.91.1
components: cargo
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-backend'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
uses: ./.github/actions/setup-sqlx-cli
@@ -1062,13 +1055,6 @@ jobs:
toolchain: 1.91.1
components: cargo
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-backend'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
uses: ./.github/actions/setup-sqlx-cli
@@ -2122,14 +2108,6 @@ jobs:
toolchain: 1.91.1
components: cargo
- - name: Cache Rust dependencies
- if: needs.changes.outputs.backend == 'true'
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-backend'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
if: needs.changes.outputs.backend == 'true'
uses: ./.github/actions/setup-sqlx-cli
@@ -2938,13 +2916,6 @@ jobs:
toolchain: 1.91.1
components: cargo
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-backend'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
uses: ./.github/actions/setup-sqlx-cli
diff --git a/.github/workflows/ci-dagster.yml b/.github/workflows/ci-dagster.yml
index 6cd419ebe7e0..bb778c7aa692 100644
--- a/.github/workflows/ci-dagster.yml
+++ b/.github/workflows/ci-dagster.yml
@@ -313,13 +313,6 @@ jobs:
toolchain: stable
components: cargo
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-backend'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
uses: ./.github/actions/setup-sqlx-cli
diff --git a/.github/workflows/ci-docs-check.yml b/.github/workflows/ci-docs-check.yml
index 49a6099f2b7c..abce771bc177 100644
--- a/.github/workflows/ci-docs-check.yml
+++ b/.github/workflows/ci-docs-check.yml
@@ -7,6 +7,11 @@ on:
description: 'File that triggers doc regeneration when changed'
required: true
type: string
+ additional_source_files:
+ description: 'Extra files (newline-separated) that also trigger regeneration, e.g. the generator script'
+ required: false
+ type: string
+ default: ''
build_command:
description: 'Command to regenerate the docs'
required: true
@@ -38,9 +43,13 @@ jobs:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
SOURCE_FILE: ${{ inputs.source_file }}
+ ADDITIONAL_SOURCE_FILES: ${{ inputs.additional_source_files }}
run: |
- if gh pr diff "$PR_NUMBER" --name-only \
- | grep -q "$SOURCE_FILE"; then
+ # Regenerate when the data file OR any additional source (e.g. the generator) changes,
+ # so a generator-only edit can't pass without validating the committed output.
+ changed_files=$(gh pr diff "$PR_NUMBER" --name-only)
+ if printf '%s\n' "$changed_files" \
+ | grep -qFf <(printf '%s\n' "$SOURCE_FILE" "$ADDITIONAL_SOURCE_FILES" | grep -v '^$'); then
echo "changed=true" >> $GITHUB_OUTPUT
fi
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.yml
index cea94ddbc3e8..b53bb5b89ac6 100644
--- a/.github/workflows/ci-e2e-playwright.yml
+++ b/.github/workflows/ci-e2e-playwright.yml
@@ -473,13 +473,6 @@ jobs:
run_clickhouse_query 'DROP DATABASE IF EXISTS posthog_test SYNC'
run_clickhouse_query 'CREATE DATABASE posthog_test'
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-backend'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
uses: ./.github/actions/setup-sqlx-cli
diff --git a/.github/workflows/ci-nodejs.yml b/.github/workflows/ci-nodejs.yml
index 098a4ae77438..a913a874fe51 100644
--- a/.github/workflows/ci-nodejs.yml
+++ b/.github/workflows/ci-nodejs.yml
@@ -57,6 +57,8 @@ jobs:
filters: |
nodejs:
- .github/workflows/ci-nodejs.yml
+ # Node DB setup builds sqlx-cli via this composite; changes to it must exercise these jobs.
+ - '.github/actions/setup-sqlx-cli/**'
- 'nodejs/**'
- 'posthog/clickhouse/**'
- 'ee/migrations/**'
@@ -259,16 +261,8 @@ jobs:
with:
toolchain: 1.91.1
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-backend'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
- working-directory: rust
- run: cargo install [email protected] --locked --no-default-features --features native-tls,postgres
+ uses: ./.github/actions/setup-sqlx-cli
- name: Install SAML (python3-saml) dependencies
if: steps.setup-uv.outputs.cache-hit != 'true'
@@ -458,16 +452,8 @@ jobs:
with:
toolchain: 1.91.1
- - name: Cache Rust dependencies
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- with:
- shared-key: 'v2-rust-backend'
- workspaces: rust
- save-if: ${{ github.ref == 'refs/heads/master' }}
-
- name: Install sqlx-cli
- working-directory: rust
- run: cargo install [email protected] --locked --no-default-features --features native-tls,postgres
+ uses: ./.github/actions/setup-sqlx-cli
- name: Install SAML (python3-saml) dependencies
if: steps.setup-uv.outputs.cache-hit != 'true'
diff --git a/.github/workflows/ci-storybook.yml b/.github/workflows/ci-storybook.yml
index ae9fb9ab9f25..4c2b096e9b54 100644
--- a/.github/workflows/ci-storybook.yml
+++ b/.github/workflows/ci-storybook.yml
@@ -384,7 +384,9 @@ jobs:
run: pnpm --filter=@posthog/storybook... install --frozen-lockfile
- name: Save pnpm cache
- if: github.ref == 'refs/heads/master'
+ # The cache key is identical across all visual-regression shards, so only one
+ # shard needs to write it — gating to a single shard avoids redundant concurrent saves.
+ if: github.ref == 'refs/heads/master' && matrix.shard == 1 && matrix.browser == 'chromium'
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ steps.pnpm-store.outputs.path }}
diff --git a/.github/workflows/ci-survey-sdk-check.yml b/.github/workflows/ci-survey-sdk-check.yml
index 27d782d8cd83..f4a89f47488d 100644
--- a/.github/workflows/ci-survey-sdk-check.yml
+++ b/.github/workflows/ci-survey-sdk-check.yml
@@ -5,7 +5,7 @@ on:
paths:
- 'frontend/src/scenes/surveys/**'
- 'docs/published/surveys/**'
- - 'frontend/bin/build-survey-sdk-docs.ts'
+ - 'frontend/bin/docs/build-survey-sdk-docs.ts'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
@@ -60,6 +60,7 @@ jobs:
uses: ./.github/workflows/ci-docs-check.yml
with:
source_file: frontend/src/scenes/surveys/surveyVersionRequirements.ts
+ additional_source_files: frontend/bin/docs/build-survey-sdk-docs.ts
build_command: pnpm --filter=@posthog/frontend build:survey-sdk-docs
output_file: docs/published/docs/surveys/sdk-feature-support.mdx
fail_on_outdated: true