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.

ci: move backend gating jobs to depot to cut queue latency (#61929)

Raúl Negrón-Oterodbc9688a912c
diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml
index a92dac925736..033d1e4c4a29 100644
--- a/.github/workflows/ci-backend.yml
+++ b/.github/workflows/ci-backend.yml
@@ -69,7 +69,7 @@ jobs:
# Job to decide if we should run backend ci
# See https://github.com/dorny/paths-filter#conditional-execution for more details
changes:
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-latest
timeout-minutes: 5
name: Determine need to run backend and migration checks
# Set job outputs to values from filter step
@@ -302,7 +302,7 @@ jobs:
detect-snapshot-mode:
name: Detect snapshot mode
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-latest
timeout-minutes: 5
needs: [changes]
if: needs.changes.outputs.backend == 'true'
@@ -1588,7 +1588,7 @@ jobs:
always() &&
needs.changes.outputs.backend == 'true' &&
needs.get_clickhouse_versions.result == 'success'
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-latest
timeout-minutes: 5
outputs:
include: ${{ steps.build.outputs.include }}
@@ -2135,7 +2135,7 @@ jobs:
name: Get ClickHouse versions
needs: [changes]
if: needs.changes.outputs.backend == 'true'
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-latest
timeout-minutes: 5
outputs:
# Oldest supported version for main Django tests (JSON array for matrix)
diff --git a/products/experiments/backend/hogql_queries/test/experiment_query_runner/__snapshots__/test_mean_metric.ambr b/products/experiments/backend/hogql_queries/test/experiment_query_runner/__snapshots__/test_mean_metric.ambr
index 6506f2a21ed9..99eace3b572f 100644
--- a/products/experiments/backend/hogql_queries/test/experiment_query_runner/__snapshots__/test_mean_metric.ambr
+++ b/products/experiments/backend/hogql_queries/test/experiment_query_runner/__snapshots__/test_mean_metric.ambr
@@ -181,6 +181,60 @@
use_hive_partitioning=0
'''
# ---
+# name: TestExperimentMeanMetric.test_conversion_window_extends_to_last_exposure_1_precomputed
+ '''
+ WITH exposures AS
+ (SELECT accurateCastOrNull(t.entity_id, 'UUID') AS entity_id,
+ if(ifNull(greater(uniqExact(t.variant), 1), 0), '$multiple', argMin(t.variant, toTimeZone(t.first_exposure_time, 'UTC'))) AS variant,
+ min(toTimeZone(t.first_exposure_time, 'UTC')) AS first_exposure_time,
+ max(toTimeZone(t.last_exposure_time, 'UTC')) AS last_exposure_time,
+ argMin(t.exposure_event_uuid, toTimeZone(t.first_exposure_time, 'UTC')) AS exposure_event_uuid,
+ argMin(t.exposure_session_id, toTimeZone(t.first_exposure_time, 'UTC')) AS exposure_session_id
+ FROM experiment_exposures_preaggregated AS t
+ WHERE and(equals(t.team_id, 99999), in(t.job_id, ['00000000-0000-0000-0000-000000000000', '00000000-0000-0000-0000-000000000000']), equals(t.team_id, 99999), greaterOrEquals(t.first_exposure_time, assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC'))), lessOrEquals(t.first_exposure_time, assumeNotNull(toDateTime('2020-01-10 00:00:00', 'UTC'))))
+ GROUP BY entity_id),
+ metric_events AS
+ (SELECT if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS entity_id,
+ toTimeZone(events.timestamp, 'UTC') AS timestamp,
+ coalesce(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'amount'), ''), 'null'), '^"|"$', ''), 'Float64'), 0) AS value
+ FROM events
+ LEFT OUTER JOIN
+ (SELECT tupleElement(argMax(tuple(person_distinct_id_overrides.person_id), person_distinct_id_overrides.version), 1) AS person_id,
+ person_distinct_id_overrides.distinct_id AS distinct_id
+ FROM person_distinct_id_overrides
+ WHERE equals(person_distinct_id_overrides.team_id, 99999)
+ GROUP BY person_distinct_id_overrides.distinct_id
+ HAVING ifNull(equals(tupleElement(argMax(tuple(person_distinct_id_overrides.is_deleted), person_distinct_id_overrides.version), 1), 0), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC'))), less(events.timestamp, plus(assumeNotNull(toDateTime('2020-01-10 00:00:00', 'UTC')), toIntervalSecond(86400))), equals(events.event, 'purchase'))),
+ entity_metrics AS
+ (SELECT exposures.entity_id AS entity_id,
+ exposures.variant AS variant,
+ sum(coalesce(accurateCastOrNull(metric_events.value, 'Float64'), 0)) AS value
+ FROM exposures
+ LEFT JOIN metric_events ON and(equals(exposures.entity_id, metric_events.entity_id), and(greaterOrEquals(toTimeZone(metric_events.timestamp, 'UTC'), exposures.first_exposure_time), less(toTimeZone(metric_events.timestamp, 'UTC'), plus(exposures.last_exposure_time, toIntervalSecond(86400)))))
+ GROUP BY exposures.entity_id,
+ exposures.variant)
+ SELECT entity_metrics.variant AS variant,
+ count(entity_metrics.entity_id) AS num_users,
+ sum(entity_metrics.value) AS total_sum,
+ sum(power(entity_metrics.value, 2)) AS total_sum_of_squares
+ FROM entity_metrics
+ GROUP BY entity_metrics.variant
+ LIMIT 50000 SETTINGS join_algorithm='grace_hash',
+ grace_hash_join_initial_buckets=2,
+ load_balancing='in_order',
+ readonly=2,
+ max_execution_time=600,
+ allow_experimental_object_type=1,
+ max_ast_elements=4000000,
+ max_expanded_ast_elements=4000000,
+ max_bytes_before_external_group_by=39728447488,
+ transform_null_in=1,
+ optimize_min_equality_disjunction_chain_length=4294967295,
+ allow_experimental_join_condition=1,
+ use_hive_partitioning=0
+ '''
+# ---
# name: TestExperimentMeanMetric.test_count_distinct_property_values_via_hogql_0_direct
'''
WITH exposures AS