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.

fix(ci): run dagster suite on PRs only for direct changes (#83313)

Paul D'Ambra4d4d5b83a518
diff --git a/.github/workflows/ci-dagster.yml b/.github/workflows/ci-dagster.yml
index fa845fdfbcca..d711c8b2f351 100644
--- a/.github/workflows/ci-dagster.yml
+++ b/.github/workflows/ci-dagster.yml
@@ -63,6 +63,15 @@ jobs:
# Set job outputs to values from filter step
outputs:
dagster: ${{ steps.filter.outputs.dagster || 'true' }}
+ dagster_direct: ${{ steps.filter.outputs.dagster_direct || 'true' }}
+ # Trunk's merge queue opens its PR from trunk-merge/**. Scope this to
+ # same-repo heads because github.head_ref is author-controlled.
+ merge_queue: >-
+ ${{
+ github.event_name == 'pull_request'
+ && github.event.pull_request.head.repo.full_name == github.repository
+ && startsWith(github.head_ref, 'trunk-merge/')
+ }}
oldest_supported: ${{ steps.read-versions.outputs.oldest_supported }}
matrix_include: ${{ steps.build-matrix.outputs.include || '[]' }}
schema_cache_key: ${{ steps.schema-key.outputs.key }}
@@ -91,6 +100,10 @@ jobs:
with:
token: ${{ steps.app-token.outputs.token || github.token }}
filters: |
+ # The full filter stays broad because Dagster imports shared backend
+ # code. Master and merge-queue runs use this tier so those changes
+ # remain merge-gated. Ordinary PRs use dagster_direct below, which
+ # avoids rerunning the suite for shared-only changes on every push.
dagster:
# --- DAG code itself ---
- 'posthog/dags/**'
@@ -192,6 +205,10 @@ jobs:
- 'tools/hogli-commands/hogli_commands/telemetry_props.py'
- 'tools/hogli-commands/hogli_commands/hint_hook.py'
- 'tools/hogli-commands/hogli_commands/hints.py'
+ dagster_direct:
+ - 'posthog/dags/**'
+ - 'products/*/dags/**'
+ - .github/workflows/ci-dagster.yml
- name: Read ClickHouse versions from JSON
id: read-versions
@@ -284,7 +301,10 @@ jobs:
fail-fast: false
matrix:
include: ${{ fromJson(needs.changes.outputs.matrix_include || '[]') }}
- if: needs.changes.outputs.dagster == 'true'
+ if: >-
+ needs.changes.outputs.dagster_direct == 'true'
+ || (needs.changes.outputs.merge_queue == 'true'
+ && needs.changes.outputs.dagster == 'true')
runs-on: depot-ubuntu-24.04
env:
DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USER }}