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(ci): Read clickhouse image from versions json for CI (#70905)

Tommy Gilmore7fa80dee4ccd
diff --git a/.depot/workflows/ci-backend.yml b/.depot/workflows/ci-backend.yml
index a6429f52e62a..732499e77b95 100644
--- a/.depot/workflows/ci-backend.yml
+++ b/.depot/workflows/ci-backend.yml
@@ -683,7 +683,7 @@ jobs:
# Each job gets its own runner + Docker stack, so no shared DB conflicts
# Small products (< 50 tests) are grouped into a single job to avoid setup overhead
turbo-tests:
- needs: [changes, turbo-discover, detect-snapshot-mode]
+ needs: [changes, turbo-discover, detect-snapshot-mode, get_clickhouse_versions]
if: >-
always() && (github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'run-ci-backend')) && needs.turbo-discover.result == 'success' && needs.turbo-discover.outputs.matrix != '[]' && needs.turbo-discover.outputs.matrix != ''
runs-on: depot-ubuntu-latest
@@ -712,7 +712,7 @@ jobs:
env:
COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml
COMPOSE_PROFILES: temporal,azure
- CLICKHOUSE_SERVER_IMAGE: clickhouse/clickhouse-server:26.6.1.1193
+ CLICKHOUSE_SERVER_IMAGE: ${{ needs.get_clickhouse_versions.outputs.local_image }}
run: |
cp posthog/user_scripts/latest_user_defined_function.xml docker/clickhouse/user_defined_function.xml
# nohup detaches the launch so it survives Depot's step-shell teardown
@@ -761,7 +761,7 @@ jobs:
env:
COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml
COMPOSE_PROFILES: temporal,azure
- CLICKHOUSE_SERVER_IMAGE: clickhouse/clickhouse-server:26.6.1.1193
+ CLICKHOUSE_SERVER_IMAGE: ${{ needs.get_clickhouse_versions.outputs.local_image }}
WAIT_FOR_DOCKER_TIMEOUT: 900
run: |
bin/ci-wait-for-docker wait objectstorage \
@@ -1760,6 +1760,8 @@ jobs:
outputs:
# Oldest supported version as plain string (for comparisons)
oldest_supported_image: ${{ steps.read-versions.outputs.oldest_supported_image }}
+ # Local dev / hobby image, mirrored from clickhouse-versions.json `local`
+ local_image: ${{ steps.read-versions.outputs.local_image }}
# Fully expanded compat matrix (version x shard group)
compat_matrix: ${{ steps.read-versions.outputs.compat_matrix }}
steps:
@@ -1782,6 +1784,15 @@ jobs:
echo "oldest_supported_image=$oldest_supported" >> $GITHUB_OUTPUT
echo "Oldest supported version for Django tests: $oldest_supported"
+ # Local dev / hobby image — the version product (turbo) tests run against.
+ local_image=$(jq -r '.local' .github/clickhouse-versions.json)
+ if [ -z "$local_image" ] || [ "$local_image" = "null" ]; then
+ echo "::error::No local version found in .github/clickhouse-versions.json"
+ exit 1
+ fi
+ echo "local_image=$local_image" >> $GITHUB_OUTPUT
+ echo "Local dev/hobby image for product tests: $local_image"
+
# Read all unique versions so we can derive compat coverage.
all=$(jq -c '[.[]] | unique' .github/clickhouse-versions.json)
if [ "$all" = "[]" ] || [ -z "$all" ]; then
diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml
index e4e5d43080f4..2173cbd8b016 100644
--- a/.github/workflows/ci-backend.yml
+++ b/.github/workflows/ci-backend.yml
@@ -622,7 +622,7 @@ jobs:
# Each job gets its own runner + Docker stack, so no shared DB conflicts
# Small products (< 50 tests) are grouped into a single job to avoid setup overhead
turbo-tests:
- needs: [changes, turbo-discover, detect-snapshot-mode]
+ needs: [changes, turbo-discover, detect-snapshot-mode, get_clickhouse_versions]
if: >-
always() &&
(github.event.pull_request.draft != true ||
@@ -663,7 +663,7 @@ jobs:
env:
COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml
COMPOSE_PROFILES: temporal,azure
- CLICKHOUSE_SERVER_IMAGE: clickhouse/clickhouse-server:26.6.1.1193
+ CLICKHOUSE_SERVER_IMAGE: ${{ needs.get_clickhouse_versions.outputs.local_image }}
run: |
cp posthog/user_scripts/latest_user_defined_function.xml docker/clickhouse/user_defined_function.xml
bin/ci-wait-for-docker launch --background --down \
@@ -729,7 +729,7 @@ jobs:
env:
COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml
COMPOSE_PROFILES: temporal,azure
- CLICKHOUSE_SERVER_IMAGE: clickhouse/clickhouse-server:26.6.1.1193
+ CLICKHOUSE_SERVER_IMAGE: ${{ needs.get_clickhouse_versions.outputs.local_image }}
run: bin/ci-wait-for-docker wait
- name: Restore schema cache from master
@@ -2799,6 +2799,8 @@ jobs:
outputs:
# Oldest supported version as plain string (for comparisons)
oldest_supported_image: ${{ steps.read-versions.outputs.oldest_supported_image }}
+ # Local dev / hobby image, mirrored from clickhouse-versions.json `local`
+ local_image: ${{ steps.read-versions.outputs.local_image }}
# Fully expanded compat matrix (version x shard group)
compat_matrix: ${{ steps.read-versions.outputs.compat_matrix }}
steps:
@@ -2821,6 +2823,15 @@ jobs:
echo "oldest_supported_image=$oldest_supported" >> $GITHUB_OUTPUT
echo "Oldest supported version for Django tests: $oldest_supported"
+ # Local dev / hobby image — the version product (turbo) tests run against.
+ local_image=$(jq -r '.local' .github/clickhouse-versions.json)
+ if [ -z "$local_image" ] || [ "$local_image" = "null" ]; then
+ echo "::error::No local version found in .github/clickhouse-versions.json"
+ exit 1
+ fi
+ echo "local_image=$local_image" >> $GITHUB_OUTPUT
+ echo "Local dev/hobby image for product tests: $local_image"
+
# Read all unique versions so we can derive compat coverage.
all=$(jq -c '[.[]] | unique' .github/clickhouse-versions.json)
if [ "$all" = "[]" ] || [ -z "$all" ]; then