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(desktop): take desktop tests off the master push lane (#96633)

Georges-Antoine Assi2cfecf679ac1
diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml
index 4a8fb0778354..dd3404a89596 100644
--- a/.github/workflows/desktop-build.yml
+++ b/.github/workflows/desktop-build.yml
@@ -69,7 +69,21 @@ jobs:
build:
needs: changes
# Fail closed: if change detection itself failed, run instead of skipping.
- if: ${{ !cancelled() && github.event_name != 'merge_group' && (needs.changes.result != 'success' || needs.changes.outputs.code == 'true' || needs.changes.outputs.workflow == 'true') }}
+ #
+ # A draft pull request skips this job, so a draft pays for the quality, typecheck
+ # and unit test jobs only. This job is what proves the bundler still works, which
+ # a typecheck cannot tell you, so the signal comes back on ready_for_review, which
+ # desktop-ci.yml dispatches on for this reason.
+ #
+ # trunk-merge/** heads are exempt because Trunk opens its batch pull requests as
+ # drafts. Without that clause, the draft check would skip the one run that gates
+ # master.
+ if: >-
+ !cancelled() &&
+ github.event_name != 'merge_group' &&
+ (github.event.pull_request.draft != true ||
+ startsWith(github.head_ref, 'trunk-merge/')) &&
+ (needs.changes.result != 'success' || needs.changes.outputs.code == 'true' || needs.changes.outputs.workflow == 'true')
runs-on: depot-ubuntu-24.04-4
timeout-minutes: 30
permissions:
diff --git a/.github/workflows/desktop-ci.yml b/.github/workflows/desktop-ci.yml
index 181746f75731..90044e1a7ac3 100644
--- a/.github/workflows/desktop-ci.yml
+++ b/.github/workflows/desktop-ci.yml
@@ -11,7 +11,11 @@ name: Desktop CI
# any PR that requires them stuck waiting for status.
on:
+ # ready_for_review is included because the children skip their expensive jobs on a
+ # draft. Without it, marking a desktop pull request ready would dispatch nothing and
+ # the author would wait for an unrelated push to get that coverage back.
pull_request:
+ types: [opened, synchronize, reopened, ready_for_review]
# Required so the `Desktop * Pass` checks report on merge queue entries —
# without it the queue would wait for them until timeout. The children skip
# all real jobs on merge_group (the suite already ran in full on the PR) and
diff --git a/.github/workflows/desktop-test.yml b/.github/workflows/desktop-test.yml
index 3704fe06c6c4..cb74add61c63 100644
--- a/.github/workflows/desktop-test.yml
+++ b/.github/workflows/desktop-test.yml
@@ -11,11 +11,14 @@ on:
required: false
POSTHOG_CODE_E2E_GATEWAY_URL:
required: false
- push:
- branches: [master]
- paths:
- - 'products/desktop/**'
- - '.github/workflows/desktop-test.yml'
+ # A cron carries master coverage for this suite. Pull requests and merge queue
+ # batches run it per change, so the only gap left on master is drift from outside
+ # the repo: a new Electron, Playwright or runner-image version. Daily is enough for
+ # that, and it keeps demand on depot-macos-26 low, which is a fixed pool shared
+ # across Depot customers that cannot autoscale for a runner. 05:03 UTC holds this
+ # run clear of desktop-update-e2e.yml, the other daily job on that pool, at 07:00.
+ schedule:
+ - cron: '3 5 * * *'
concurrency:
group: desktop-test-${{ github.head_ref || github.ref }}
@@ -131,17 +134,20 @@ jobs:
needs: changes
# Fail closed: if change detection itself failed, run instead of skipping.
#
- # Also skipped on trunk-merge/** heads. Trunk's queue opens a real PR, so
- # the merge_group arm never matches and this ran on every batch. Every
- # batched PR already ran it in full, and depot-macos-26 is the suite's only
- # macOS runner, where an hour-long wait at peak holds the queue instead of
- # one author's PR. Scoped to same-repo heads so a fork cannot opt out by
- # naming its branch trunk-merge/**. While the live-model `e2e` job still
- # needs this one, it skips there too, the cascade merge_group relies on.
+ # A draft pull request skips this job. depot-macos-26 is a fixed pool that Depot
+ # shares between customers, and Apple's 24-hour minimum lease stops it from
+ # autoscaling, so a runner requested per draft push can wait many times longer
+ # than the job runs. The author gets the signal back on ready_for_review, which
+ # desktop-ci.yml dispatches on for this reason, the same way desktop-build.yml
+ # does.
+ #
+ # trunk-merge/** heads are exempt because Trunk opens its batch pull requests as
+ # drafts. Without that clause, the draft check would skip the one run that gates
+ # master.
if: >-
!cancelled() &&
github.event_name != 'merge_group' &&
- !(github.event.pull_request.head.repo.full_name == github.repository &&
+ (github.event.pull_request.draft != true ||
startsWith(github.head_ref, 'trunk-merge/')) &&
(needs.changes.result != 'success' || needs.changes.outputs.code == 'true' || needs.changes.outputs.workflow == 'true')
runs-on: depot-macos-26
diff --git a/.github/workflows/desktop-warm-caches.yml b/.github/workflows/desktop-warm-caches.yml
index bcbd9cf6ee88..0f749f9efdb5 100644
--- a/.github/workflows/desktop-warm-caches.yml
+++ b/.github/workflows/desktop-warm-caches.yml
@@ -12,8 +12,12 @@ name: Desktop Warm Caches
on:
push:
branches: [master]
+ # Every cache key in this workflow hashes pnpm-lock.yaml alone, so no other file
+ # can invalidate one. A wider filter would spend a macOS runner from a fixed,
+ # shared pool on install steps that no-op when all three caches hit. Use
+ # workflow_dispatch to reseed by hand if a cache is evicted.
paths:
- - 'products/desktop/**'
+ - 'products/desktop/pnpm-lock.yaml'
- '.github/workflows/desktop-warm-caches.yml'
workflow_dispatch: