: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): add no-ci label to skip heavy CI on draft PRs (#73160)
Thomas Obermüllerbe0dad299d78
diff --git a/.depot/workflows/ci-backend.yml b/.depot/workflows/ci-backend.ymlindex 1ab3502bcdb4..5f69716a1cc7 100644--- a/.depot/workflows/ci-backend.yml+++ b/.depot/workflows/ci-backend.yml@@ -92,7 +92,8 @@ on:# still skip drafts. Ready PRs run the full matrices — the merge gate —# and ready_for_review re-triggers them when a PR leaves draft. Add the# `run-ci-backend` label (labeled/unlabeled re-trigger) to force the full- # matrices on a draft. Mirrors canonical.+ # matrices on a draft; the `no-ci` label silences the workflow on a draft+ # entirely. Mirrors canonical.types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]concurrency:# PRs: one active run per branch, cancel stale. Push: per-SHA so master@@ -186,9 +187,14 @@ jobs:# See .github/actions/paths-filter/README.md for filter semanticschanges:# Root of the `needs` graph: skipped when `sample` says skip (or is itself skipped- # at percent 0/unset), which cascades the whole workflow off.+ # at percent 0/unset), which cascades the whole workflow off. Also skipped on+ # draft PRs labeled `no-ci`, mirroring canonical.needs: sample- if: needs.sample.outputs.sampled == 'true'+ if: >-+ needs.sample.outputs.sampled == 'true'+ && (github.event_name != 'pull_request'+ || github.event.pull_request.draft != true+ || !contains(github.event.pull_request.labels.*.name, 'no-ci'))runs-on: depot-ubuntu-24.04timeout-minutes: 5name: Determine need to run backend and migration checksdiff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.ymlindex 3385dff59799..609cec6d925f 100644--- a/.github/workflows/ci-backend.yml+++ b/.github/workflows/ci-backend.yml@@ -19,6 +19,9 @@ on:# it when a PR leaves draft. To force the full matrices on a draft, add the# `run-ci-backend` label — labeled/unlabeled re-trigger the run so the matrices# start without needing a new push. Cheap checks still run on drafts.+ # The `no-ci` label does the opposite: it silences this workflow on a draft+ # entirely (prototypes/spikes), until the label is removed or the PR is+ # marked ready for review.# The `test-new-events-schema` label opts a PR into the doubled matrices that# rerun everything with CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA=true; unlabeled# PRs run legacy-schema only (master runs always cover both).@@ -78,6 +81,13 @@ jobs:changes:runs-on: depot-ubuntu-24.04timeout-minutes: 5+ # A draft PR labeled `no-ci` skips this workflow entirely (prototypes):+ # every other job needs this one, and the gates treat skipped as success.+ # ready_for_review re-runs everything, so the merge gate is unaffected.+ if: >-+ github.event_name != 'pull_request'+ || github.event.pull_request.draft != true+ || !contains(github.event.pull_request.labels.*.name, 'no-ci')name: Determine need to run backend and migration checks# Set job outputs to values from filter stepoutputs:@@ -3355,7 +3365,8 @@ jobs:test-selection-verdict:needs: [django, turbo-tests, changes, select-tests]name: Test selection verdict- if: ${{ !cancelled() && github.event_name == 'pull_request' }}+ # changes is skipped on no-ci drafts — no tests ran, nothing to verdict.+ if: ${{ !cancelled() && github.event_name == 'pull_request' && needs.changes.result != 'skipped' }}runs-on: ubuntu-latesttimeout-minutes: 10permissions:diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.ymlindex b8f0c5a84489..0164a20c7e5b 100644--- a/.github/workflows/ci-frontend.yml+++ b/.github/workflows/ci-frontend.yml@@ -5,7 +5,9 @@ on:# (the merge gate). ready_for_review re-triggers the full run on the# current head when a PR leaves draft. To force the full matrix on a# draft, add the `run-ci-frontend` label — labeled/unlabeled re-trigger- # the run so it starts without needing a new push.+ # the run so it starts without needing a new push. The `no-ci` label does+ # the opposite: it silences this workflow on a draft entirely (prototypes),+ # until the label is removed or the PR is marked ready for review.types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]push:branches:@@ -31,6 +33,13 @@ jobs:changes:runs-on: ubuntu-latesttimeout-minutes: 5+ # A draft PR labeled `no-ci` skips this workflow entirely (prototypes):+ # every other job needs this one, and the gates treat skipped as success.+ # ready_for_review re-runs everything, so the merge gate is unaffected.+ if: >-+ github.event_name != 'pull_request'+ || github.event.pull_request.draft != true+ || !contains(github.event.pull_request.labels.*.name, 'no-ci')name: Determine need to run frontend checks# A snapshot-only bot push (Visual Review auto-commits frontend/snapshots.yml after# approval) skips ci-storybook and ci-e2e-playwright (the snapshot-baseline-dependentdiff --git a/.github/workflows/ci-mcp.yml b/.github/workflows/ci-mcp.ymlindex 60717dea18f6..cbbd4f453766 100644--- a/.github/workflows/ci-mcp.yml+++ b/.github/workflows/ci-mcp.yml@@ -7,6 +7,8 @@ on:# Draft PRs run build + unit tests only; the integration tests (which boot# the full PostHog backend and trigger on any Python change) run when the# PR is marked ready for review — that full run is the merge gate.+ # The `no-ci` label silences this workflow on a draft entirely (prototypes).+ # No labeled/unlabeled triggers here, so it takes effect from the next push.types: [opened, synchronize, reopened, ready_for_review]concurrency:@@ -24,6 +26,13 @@ jobs:changes:runs-on: ubuntu-24.04timeout-minutes: 5+ # A draft PR labeled `no-ci` skips this workflow entirely (prototypes):+ # every other job needs this one, and the gates treat skipped as success.+ # ready_for_review re-runs everything, so the merge gate is unaffected.+ if: >-+ github.event_name != 'pull_request'+ || github.event.pull_request.draft != true+ || !contains(github.event.pull_request.labels.*.name, 'no-ci')name: Determine need to run MCP checksoutputs:mcp: ${{ steps.filter.outputs.mcp || 'true' }}diff --git a/.github/workflows/ci-storybook.yml b/.github/workflows/ci-storybook.ymlindex 2611daf8c59d..f1309c58ecf9 100644--- a/.github/workflows/ci-storybook.yml+++ b/.github/workflows/ci-storybook.yml@@ -6,6 +6,8 @@ on:# matrix as the merge gate. To force the full matrix on a draft, add the# `run-ci-frontend` label —# labeled/unlabeled re-trigger the run so it starts without needing a push.+ # The `no-ci` label does the opposite: it silences this workflow on a draft+ # entirely (prototypes), until it is removed or the PR is marked ready.types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]push:branches:@@ -24,6 +26,13 @@ jobs:changes:runs-on: ubuntu-latesttimeout-minutes: 5+ # A draft PR labeled `no-ci` skips this workflow entirely (prototypes):+ # every other job needs this one, and the gates treat skipped as success.+ # ready_for_review re-runs everything, so the merge gate is unaffected.+ if: >-+ github.event_name != 'pull_request'+ || github.event.pull_request.draft != true+ || !contains(github.event.pull_request.labels.*.name, 'no-ci')name: Determine need to run storybook checks# Set job outputs to values from filter stepoutputs: