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): ship the dark icon, fix the boot race, move ci to depot (#91148)

Charles Vien5ac9d0fc5cfe
diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml
index 5a4f35596d00..c1db5ba9c676 100644
--- a/.github/actionlint.yaml
+++ b/.github/actionlint.yaml
@@ -6,6 +6,9 @@ self-hosted-runner:
- depot-ubuntu-24.04-4
- depot-ubuntu-24.04-8
- depot-macos-15
+ - depot-macos-26
+ - depot-ubuntu-24.04-arm-4
+ - depot-windows-2022-4
- ubuntu-24.04-8core
# The vendored .github/actions/paths-filter emits one output per filter name at
diff --git a/.github/scripts/desktop/check-pr-backend-coupling.sh b/.github/scripts/desktop/check-pr-backend-coupling.sh
index c18ffe817122..a8ef1881a609 100755
--- a/.github/scripts/desktop/check-pr-backend-coupling.sh
+++ b/.github/scripts/desktop/check-pr-backend-coupling.sh
@@ -61,8 +61,8 @@ fi
# Labels come from the API, not the event payload, so applying the skip label
# and re-running is enough; label changes do not retrigger pull_request runs.
pr_json=$(fetch_api "repos/$REPOSITORY/pulls/$PR_NUMBER") || exit 1
-if jq -e '[.labels[]?.name] | index("skip-desktop-backend-check") != null' <<<"$pr_json" >/dev/null; then
- echo "::notice::PR #$PR_NUMBER carries skip-desktop-backend-check; skipping the coupling check."
+if jq -e '[.labels[]?.name] | index("desktop-skip-backend-check") != null' <<<"$pr_json" >/dev/null; then
+ echo "::notice::PR #$PR_NUMBER carries desktop-skip-backend-check; skipping the coupling check."
exit 0
fi
@@ -78,7 +78,7 @@ if [ "$touched_backend" = true ]; then
echo " 2. Second PR: desktop changes (merge once the backend is live)."
echo ""
echo "If the two halves are independent (safe to ship in either order), apply the"
- echo "'skip-desktop-backend-check' label and re-run this check."
+ echo "'desktop-skip-backend-check' label and re-run this check."
exit 1
fi
diff --git a/.github/scripts/desktop/check-pr-backend-coupling.test.sh b/.github/scripts/desktop/check-pr-backend-coupling.test.sh
index 64f48ae7eae8..2daaf624cbf9 100755
--- a/.github/scripts/desktop/check-pr-backend-coupling.test.sh
+++ b/.github/scripts/desktop/check-pr-backend-coupling.test.sh
@@ -73,7 +73,7 @@ assert_result "backend-only PR is out of scope" 2 0 "No products/desktop changes
register_pr 3 "[]" products/desktop/apps/foo.ts posthog/models.py
assert_result "coupled PR fails with split guidance" 3 1 "must be separated into different PRs"
-register_pr 4 '[{"name": "skip-desktop-backend-check"}]' products/desktop/apps/foo.ts posthog/models.py
+register_pr 4 '[{"name": "desktop-skip-backend-check"}]' products/desktop/apps/foo.ts posthog/models.py
assert_result "skip label suppresses the check" 4 0 "skipping the coupling check"
# `yes` marks paths that count as backend and must fail the PR.
diff --git a/.github/workflows/desktop-agent-release-verify.yml b/.github/workflows/desktop-agent-release-verify.yml
index 512b7743aa8a..a96d7629279d 100644
--- a/.github/workflows/desktop-agent-release-verify.yml
+++ b/.github/workflows/desktop-agent-release-verify.yml
@@ -22,7 +22,7 @@ on:
jobs:
verify:
name: Verify agent release build
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04-4
timeout-minutes: 30
# Skipped on trunk-merge/** heads: merge-queue PRs are ephemeral and every
# constituent PR already ran this in full.
diff --git a/.github/workflows/desktop-agent-release.yml b/.github/workflows/desktop-agent-release.yml
index ab5fd5331dd6..60cdbd827474 100644
--- a/.github/workflows/desktop-agent-release.yml
+++ b/.github/workflows/desktop-agent-release.yml
@@ -12,7 +12,7 @@ concurrency:
jobs:
release:
name: Publish agent to npm
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04-4
timeout-minutes: 30
permissions:
contents: read
@@ -66,7 +66,7 @@ jobs:
rebuild-sandbox-images:
name: Rebuild tasks sandbox base images
needs: release
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
diff --git a/.github/workflows/desktop-agent-tag.yml b/.github/workflows/desktop-agent-tag.yml
index b26f2ec09605..aacfa67b816a 100644
--- a/.github/workflows/desktop-agent-tag.yml
+++ b/.github/workflows/desktop-agent-tag.yml
@@ -18,7 +18,7 @@ jobs:
tag:
permissions:
contents: write
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 10
steps:
- name: Get app token
diff --git a/.github/workflows/desktop-build-test.yml b/.github/workflows/desktop-build-test.yml
index 61331be03fb9..d0b92efba649 100644
--- a/.github/workflows/desktop-build-test.yml
+++ b/.github/workflows/desktop-build-test.yml
@@ -1,30 +1,48 @@
name: Desktop Build Test
-# Full build + code signing + verification of apps/code on demand, producing
-# downloadable artifacts for inspection.
+# Full build + code signing + verification of apps/code, producing downloadable
+# artifacts for every platform. Runs on demand, or on a same-repo PR that carries
+# the `desktop-build-installer` label, where it also posts a sticky comment
+# linking the artifacts for testers.
#
# This intentionally does NOT create or publish any GitHub release — it exists
# to prove the packaging pipeline works end to end before merge. The real
# release pipeline lives in desktop-release.yml and runs only on desktop-v* tags.
+# The macOS builds are signed but not notarized, so a downloaded app is
+# quarantined and Gatekeeper reports it as "damaged"; the PR comment tells
+# testers to clear the flag with `xattr -dr com.apple.quarantine`.
on:
workflow_dispatch:
+ pull_request:
+ types: [opened, synchronize, reopened, labeled]
+ paths:
+ - 'products/desktop/**'
+ - '.github/workflows/desktop-build-test.yml'
concurrency:
- group: desktop-build-test-${{ github.ref }}
- cancel-in-progress: true
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-macos:
+ # Fork PRs never receive the signing/AWS secrets, so only same-repo PRs
+ # with the label build; a manual dispatch always builds.
+ if: >-
+ github.event_name == 'workflow_dispatch' ||
+ (
+ github.event.pull_request.head.repo.full_name == github.repository &&
+ (
+ (github.event.action == 'labeled' && github.event.label.name == 'desktop-build-installer') ||
+ (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'desktop-build-installer'))
+ )
+ )
strategy:
fail-fast: false
matrix:
- include:
- - arch: arm64
- runner: macos-15
- - arch: x64
- runner: macos-15-intel
- runs-on: ${{ matrix.runner }}
+ arch: [arm64, x64]
+ # Depot macOS runners are Apple silicon only; the x64 build cross-compiles here.
+ runs-on: depot-macos-26
timeout-minutes: 60
permissions:
id-token: write
@@ -50,6 +68,9 @@ jobs:
# app for the smoke test. Notarization runs only in the tag release
# (code-release.yml), where Apple's notary service and agreements apply.
SKIP_NOTARIZE: '1'
+ # electron-builder skips signing on pull_request builds unless told
+ # otherwise; the job condition already limits those to same-repo PRs.
+ CSC_FOR_PULL_REQUEST: 'true'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -68,6 +89,27 @@ jobs:
with:
node-version: 22
+ # pnpm installs native optional packages for the host CPU only, and the x64
+ # build runs on an Apple silicon runner.
+ - name: Install x64 native packages on the arm64 runner
+ if: matrix.arch == 'x64'
+ run: |
+ printf '\nsupportedArchitectures:\n cpu: [x64, arm64]\n' >> pnpm-workspace.yaml
+
+ - name: Get pnpm store path
+ id: pnpm-store
+ shell: bash
+ run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
+
+ # Restore only: PR runs must not save caches, and the store is seeded
+ # by the desktop-test and desktop-warm-caches runs on master.
+ - name: Restore pnpm store
+ uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
+ with:
+ path: ${{ steps.pnpm-store.outputs.path }}
+ key: desktop-pnpm-${{ runner.os }}-${{ hashFiles('products/desktop/pnpm-lock.yaml') }}
+ restore-keys: desktop-pnpm-${{ runner.os }}-
+
- name: Install dependencies
run: pnpm install --frozen-lockfile
@@ -92,8 +134,9 @@ jobs:
pnpm --filter @posthog/harness run build
pnpm --filter @posthog/agent run build
- # build/Assets.car is gitignored; regenerate it so the packaged app ships
- # the liquid-glass icon (the script falls back to .icns if actool fails).
+ # build/Assets.car is gitignored, so compile it here. actool only handles the .icon
+ # bundle with Xcode 26, which this job gets from its macOS 26 runner's default
+ # toolchain; the script fails the build when it cannot produce one.
- name: Compile macOS liquid-glass icon
working-directory: products/desktop/apps/code
run: bash scripts/compile-glass-icon.sh
@@ -147,6 +190,10 @@ jobs:
- name: Install Playwright
run: pnpm --filter code exec playwright install
+ - name: Install Rosetta for the x64 smoke test
+ if: matrix.arch == 'x64'
+ run: pgrep -xq oahd || sudo softwareupdate --install-rosetta --agree-to-license
+
- name: Smoke test packaged app
env:
CI: true
@@ -174,7 +221,18 @@ jobs:
retention-days: 7
build-windows:
- runs-on: windows-2022
+ # Fork PRs never receive the signing/AWS secrets, so only same-repo PRs
+ # with the label build; a manual dispatch always builds.
+ if: >-
+ github.event_name == 'workflow_dispatch' ||
+ (
+ github.event.pull_request.head.repo.full_name == github.repository &&
+ (
+ (github.event.action == 'labeled' && github.event.label.name == 'desktop-build-installer') ||
+ (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'desktop-build-installer'))
+ )
+ )
+ runs-on: depot-windows-2022-4
timeout-minutes: 60
permissions:
contents: read
@@ -204,6 +262,20 @@ jobs:
with:
node-version: 22
+ - name: Get pnpm store path
+ id: pnpm-store
+ shell: bash
+ run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
+
+ # Restore only: PR runs must not save caches, and the store is seeded
+ # by the desktop-test and desktop-warm-caches runs on master.
+ - name: Restore pnpm store
+ uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
+ with:
+ path: ${{ steps.pnpm-store.outputs.path }}
+ key: desktop-pnpm-${{ runner.os }}-${{ hashFiles('products/desktop/pnpm-lock.yaml') }}
+ restore-keys: desktop-pnpm-${{ runner.os }}-
+
- name: Install dependencies
run: pnpm install --frozen-lockfile
@@ -255,13 +327,24 @@ jobs:
if-no-files-found: ignore
build-linux:
+ # Fork PRs never receive the signing/AWS secrets, so only same-repo PRs
+ # with the label build; a manual dispatch always builds.
+ if: >-
+ github.event_name == 'workflow_dispatch' ||
+ (
+ github.event.pull_request.head.repo.full_name == github.repository &&
+ (
+ (github.event.action == 'labeled' && github.event.label.name == 'desktop-build-installer') ||
+ (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'desktop-build-installer'))
+ )
+ )
strategy:
fail-fast: false
matrix:
include:
- - runner: ubuntu-24.04
+ - runner: depot-ubuntu-24.04-4
arch: x64
- - runner: ubuntu-24.04-arm
+ - runner: depot-ubuntu-24.04-arm-4
arch: arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
@@ -300,6 +383,20 @@ jobs:
with:
node-version: 22
+ - name: Get pnpm store path
+ id: pnpm-store
+ shell: bash
+ run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
+
+ # Restore only: PR runs must not save caches, and the store is seeded
+ # by the desktop-test and desktop-warm-caches runs on master.
+ - name: Restore pnpm store
+ uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
+ with:
+ path: ${{ steps.pnpm-store.outputs.path }}
+ key: desktop-pnpm-${{ runner.os }}-${{ hashFiles('products/desktop/pnpm-lock.yaml') }}
+ restore-keys: desktop-pnpm-${{ runner.os }}-
+
- name: Install dependencies
run: pnpm install --frozen-lockfile
@@ -335,3 +432,70 @@ jobs:
products/desktop/apps/code/out/*.rpm
compression-level: 0
retention-days: 7
+
+ # hogli-lint: not-a-required-gate — posts the sticky PR build status comment; emits no required check.
+ comment:
+ # Update the sticky comment once every build finishes, on success OR
+ # failure, so a failed re-run replaces a prior "ready" comment instead of
+ # leaving it pointing at stale artifacts. Runs only for labeled PRs.
+ needs: [build-macos, build-windows, build-linux]
+ if: ${{ !cancelled() && github.event_name == 'pull_request' && needs.build-macos.result != 'skipped' }}
+ runs-on: depot-ubuntu-24.04
+ timeout-minutes: 5
+ permissions:
+ issues: write
+ pull-requests: write
+ steps:
+ - name: Post build status on the PR
+ env:
+ GH_TOKEN: ${{ github.token }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ MACOS_RESULT: ${{ needs.build-macos.result }}
+ WINDOWS_RESULT: ${{ needs.build-windows.result }}
+ LINUX_RESULT: ${{ needs.build-linux.result }}
+ run: |
+ set -euo pipefail
+ MARKER="<!-- pr-installer-build -->"
+ RUN_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
+ if [ "${MACOS_RESULT}" = "success" ] && [ "${WINDOWS_RESULT}" = "success" ] && [ "${LINUX_RESULT}" = "success" ]; then
+ {
+ echo "$MARKER"
+ echo "### 🖥️ Desktop test builds"
+ echo ""
+ echo "Signed test builds for this PR are ready. **[Open this run and download an artifact](${RUN_URL}#artifacts)** (requires repo access):"
+ echo ""
+ echo "| Artifact | Platform |"
+ echo "|---|---|"
+ echo "| \`code-macos-arm64\` | macOS, Apple Silicon (.dmg, .zip) |"
+ echo "| \`code-macos-x64\` | macOS, Intel (.dmg, .zip) |"
+ echo "| \`code-windows\` | Windows x64 (.exe installer) |"
+ echo "| \`code-linux-x64\` | Linux x64 (.AppImage, .deb, .rpm) |"
+ echo "| \`code-linux-arm64\` | Linux arm64 (.AppImage, .deb, .rpm) |"
+ echo ""
+ echo "The macOS builds are **signed but not notarized**, so macOS quarantines them on download and Gatekeeper reports *\"PostHog is damaged and can't be opened\"*. Clear the flag once and it launches:"
+ echo ""
+ echo "\`\`\`sh"
+ echo "xattr -dr com.apple.quarantine \"/Applications/PostHog.app\""
+ echo "\`\`\`"
+ echo ""
+ echo "<sub>Built from ${GITHUB_SHA} · rebuilds on each push while the \`desktop-build-installer\` label is present.</sub>"
+ } > comment-body.md
+ else
+ {
+ echo "$MARKER"
+ echo "### 🖥️ Desktop test builds failed"
+ echo ""
+ echo "macOS: ${MACOS_RESULT}, Windows: ${WINDOWS_RESULT}, Linux: ${LINUX_RESULT}. **[View the run](${RUN_URL})** for logs."
+ echo ""
+ echo "<sub>Failed on ${GITHUB_SHA} · rebuilds on each push while the \`desktop-build-installer\` label is present.</sub>"
+ } > comment-body.md
+ fi
+
+ COMMENT_ID=$(gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" --paginate \
+ --jq ".[] | select(.body | contains(\"${MARKER}\")) | .id" | head -n1 || true)
+
+ if [ -n "${COMMENT_ID}" ]; then
+ gh api --method PATCH "repos/${GITHUB_REPOSITORY}/issues/comments/${COMMENT_ID}" -F [email protected]
+ else
+ gh api --method POST "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" -F [email protected]
+ fi
diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml
index e6a5f79718ff..717a3628cd0a 100644
--- a/.github/workflows/desktop-build.yml
+++ b/.github/workflows/desktop-build.yml
@@ -19,7 +19,7 @@ concurrency:
jobs:
changes:
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
if: github.event_name != 'merge_group'
permissions:
@@ -65,7 +65,7 @@ jobs:
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') }}
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04-4
timeout-minutes: 30
permissions:
contents: read
@@ -123,7 +123,7 @@ jobs:
desktop-build-pass:
needs: [changes, build]
name: Desktop Build Pass
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
if: always()
steps:
diff --git a/.github/workflows/desktop-ci.yml b/.github/workflows/desktop-ci.yml
index e8f8ad6b9435..fe20eb20e8bd 100644
--- a/.github/workflows/desktop-ci.yml
+++ b/.github/workflows/desktop-ci.yml
@@ -66,7 +66,7 @@ jobs:
github.event.pull_request.head.repo.full_name == github.repository &&
startsWith(github.head_ref, 'trunk-merge/')
)
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
steps:
- name: Checkout gate scripts
@@ -95,7 +95,7 @@ jobs:
name: Desktop Tests Pass
needs: [build, quality, typecheck, test, backend-coupling]
if: always()
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check results
diff --git a/.github/workflows/desktop-cleanup-draft-releases.yml b/.github/workflows/desktop-cleanup-draft-releases.yml
index 6f81e4064af6..6eb83f42f137 100644
--- a/.github/workflows/desktop-cleanup-draft-releases.yml
+++ b/.github/workflows/desktop-cleanup-draft-releases.yml
@@ -11,7 +11,7 @@ concurrency:
jobs:
cleanup:
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
diff --git a/.github/workflows/desktop-mobile-build.yml b/.github/workflows/desktop-mobile-build.yml
index f10321fedbe9..0d0e12cc9021 100644
--- a/.github/workflows/desktop-mobile-build.yml
+++ b/.github/workflows/desktop-mobile-build.yml
@@ -31,7 +31,7 @@ concurrency:
jobs:
build:
name: Build (${{ matrix.platform }})
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04-4
timeout-minutes: 120
strategy:
fail-fast: false
diff --git a/.github/workflows/desktop-mobile-promote.yml b/.github/workflows/desktop-mobile-promote.yml
index 1d49dc6524a5..8ae14a9d1669 100644
--- a/.github/workflows/desktop-mobile-promote.yml
+++ b/.github/workflows/desktop-mobile-promote.yml
@@ -51,7 +51,7 @@ concurrency:
jobs:
submit:
name: Submit (${{ matrix.platform }})
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
diff --git a/.github/workflows/desktop-pr-build-installer.yml b/.github/workflows/desktop-pr-build-installer.yml
deleted file mode 100644
index 6ee57f452e08..000000000000
--- a/.github/workflows/desktop-pr-build-installer.yml
+++ /dev/null
@@ -1,208 +0,0 @@
-name: Desktop PR Build Installer
-
-# On-demand, signed macOS test builds for a pull request. Add the
-# `build-installer` label to package apps/code and get a downloadable .dmg/.zip
-# attached to the run, with a sticky comment on the PR linking to it. Testers
-# download the artifact and run the app locally.
-#
-# This deliberately does NOT publish a GitHub release or notarize the build. It
-# signs but skips notarization (which lives in the real release pipeline,
-# code-release.yml, on v* tags). Because the build is unnotarized, macOS
-# quarantines the downloaded app and Gatekeeper reports it as "damaged"; the PR
-# comment tells testers to clear the flag with `xattr -dr com.apple.quarantine`.
-#
-# Gating: only same-repo PRs run — fork PRs never receive the signing/AWS
-# secrets, so building them would red spuriously.
-
-on:
- pull_request:
- types: [opened, synchronize, reopened, labeled]
- paths:
- - 'products/desktop/**'
- - '.github/workflows/desktop-pr-build-installer.yml'
-
-concurrency:
- group: desktop-pr-build-installer-${{ github.head_ref || github.ref }}
- cancel-in-progress: true
-
-jobs:
- build-macos:
- # Run on a same-repo PR that carries the `build-installer` label (either
- # just added, or already present on a push).
- if: >-
- github.event.pull_request.head.repo.full_name == github.repository &&
- (
- (github.event.action == 'labeled' && github.event.label.name == 'build-installer') ||
- (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'build-installer'))
- )
- runs-on: macos-15
- timeout-minutes: 45
- permissions:
- id-token: write
- contents: read
- defaults:
- run:
- working-directory: products/desktop
- env:
- NODE_OPTIONS: '--max-old-space-size=8192'
- NODE_ENV: production
- npm_config_arch: arm64
- npm_config_platform: darwin
- VITE_POSTHOG_API_KEY: ${{ secrets.VITE_POSTHOG_API_KEY }}
- VITE_POSTHOG_API_HOST: ${{ secrets.VITE_POSTHOG_API_HOST }}
- POSTHOG_SOURCEMAP_API_KEY: ${{ secrets.DESKTOP_POSTHOG_SOURCEMAP_API_KEY }}
- POSTHOG_ENV_ID: ${{ secrets.DESKTOP_POSTHOG_ENV_ID }}
- POSTHOG_HOST: ${{ secrets.DESKTOP_POSTHOG_HOST }}
- CSC_LINK: ${{ secrets.APPLE_CODESIGN_CERT_BASE64 }}
- CSC_KEY_PASSWORD: ${{ secrets.APPLE_CODESIGN_CERT_PASSWORD }}
- APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- # Sign but do not notarize: keeps the build fast. macOS quarantines the
- # downloaded app, and Gatekeeper blocks a quarantined, unnotarized build as
- # "damaged", so testers clear the flag with `xattr -dr com.apple.quarantine`
- # (see the PR comment). Notarization runs only in the tag release
- # (code-release.yml).
- SKIP_NOTARIZE: '1'
- steps:
- - name: Checkout
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- fetch-depth: 0
- filter: blob:none
- persist-credentials: false
-
- - name: Setup pnpm
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- with:
- package_json_file: products/desktop/package.json
-
- - name: Setup Node.js
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
- with:
- node-version: 22
-
- - name: Get pnpm store path
- id: pnpm-store
- run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
-
- # Explicit restore/save instead of setup-node's `cache: pnpm`: that
- # auto-saves on every run (PRs included, ungatable), which the workflow
- # lint forbids. This PR-only job restores from the store seeded by desktop-test master runs and never saves.
- - name: Restore pnpm store
- uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
- with:
- path: ${{ steps.pnpm-store.outputs.path }}
- key: desktop-pnpm-${{ runner.os }}-${{ hashFiles('products/desktop/pnpm-lock.yaml') }}
- restore-keys: desktop-pnpm-${{ runner.os }}-
-
- - name: Install dependencies
- run: pnpm install --frozen-lockfile
-
- - name: Configure AWS credentials
- uses: aws-actions/configure-aws-credentials@254c19bd240aabef8777f48595e9d2d7b972184b # v6.2.1
- with:
- role-to-assume: ${{ secrets.AWS_TWIG_APP_ASSETS_ROLE_ARN }}
- aws-region: ${{ secrets.AWS_TWIG_APP_ASSETS_REGION }}
- mask-aws-account-id: true
- unset-current-credentials: true
-
- - name: Download BerkeleyMono fonts from S3
- run: aws s3 cp s3://${{ secrets.AWS_TWIG_APP_ASSETS_BUCKET }}/fonts/BerkeleyMono/ apps/code/assets/fonts/BerkeleyMono/ --recursive
-
- - name: Build workspace packages
- run: |
- pnpm --filter @posthog/electron-trpc run build
- pnpm --filter @posthog/platform run build
- pnpm --filter @posthog/shared run build
- pnpm --filter @posthog/git run build
- pnpm --filter @posthog/enricher run build
- pnpm --filter @posthog/harness run build
- pnpm --filter @posthog/agent run build
-
- # build/Assets.car is gitignored; regenerate it so the packaged app ships
- # the liquid-glass icon (the script falls back to .icns if actool fails).
- - name: Compile macOS liquid-glass icon
- working-directory: products/desktop/apps/code
- run: bash scripts/compile-glass-icon.sh
-
- - name: Build app
- working-directory: products/desktop/apps/code
- run: |
- pnpm exec electron-vite build
- pnpm exec electron-builder build --mac --arm64 --publish never --config electron-builder.ts
-
- - name: Upload installer artifact
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- with:
- name: code-macos-arm64
- path: |
- products/desktop/apps/code/out/*.dmg
- products/desktop/apps/code/out/*-mac.zip
- compression-level: 0
- retention-days: 7
- if-no-files-found: error
-
- # hogli-lint: not-a-required-gate — posts the sticky PR installer status comment; emits no required check.
- comment:
- # Update the sticky comment once the build finishes, on success OR failure,
- # so a failed re-run replaces a prior "ready" comment instead of leaving it
- # pointing at stale artifacts. Skipped only when build-macos itself was
- # skipped (no label / fork), where there is nothing to report.
- needs: build-macos
- if: ${{ !cancelled() && (needs.build-macos.result == 'success' || needs.build-macos.result == 'failure') }}
- runs-on: ubuntu-latest
- timeout-minutes: 5
- permissions:
- issues: write
- pull-requests: write
- steps:
- - name: Post build status on the PR
- env:
- GH_TOKEN: ${{ github.token }}
- PR_NUMBER: ${{ github.event.pull_request.number }}
- BUILD_RESULT: ${{ needs.build-macos.result }}
- run: |
- set -euo pipefail
- MARKER="<!-- pr-installer-build -->"
- RUN_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
- if [ "${BUILD_RESULT}" = "success" ]; then
- {
- echo "$MARKER"
- echo "### 🖥️ macOS test build (Apple Silicon)"
- echo ""
- echo "A signed macOS build for this PR is ready to download and run."
- echo ""
- echo "**[⬇️ Open this run and download the \`code-macos-arm64\` artifact](${RUN_URL}#artifacts)** (Apple Silicon / M-series)."
- echo ""
- echo "Unzip it to get the \`.dmg\`, open it, and drag **PostHog** into **Applications**."
- echo ""
- echo "This build is **signed but not notarized**, so macOS quarantines it on download and Gatekeeper reports *\"PostHog is damaged and can't be opened\"*. That is the missing notarization, not a corrupt file — clear the quarantine flag once and it launches:"
- echo ""
- echo "\`\`\`sh"
- echo "xattr -dr com.apple.quarantine \"/Applications/PostHog.app\""
- echo "\`\`\`"
- echo ""
- echo "Then open **PostHog Desktop** normally. (Fully notarized, double-click-to-run builds ship only from the tagged release pipeline.)"
- echo ""
- echo "<sub>Built from ${GITHUB_SHA} · rebuilds on each push while the \`build-installer\` label is present. Downloading requires being signed in to GitHub with repo access.</sub>"
- } > comment-body.md
- else
- {
- echo "$MARKER"
- echo "### 🖥️ macOS test build failed"
- echo ""
- echo "The macOS build for this PR **failed**, so there is no downloadable artifact for the latest commit."
- echo ""
- echo "**[🔎 View the failed run](${RUN_URL})** for logs."
- echo ""
- echo "<sub>Failed on ${GITHUB_SHA} · rebuilds on each push while the \`build-installer\` label is present.</sub>"
- } > comment-body.md
- fi
-
- COMMENT_ID=$(gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" --paginate \
- --jq ".[] | select(.body | contains(\"${MARKER}\")) | .id" | head -n1 || true)
-
- if [ -n "${COMMENT_ID}" ]; then
- gh api --method PATCH "repos/${GITHUB_REPOSITORY}/issues/comments/${COMMENT_ID}" -F [email protected]
- else
- gh api --method POST "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" -F [email protected]
- fi
diff --git a/.github/workflows/desktop-quality.yml b/.github/workflows/desktop-quality.yml
index d4402459f417..d50a318a8c91 100644
--- a/.github/workflows/desktop-quality.yml
+++ b/.github/workflows/desktop-quality.yml
@@ -19,7 +19,7 @@ concurrency:
jobs:
changes:
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
if: github.event_name != 'merge_group'
permissions:
@@ -63,7 +63,7 @@ jobs:
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') }}
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04-4
timeout-minutes: 15
permissions:
contents: read
@@ -101,7 +101,7 @@ jobs:
desktop-quality-pass:
needs: [changes, quality]
name: Desktop Quality Pass
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
if: always()
steps:
diff --git a/.github/workflows/desktop-react-doctor.yml b/.github/workflows/desktop-react-doctor.yml
index 87032116b1d1..17c81e927d12 100644
--- a/.github/workflows/desktop-react-doctor.yml
+++ b/.github/workflows/desktop-react-doctor.yml
@@ -27,7 +27,7 @@ concurrency:
jobs:
react-doctor:
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 15
# Skipped on trunk-merge/** heads: merge-queue PRs are ephemeral and every
# constituent PR already ran this in full.
diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml
index 6d30285619d7..ad71fb2e4cb5 100644
--- a/.github/workflows/desktop-release.yml
+++ b/.github/workflows/desktop-release.yml
@@ -11,7 +11,7 @@ concurrency:
jobs:
prepare-release:
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write
@@ -50,12 +50,9 @@ jobs:
strategy:
fail-fast: false
matrix:
- include:
- - arch: arm64
- runner: macos-15
- - arch: x64
- runner: macos-15-intel
- runs-on: ${{ matrix.runner }}
+ arch: [arm64, x64]
+ # Depot macOS runners are Apple silicon only; the x64 build cross-compiles here.
+ runs-on: depot-macos-26
timeout-minutes: 90
defaults:
run:
@@ -130,6 +127,13 @@ jobs:
jq --arg v "$APP_VERSION" '.version = $v' apps/code/package.json > tmp.json && mv tmp.json apps/code/package.json
echo "Set apps/code/package.json version to $APP_VERSION"
+ # pnpm installs native optional packages for the host CPU only, and the x64
+ # build runs on an Apple silicon runner.
+ - name: Install x64 native packages on the arm64 runner
+ if: matrix.arch == 'x64'
+ run: |
+ printf '\nsupportedArchitectures:\n cpu: [x64, arm64]\n' >> pnpm-workspace.yaml
+
- name: Install dependencies
run: pnpm install --frozen-lockfile
@@ -165,8 +169,9 @@ jobs:
- name: Build agent package
run: pnpm --filter @posthog/agent run build
- # build/Assets.car is gitignored; regenerate it on the runner so the packaged
- # app ships the liquid-glass icon (the script falls back to .icns if actool fails).
+ # build/Assets.car is gitignored, so compile it here. actool only handles the .icon
+ # bundle with Xcode 26, which this job gets from its macOS 26 runner's default
+ # toolchain; the script fails the build when it cannot produce one.
- name: Compile macOS liquid-glass icon
working-directory: products/desktop/apps/code
run: bash scripts/compile-glass-icon.sh
@@ -229,6 +234,10 @@ jobs:
echo "OK: codex-acp/$f"
done
+ - name: Install Rosetta for the x64 smoke test
+ if: matrix.arch == 'x64'
+ run: pgrep -xq oahd || sudo softwareupdate --install-rosetta --agree-to-license
+
- name: Smoke test packaged app
env:
CI: true
@@ -296,7 +305,7 @@ jobs:
publish-windows:
needs: [prepare-release]
- runs-on: windows-2022
+ runs-on: depot-windows-2022-4
timeout-minutes: 90
defaults:
run:
@@ -475,9 +484,9 @@ jobs:
fail-fast: false
matrix:
include:
- - runner: ubuntu-24.04
+ - runner: depot-ubuntu-24.04-4
arch: x64
- - runner: ubuntu-24.04-arm
+ - runner: depot-ubuntu-24.04-arm-4
arch: arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
@@ -652,7 +661,7 @@ jobs:
# Publish only when every platform built successfully. Without an `if:` override
# the default `needs` gate skips this job (leaving the GitHub release a draft) if
# any of the macOS, Windows or Linux publish jobs fails.
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 15
permissions:
contents: write
diff --git a/.github/workflows/desktop-tag.yml b/.github/workflows/desktop-tag.yml
index daf0bb896a97..69e0eadf1378 100644
--- a/.github/workflows/desktop-tag.yml
+++ b/.github/workflows/desktop-tag.yml
@@ -26,13 +26,13 @@ jobs:
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
(github.event.pull_request.merged == true &&
- contains(github.event.pull_request.labels.*.name, 'create desktop release'))
+ contains(github.event.pull_request.labels.*.name, 'desktop-release'))
permissions:
contents: write
actions: write
pull-requests: write
issues: write
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 30
steps:
- name: Get app token
@@ -67,11 +67,11 @@ jobs:
}
LABELER=$(gh api "repos/${REPOSITORY}/issues/${PR_NUMBER}/events" --paginate \
- --jq '.[] | select(.event == "labeled" and (.label.name | ascii_downcase) == "create desktop release") | "\(.id) \(.actor.login)"' \
+ --jq '.[] | select(.event == "labeled" and (.label.name | ascii_downcase) == "desktop-release") | "\(.id) \(.actor.login)"' \
| sort -n | tail -1 | cut -d" " -f2)
if [ -z "$LABELER" ]; then
- skip "Could not determine who added the 'create desktop release' label."
+ skip "Could not determine who added the 'desktop-release' label."
exit 0
fi
@@ -81,10 +81,10 @@ jobs:
fi
if echo "$MEMBERS" | grep -qixF "$LABELER"; then
- echo "'create desktop release' was added by ${LABELER}, a member of ${TEAM_SLUG}."
+ echo "'desktop-release' was added by ${LABELER}, a member of ${TEAM_SLUG}."
echo "authorized=true" >> "$GITHUB_OUTPUT"
else
- skip "'create desktop release' was added by @${LABELER}, who is not on ${TEAM_SLUG}."
+ skip "'desktop-release' was added by @${LABELER}, who is not on ${TEAM_SLUG}."
fi
- name: Check quiet period
diff --git a/.github/workflows/desktop-test.yml b/.github/workflows/desktop-test.yml
index ca64c2bfcb2d..c8e40f903503 100644
--- a/.github/workflows/desktop-test.yml
+++ b/.github/workflows/desktop-test.yml
@@ -23,7 +23,7 @@ concurrency:
jobs:
changes:
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
if: github.event_name != 'merge_group'
permissions:
@@ -72,7 +72,7 @@ jobs:
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') }}
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04-4
timeout-minutes: 30
permissions:
contents: read
@@ -130,7 +130,7 @@ jobs:
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') }}
- runs-on: macos-latest
+ runs-on: depot-macos-26
timeout-minutes: 45
permissions:
contents: read
@@ -264,7 +264,7 @@ jobs:
# skipping to green. Only fork PRs are skipped, since they never receive the
# gateway secret and would red spuriously.
if: ${{ (needs.changes.outputs.packages == 'true' || needs.changes.outputs.workflow == 'true') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04-4
timeout-minutes: 30
permissions:
contents: read
@@ -347,7 +347,7 @@ jobs:
desktop-tests-pass:
needs: [changes, unit-test, integration-test, e2e]
name: Desktop Tests Pass
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
if: always()
steps:
diff --git a/.github/workflows/desktop-typecheck.yml b/.github/workflows/desktop-typecheck.yml
index 25304a04f0c3..dac3195610d3 100644
--- a/.github/workflows/desktop-typecheck.yml
+++ b/.github/workflows/desktop-typecheck.yml
@@ -19,7 +19,7 @@ concurrency:
jobs:
changes:
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
if: github.event_name != 'merge_group'
permissions:
@@ -65,7 +65,7 @@ jobs:
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') }}
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04-4
timeout-minutes: 30
permissions:
contents: read
@@ -120,7 +120,7 @@ jobs:
desktop-typecheck-pass:
needs: [changes, typecheck]
name: Desktop Typecheck Pass
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
timeout-minutes: 5
if: always()
steps:
diff --git a/.github/workflows/desktop-update-e2e.yml b/.github/workflows/desktop-update-e2e.yml
index 6505ec75b8a3..be9f5eff6bc8 100644
--- a/.github/workflows/desktop-update-e2e.yml
+++ b/.github/workflows/desktop-update-e2e.yml
@@ -27,7 +27,7 @@ concurrency:
jobs:
update-e2e-macos:
- runs-on: macos-15
+ runs-on: depot-macos-26
timeout-minutes: 90
defaults:
run:
diff --git a/.github/workflows/desktop-warm-caches.yml b/.github/workflows/desktop-warm-caches.yml
index beb7e36585a5..1e934fd1f57e 100644
--- a/.github/workflows/desktop-warm-caches.yml
+++ b/.github/workflows/desktop-warm-caches.yml
@@ -21,7 +21,7 @@ concurrency:
jobs:
linux:
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04-4
timeout-minutes: 15
permissions:
contents: read
@@ -74,7 +74,7 @@ jobs:
pnpm run typecheck
macos:
- runs-on: macos-latest
+ runs-on: depot-macos-26
timeout-minutes: 30
permissions:
contents: read
diff --git a/products/desktop/apps/code/README.md b/products/desktop/apps/code/README.md
index d70b37bf19fd..fa3aabca33f3 100644
--- a/products/desktop/apps/code/README.md
+++ b/products/desktop/apps/code/README.md
@@ -100,7 +100,7 @@ PostHog auto-updates on macOS and Windows. Current builds use `electron-updater`
There are three ways a release can fire:
1. **Scheduled (default)** — automatic at 17:00 and 01:00 UTC.
-2. **Hotfix** — add the `create desktop release` label to a PR before it merges. On merge, the tag workflow runs immediately and ships whatever is on `master`.
+2. **Hotfix** — add the `desktop-release` label to a PR before it merges. On merge, the tag workflow runs immediately and ships whatever is on `master`.
3. **Manual** — run `Tag PostHog Release` via `workflow_dispatch` from the Actions tab.
Local prep (only needed for one-off manual builds):
diff --git a/products/desktop/apps/code/scripts/compile-glass-icon.sh b/products/desktop/apps/code/scripts/compile-glass-icon.sh
index 115e28ce2b3d..33890c0e9c20 100755
--- a/products/desktop/apps/code/scripts/compile-glass-icon.sh
+++ b/products/desktop/apps/code/scripts/compile-glass-icon.sh
@@ -3,7 +3,7 @@
# Compile liquid glass icon to Assets.car
# Based on: https://www.hendrik-erz.de/post/supporting-liquid-glass-icons-in-apps-without-xcode
#
-# NOTE: This requires Xcode to be installed (Command Line Tools are not sufficient)
+# NOTE: This requires Xcode 26 (Command Line Tools are not sufficient)
# If you don't have Xcode, you can either:
# 1. Install Xcode from the App Store
# 2. Manually compile Assets.car on a machine with Xcode and commit it
@@ -15,9 +15,21 @@ ICON_PATH="build/Icon.icon"
OUTPUT_PATH="build/Assets.car"
TEMP_DIR=$(mktemp -d)
-if [ ! -d "$ICON_PATH" ]; then
- echo "⚠ $ICON_PATH not found - skipping liquid glass icon compilation"
+skip_with_icns_fallback() {
+ echo "⚠ $1"
+ rm -rf "$TEMP_DIR"
+ # Drop any stale catalog so packaging falls back to the .icns icon
+ rm -f "$OUTPUT_PATH"
+ if [ -n "${CI:-}" ] && [ "$(uname -s)" = "Darwin" ]; then
+ echo " macOS CI builds must ship the liquid-glass icon; check the $ICON_PATH sources and that Xcode 26 is the active toolchain"
+ exit 1
+ fi
+ echo " Skipping compilation (app will use standard .icns icon)"
exit 0
+}
+
+if [ ! -d "$ICON_PATH" ]; then
+ skip_with_icns_fallback "$ICON_PATH not found"
fi
# Check if Assets.car exists and is newer than every file in the icon bundle
@@ -30,11 +42,7 @@ echo "Compiling liquid glass icon..."
# Check if actool is available and functional
if ! command -v actool &> /dev/null; then
- echo "⚠ actool not found - Xcode is required to compile liquid glass icons"
- echo " Skipping compilation (app will use standard .icns icon)"
- # Drop any stale catalog so packaging falls back to the .icns icon
- rm -f "$OUTPUT_PATH"
- exit 0
+ skip_with_icns_fallback "actool not found - Xcode is required to compile liquid glass icons"
fi
# Try to compile with actool
@@ -52,12 +60,7 @@ if ! actool "$ICON_PATH" \
--target-device mac \
--minimum-deployment-target 26.0 \
--platform macosx 2>&1; then
- echo "⚠ actool failed - Xcode is required to compile liquid glass icons"
- echo " Skipping compilation (app will use standard .icns icon)"
- rm -rf "$TEMP_DIR"
- # Drop any stale catalog so packaging falls back to the .icns icon
- rm -f "$OUTPUT_PATH"
- exit 0
+ skip_with_icns_fallback "actool failed - Xcode is required to compile liquid glass icons"
fi
# Move Assets.car to build directory
@@ -65,9 +68,7 @@ if [ -f "$TEMP_DIR/Assets.car" ]; then
mv "$TEMP_DIR/Assets.car" "$OUTPUT_PATH"
echo "✓ Compiled Assets.car to $OUTPUT_PATH"
else
- echo "⚠ Assets.car not generated - skipping"
- # Drop any stale catalog so packaging falls back to the .icns icon
- rm -f "$OUTPUT_PATH"
+ skip_with_icns_fallback "Assets.car not generated - actool needs Xcode 26 or newer to compile .icon bundles"
fi
# Clean up
diff --git a/products/desktop/apps/code/src/main/index.ts b/products/desktop/apps/code/src/main/index.ts
index daacac479758..ed391c1e8648 100644
--- a/products/desktop/apps/code/src/main/index.ts
+++ b/products/desktop/apps/code/src/main/index.ts
@@ -329,7 +329,7 @@ posthogNodeAnalytics.initialize();
// native fetch and silently drops network.log capture.
installMainFetchLogging();
-app.whenReady().then(async () => {
+async function boot(): Promise<void> {
if (
process.platform === "darwin" &&
app.isPackaged &&
@@ -380,16 +380,12 @@ app.whenReady().then(async () => {
container.get<DevNetworkService>(DEV_NETWORK_SERVICE),
);
installYoutubeEmbedReferrer(session.fromPartition("persist:main").webRequest);
- createWindow();
- setupQuickAsk();
- // The hidden quick-ask panel must not keep the app alive after the main
- // window closes.
- onMainWindowClosed(destroyQuickAskWindow);
-
const wsServer = container.get<WorkspaceServerService>(
WORKSPACE_SERVER_SERVICE,
);
- await wsServer.start();
+ await wsServer.start().catch((error: unknown) => {
+ log.error("workspace-server failed to start", error);
+ });
// The workspace-server child respawns on a new port/secret after a crash;
// a reconnecting client follows the current connection so main-process
// callers don't keep hitting the dead port for the rest of the session.
@@ -447,6 +443,11 @@ app.whenReady().then(async () => {
};
container.bind(MAIN_FS_SERVICE).toConstantValue(fsCapability);
container.bind(FS_SERVICE).toService(MAIN_FS_SERVICE);
+ createWindow();
+ setupQuickAsk();
+ // The hidden quick-ask panel must not keep the app alive after the main
+ // window closes.
+ onMainWindowClosed(destroyQuickAskWindow);
await initializeServices();
initializeDeepLinks();
@@ -463,7 +464,9 @@ app.whenReady().then(async () => {
});
log.info("E2E update hook installed on globalThis.__e2eUpdates");
}
-});
+}
+
+app.whenReady().then(boot);
app.on("window-all-closed", () => {
app.quit();
diff --git a/products/desktop/apps/code/tests/e2e/playwright.config.ts b/products/desktop/apps/code/tests/e2e/playwright.config.ts
index 9d4f603b08b5..e829171b48ee 100644
--- a/products/desktop/apps/code/tests/e2e/playwright.config.ts
+++ b/products/desktop/apps/code/tests/e2e/playwright.config.ts
@@ -2,13 +2,21 @@ import { defineConfig } from "@playwright/test";
const isCI = !!process.env.CI;
+// The x64 app is built and smoke tested on an Apple silicon runner, so it runs
+// under Rosetta. Translation makes each launch roughly ten times slower than a
+// native one, and the first launch of the run is slower still.
+const isTranslated =
+ process.platform === "darwin" &&
+ !!process.env.E2E_APP_ARCH &&
+ process.env.E2E_APP_ARCH !== process.arch;
+
export default defineConfig({
testDir: "./tests",
testMatch: "**/*.spec.ts",
// The update specs need a signed feed; they run only via their dedicated
// configs (playwright.update*.config.ts), never in the general suite.
testIgnore: "**/update*.spec.ts",
- timeout: 60000,
+ timeout: isTranslated ? 240000 : 60000,
// No retries: Trunk Flaky Tests needs raw pass/fail results to detect flakes.
retries: 0,
// Must run serially - Electron app has single instance lock
diff --git a/products/desktop/docs/AUTO-UPDATE-TESTING.md b/products/desktop/docs/AUTO-UPDATE-TESTING.md
index 995d5057e363..295dc86801b4 100644
--- a/products/desktop/docs/AUTO-UPDATE-TESTING.md
+++ b/products/desktop/docs/AUTO-UPDATE-TESTING.md
@@ -157,7 +157,7 @@ Needs `gh` authenticated and the installed PostHog app quit. The CI job uploads
## CI
-`desktop-update-e2e.yml` runs both specs nightly on `macos-15` with the real signing secrets, and on demand:
+`desktop-update-e2e.yml` runs both specs nightly on `depot-macos-26` with the real signing secrets, and on demand:
```bash
gh workflow run "Desktop Update E2E (macOS)"
diff --git a/products/desktop/docs/UPDATES.md b/products/desktop/docs/UPDATES.md
index 697df34bd2c7..37e2760d34e9 100644
--- a/products/desktop/docs/UPDATES.md
+++ b/products/desktop/docs/UPDATES.md
@@ -38,7 +38,7 @@ Remote announcements can drive this flow: a `required-update` announcement block
Merge to `master` and wait for the next scheduled `desktop-tag.yml` run. To release sooner:
-- Add the `create desktop release` label to your PR before merging (the labeler must be a `team-posthog-code` member). The merge then tags immediately.
+- Add the `desktop-release` label to your PR before merging (the labeler must be a `team-posthog-code` member). The merge then tags immediately.
- Or trigger `desktop-tag.yml` manually with `gh workflow run desktop-tag.yml`.
## Releasing a minor or major version
diff --git a/products/desktop/patches/[email protected] b/products/desktop/patches/[email protected]
new file mode 100644
index 000000000000..d065268c2766
--- /dev/null
+++ b/products/desktop/patches/[email protected]
@@ -0,0 +1,24 @@
+diff --git a/out/codeSign/macCodeSign.js b/out/codeSign/macCodeSign.js
+index 9a69042fd48f4759a1c697bf23fa5b44f2da2366..637cc19f525c6ee3479b377cac4c6c78345aa8ba 100644
+--- a/out/codeSign/macCodeSign.js
++++ b/out/codeSign/macCodeSign.js
+@@ -156,16 +156,16 @@ async function createKeychain({ tmpDir, cscLink, cscKeyPassword, cscILink, cscIK
+ if (cscIKeyPassword != null) {
+ cscPasswords.push(cscIKeyPassword);
+ }
+- return await importCerts(keychainFile, certPaths, cscPasswords);
++ return await importCerts(keychainFile, certPaths, cscPasswords, keychainPassword);
+ }
+-async function importCerts(keychainFile, paths, keyPasswords) {
++async function importCerts(keychainFile, paths, keyPasswords, keychainPassword) {
+ var _a;
+ for (let i = 0; i < paths.length; i++) {
+ const password = (_a = keyPasswords[i]) !== null && _a !== void 0 ? _a : "";
+ await (0, builder_util_1.exec)("/usr/bin/security", ["import", paths[i], "-k", keychainFile, "-T", "/usr/bin/codesign", "-T", "/usr/bin/productbuild", "-P", password]);
+ // https://stackoverflow.com/questions/39868578/security-codesign-in-sierra-keychain-ignores-access-control-settings-and-ui-p
+ // https://github.com/electron-userland/electron-packager/issues/701#issuecomment-322315996
+- await (0, builder_util_1.exec)("/usr/bin/security", ["set-key-partition-list", "-S", "apple-tool:,apple:", "-s", "-k", password, keychainFile]);
++ await (0, builder_util_1.exec)("/usr/bin/security", ["set-key-partition-list", "-S", "apple-tool:,apple:", "-s", "-k", keychainPassword, keychainFile]);
+ }
+ return {
+ keychainFile,
diff --git a/products/desktop/pnpm-lock.yaml b/products/desktop/pnpm-lock.yaml
index d3229f016f47..cf183b6e6e1e 100644
--- a/products/desktop/pnpm-lock.yaml
+++ b/products/desktop/pnpm-lock.yaml
@@ -109,6 +109,9 @@ overrides:
smol-toml: 1.6.1
patchedDependencies:
+ hash: 4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1
+ path: patches/[email protected]
node-pty:
hash: 4dfdf785f5ac51a03f5d6032371cebe89036381acd403621f250a896245647c5
path: patches/node-pty.patch
@@ -24218,7 +24221,7 @@ snapshots:
normalize-path: 3.0.0
picomatch: 2.3.1
+ [email protected](patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected]):
dependencies:
'@electron/asar': 3.4.1
'@electron/fuses': 1.8.0
@@ -25306,7 +25309,7 @@ snapshots:
dependencies:
- app-builder-lib: 26.15.3([email protected])([email protected])
+ app-builder-lib: 26.15.3(patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])
builder-util: 26.15.3
fs-extra: 10.1.0
js-yaml: 4.1.1
@@ -25435,7 +25438,7 @@ snapshots:
dependencies:
- app-builder-lib: 26.15.3([email protected])([email protected])
+ app-builder-lib: 26.15.3(patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])
builder-util: 26.15.3
electron-winstaller: 5.4.0
transitivePeerDependencies:
@@ -25444,7 +25447,7 @@ snapshots:
dependencies:
- app-builder-lib: 26.15.3([email protected])([email protected])
+ app-builder-lib: 26.15.3(patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])
builder-util: 26.15.3
builder-util-runtime: 9.7.0
chalk: 4.1.2
diff --git a/products/desktop/pnpm-workspace.yaml b/products/desktop/pnpm-workspace.yaml
index 0c7f81c3c581..dc91eb4ff809 100644
--- a/products/desktop/pnpm-workspace.yaml
+++ b/products/desktop/pnpm-workspace.yaml
@@ -144,5 +144,6 @@ onlyBuiltDependencies:
- tree-sitter-cli
patchedDependencies:
node-pty: patches/node-pty.patch
react-hotkeys-hook: patches/react-hotkeys-hook.patch