Skip to content

fix(desktop): skip the macOS integration test on merge queue batches - #96546

Merged
force-merge-posthog[bot] merged 1 commit into
masterfrom
posthog/desktop-skip-macos-on-trunk-merge
Sep 8, 2026
Merged

force-merge-posthog[bot] merged 1 commit into
masterfrom
posthog/desktop-skip-macos-on-trunk-merge

Conversation

@webjunkie

Copy link
Copy Markdown
Contributor

Problem

  • Desktop engineers watch the merge queue stall on a job that tests nothing new. The integration-test job runs for about 5 minutes but waits for a depot-macos-26 slot, and recent master runs waited 0, 0, 2, 3, 5, 5, 12, 57, and 76 minutes for one.
  • That wait now happens inside the merge path. desktop-test.yml tries to skip the job on the merge queue with github.event_name != 'merge_group', but master lands through Trunk, which opens a real pull request from a trunk-merge/** branch. The event is pull_request, so the guard never matches and the job runs on every batch.
  • The batch run adds no coverage. Desktop PRs run this suite in full with no draft narrowing, so every batched PR already passed it.
  • On a batch the wait blocks the whole queue rather than one author's pull request.

Changes

  • Merge queue batches no longer request a macOS runner, so a batch reaches master without sitting behind the macOS pool.
  • The e2e job currently needs integration-test, so it skips on those heads too. That is the same cascade the merge_group arm already relies on, and Desktop Tests Pass counts a skipped dependency as a pass.
  • Everything else is unchanged. unit-test, typecheck, quality, and build still run on batches, where they are cheap and can catch a conflict the batch introduces.
  • The new condition is scoped to same-repo heads, so a fork cannot opt out of the job by naming its branch trunk-merge/**. This matches desktop-agent-release-verify.yml, desktop-react-doctor.yml, and the backend-coupling job in desktop-ci.yml.

This narrows demand on the macOS pool rather than fixing allocation, so it stacks with the other work in flight rather than replacing it.

flowchart LR
    A["trunk-merge/** batch"] --> B["changes"]
    B --> C["unit-test<br/>(linux, ~1m)"]
    B --> D["integration-test<br/>(depot-macos-26, ~5m run,<br/>up to ~76m queued)"]
    C --> E["e2e (linux)"]
    D --> E
    E --> F["Desktop Tests Pass"]
    style D fill:#F54E00,stroke:#1D4AFF,color:#fff
Loading
flowchart LR
    A["trunk-merge/** batch"] --> B["changes"]
    B --> C["unit-test<br/>(linux, ~1m)"]
    B --> D["integration-test<br/>skipped"]
    C --> E["e2e<br/>skipped (needs integration-test)"]
    D --> E
    E --> F["Desktop Tests Pass"]
    style D fill:#30ABC6,stroke:#1D4AFF,color:#fff
    style E fill:#30ABC6,stroke:#1D4AFF,color:#fff
Loading

How did you test this code?

  • No tests were added. The change is a workflow condition, and this repo has no harness that evaluates a GitHub Actions if: expression.
  • bin/hogli lint:workflows passes (9 checks, 134 workflows), and actionlint .github/workflows/desktop-test.yml is clean. bin/hogli ci:preflight --fix reports 0 failures.
  • The condition was confirmed against a live job rather than reasoned about. The job log for job 102040205744 on a trunk-merge/pr-96071/... head prints Expanded: (!false && ('pull_request' != 'merge_group') && ...), then Result: true, then Requested labels: depot-macos-26.
  • Queue and run times come from the jobs API over recent desktop-test.yml runs on master.
  • Not verified: that a real batch now skips the job. That needs a merge queue run on this condition, which only exists once this lands.

Automatic notifications

  • Publish to changelog?

Docs update

No docs update is needed. The change affects CI scheduling only.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Raised from a Slack thread that started as a question about failing and slow desktop tests. Those turned out to be two unrelated things: the four failing assertions are already fixed by #96427, and the wall clock is this macOS queue. This PR addresses only the second.

Invoked /authoring-ci-workflows and /writing-pr-descriptions. Used read, bash, and edit; no subagents.

Two open drafts already target the macOS pool, and neither covers this. #95852 moves the web E2E suite to its own Linux job and drops integration-test from e2e's needs; #94509 caps the smoke step and evicts cache-warming runs in the release workflows. Both reduce time spent on a macOS runner; neither stops the batch from asking for one. If #95852 lands, e2e no longer cascades and would run on batches again — the comment in the diff is worded for that, and guarding e2e separately would be a follow-up decision, not part of this fix. #95852 also edits desktop-test.yml, but in the job's steps rather than its condition.

The diff contains no customer data or other non-public material.

Trunk's merge queue opens a real PR from a trunk-merge/** branch rather than
using GitHub's native merge queue, so the `github.event_name != 'merge_group'`
arm on the integration-test job never matches there. The job requested a
depot-macos-26 runner on every batch, where the wait holds the queue.

Every batched PR already ran this suite in full, so the batch run is redundant.
The skip is scoped to same-repo heads, matching the idiom already used by
desktop-agent-release-verify.yml, desktop-react-doctor.yml, and the
backend-coupling job in desktop-ci.yml.

Generated-By: PostHog Desktop
Task-Id: 0fa7390b-35a9-4614-a4ac-8e91c87e5eee
@webjunkie webjunkie added the skip-agent-review Save $$$, skip auto agent reviews (Greptile) — use for trivial or chore PRs label Sep 8, 2026
@webjunkie webjunkie self-assigned this Sep 8, 2026
@trunk-io

trunk-io Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

😎 Merged manually by force-merge-posthog[bot] - details.

@webjunkie
webjunkie requested a review from gantoine September 8, 2026 12:22
@webjunkie
webjunkie marked this pull request as ready for review September 8, 2026 12:22
Copilot AI lite review requested due to automatic review settings September 8, 2026 12:22
@webjunkie

Copy link
Copy Markdown
Contributor Author

/trunk merge --priority high

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Trunk lane — backend Python lane

This PR is assigned to the backend Python lane. It runs backend Python tests and may merge in parallel with PRs in other lanes.

@github-actions github-actions Bot added the feature/desktop Feature Tag: Desktop label Sep 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The workflow logic change is small and targeted; only a minor comment cleanup was flagged.

Pull request overview

This PR updates the Desktop CI workflow to avoid running the macOS integration-test job on Trunk merge-queue batch PRs (trunk-merge/**), preventing merge-queue batches from consuming scarce depot-macos-26 capacity.

Changes:

  • Extend the integration-test job condition to skip on same-repo trunk-merge/** heads (in addition to the existing merge_group skip).
  • Preserve existing change-detection gating so normal PRs still run integration-test when relevant files change.
File summaries
File Description
.github/workflows/desktop-test.yml Update integration-test job if: guard to skip on same-repo trunk-merge/** batch PR heads.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 132 to +136
# 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') }}
#
# 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
@force-merge-posthog

Copy link
Copy Markdown

Warning

A break-glass force-merge has been requested for this PR.

Initiated by: Julian (Slack)
Audit: https://posthog.slack.com/archives/C0113360FFV/p1788871379473719
Time: 2026-09-08T12:42:59.544615+00:00

Branch protection requirements will be bypassed. If this was unexpected, contact #team-security.

@force-merge-posthog
force-merge-posthog Bot merged commit c5f9b45 into master Sep 8, 2026
313 of 325 checks passed
@force-merge-posthog

Copy link
Copy Markdown

✅ Force-merge completed.

@force-merge-posthog
force-merge-posthog Bot deleted the posthog/desktop-skip-macos-on-trunk-merge branch September 8, 2026 12:43
gantoine added a commit that referenced this pull request Sep 8, 2026
@deployment-status-posthog

deployment-status-posthog Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-09-08 13:14 UTC Run
prod-us ✅ Deployed 2026-09-08 13:29 UTC Run
prod-eu ✅ Deployed 2026-09-08 13:34 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature/desktop Feature Tag: Desktop skip-agent-review Save $$$, skip auto agent reviews (Greptile) — use for trivial or chore PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants