: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): skip playwright e2e and mcp integration tests on draft PRs (#63541)
Georges-Antoine Assi4c4ef7f671fe
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.ymlindex dfa79b3e259c..a061cbf08aa9 100644--- a/.github/workflows/ci-e2e-playwright.yml+++ b/.github/workflows/ci-e2e-playwright.yml@@ -6,6 +6,11 @@name: E2E CI Playwrighton:pull_request:+ # Draft PRs skip E2E entirely — the broad path filter below matches nearly+ # every code PR, and a full ~25-minute stack boot per draft push is the+ # remaining big per-PR cost. The ready-for-review full run is the merge+ # gate; use workflow_dispatch to force a run on a draft.+ types: [opened, synchronize, reopened, ready_for_review]workflow_dispatch:inputs:playwright_retries:@@ -76,14 +81,15 @@ jobs:changes:runs-on: ubuntu-latesttimeout-minutes: 5- # Run on master push, manual dispatch, and on internal-repo PRs.- # Skipped on merge_group (explicitly, though the allowlist below would- # also skip it implicitly) — see the trigger comment above.+ # Run on master push, manual dispatch, and on ready internal-repo PRs.+ # Drafts skip E2E (see the trigger comment); the `Playwright tests pass`+ # aggregator treats skipped as success, and drafts can't merge anyway.if: |github.event_name != 'merge_group' && (github.event_name == 'push' ||github.event_name == 'workflow_dispatch' ||- github.event.pull_request.head.repo.full_name == github.repository)+ (github.event.pull_request.head.repo.full_name == github.repository &&+ github.event.pull_request.draft != true))name: Determine need to run E2E checksoutputs:shouldRun: ${{ steps.decide.outputs.shouldRun }}diff --git a/.github/workflows/ci-mcp.yml b/.github/workflows/ci-mcp.ymlindex 8eb3041ca266..e5458e73c8f0 100644--- a/.github/workflows/ci-mcp.yml+++ b/.github/workflows/ci-mcp.yml@@ -4,6 +4,10 @@ on:push:branches: [master]pull_request:+ # 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.+ types: [opened, synchronize, reopened, ready_for_review]# Required so `MCP Tests Pass` (a required status check) reports on merge# queue entries — without it the queue would wait for the check until timeout.# The jobs themselves skip on merge_group (the suite already runs in full on@@ -252,7 +256,11 @@ jobs:runs-on: depot-ubuntu-latest-4needs: changestimeout-minutes: 30- if: needs.changes.outputs.mcp == 'true'+ # Skipped on drafts: these boot the full PostHog backend and trigger on any+ # Python change, so they're the expensive half of this workflow. Build and+ # unit tests still run on drafts; the `MCP Tests Pass` aggregator treats+ # skipped as success, and the ready-for-review run is the merge gate.+ if: needs.changes.outputs.mcp == 'true' && github.event.pull_request.draft != trueenv:OPT_OUT_CAPTURE: 1SECRET_KEY: '6b01eee4f945ca25045b5aab440b953461faf08693a9abbf1166dc7c6b9772da'