Skip to content

ci: run every PR workflow in the merge queue - #4354

Merged
richiemcilroy merged 6 commits into
mainfrom
ci/merge-queue
Nov 18, 2026
Merged

richiemcilroy merged 6 commits into
mainfrom
ci/merge-queue

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Problem

  • A ready desktop PR often has main merged in and the whole desktop CI run again, because main moved after it went green. Green against an older main says nothing about the commit that lands.
  • GitHub's merge queue tests the exact commit that lands (main, plus the PRs queued ahead, plus this PR), so that loop can go. But today only engine-verify.yml runs on merge_group, and GitHub ignores paths filters for merge_group. Turning the queue on now would hang every entry on Verify recording, and nothing else would gate.

Change

flowchart LR
  PR[PR checks green] --> Q[enqueue]
  Q --> G["queue commit: main + PRs ahead + this PR"]
  G --> W["every workflow with merge_group<br/>scope = its own pull_request paths<br/>applied to base_sha..head_sha"]
  W --> M{"Merge queue check<br/>waits for all of them"}
  M -->|all green| L[lands on main]
  M -->|any red| X[removed from queue]
Loading
  • Every workflow that runs on pull requests now also runs on merge_group (21 workflows; engine-verify.yml already did). The only exception is the label-triggered engine-verify-label.yml.
  • Path-filtered workflows get a Scope job that only runs in the queue. It reads the workflow's own on.pull_request.paths and applies them to the queued change, so the queue runs exactly what the PR ran, from one source of truth. On pull requests the job is skipped and the heavy jobs run as before:
  scope:
    if: github.event_name == 'merge_group'
    ...
      - run: python3 scripts/ci/merge_queue.py scope --workflow .github/workflows/sync-tests.yml --base "$BASE" --head "$HEAD" >> "$GITHUB_OUTPUT"
  sync-tests:
    needs: scope
    if: ${{ !cancelled() && needs.scope.outputs.run != 'false' }}
  • Workflows that already had a scope job (glass-probe, instant-reliability, linux-desktop-reliability, picker-smoke) take the queue decision in that job. perf-budget and verify-recording feed the queue diff into their existing plan.py risk / plan.py recording logic, treating the queued PR as ready (never a draft). ci.yml points dorny/paths-filter at merge_group.base_sha..head_sha, so the same filters pick the same jobs.
  • New Merge queue check (.github/workflows/merge-queue.yml): in the queue it lists the workflows that declare merge_group at the queued commit, waits for each run on that commit, and fails as soon as one fails. A workflow added to the queue later gates without a ruleset change. On pull requests it only runs the helper self-test.
  • scripts/ci/merge_queue.py: GitHub's filter glob syntax (*, **, **/, negation), a dependency-free reader for on: cross-checked against PyYAML on every workflow, NUL-separated git diff --no-renames (renames count both paths), and the gate loop. If the diff cannot be computed, scope runs in full.
  • Queue runs never publish or save: docker-build-media-server treats merge_group like a PR (no GHCR push) and verify-recording skips its cache save. Concurrency groups key on the queue ref (gh-readonly-queue/main/pr-N-<sha>), unique per entry, so nothing cancels a queue run except the queue itself.

Coverage

For 20 recently merged PRs, the jobs that ran on the PR head compared with what the queue runs for the same changed files under this change (scripts/ci/merge_queue.py plus the CI filters and the plan.py scopes). Any PR-head job whose workflow would not run in the queue counts as missing. With sync-tests.yml taken out of the queue set as a control, the same comparison reports 18 missing jobs across 4 PRs.

PR Area Files Workflows that ran on the PR head Added in the queue Jobs on PR head Missing in queue
#4330 ci 5 ci, engine-verify, perf-budget, verify-recording merge-queue 29 0
#4319 ci 6 ci, engine-verify, linux-desktop-reliability, perf-budget, picker-smoke, verify-recording merge-queue 35 0
#4306 ci 58 ci, database-profile-reliability, engine-verify, infra-database, perf-budget, recording-reliability, validate-migration-journal, verify-recording merge-queue 16 0
#4328 desktop 6 ci, engine-verify, linux-desktop-reliability, perf-budget, picker-smoke, verify-recording merge-queue 33 0
#4323 desktop 2 ci, engine-verify, linux-desktop-reliability, perf-budget, recording-reliability, sync-tests, verify-recording merge-queue 56 0
#4321 desktop 4 ci, engine-verify, instant-reliability, linux-desktop-reliability, perf-budget, recording-reliability, sync-tests, verify-recording, windows-recording-encoder merge-queue 48 0
#4317 desktop 2 ci, engine-verify, linux-desktop-reliability, perf-budget, recording-reliability, sync-tests, verify-recording merge-queue 42 0
#4314 desktop 24 ci, engine-verify, instant-reliability, linux-desktop-reliability, perf-budget, picker-smoke, verify-recording merge-queue 34 0
#4295 desktop 9 ci, engine-verify, linux-desktop-reliability, perf-budget, verify-recording merge-queue 26 0
#4266 desktop 1 ci, engine-verify, perf-budget, sync-tests, verify-recording merge-queue 35 0
#4307 packages 45 ci, database-profile-reliability, engine-verify, perf-budget, recording-reliability, verify-recording merge-queue 14 0
#4304 packages 22 ci, database-profile-reliability, engine-verify, infra-database, perf-budget, recording-reliability, verify-recording merge-queue 15 0
#4259 packages 73 ci, engine-verify, perf-budget, recording-reliability, verify-recording merge-queue 13 0
#4060 packages 41 ci, database-profile-reliability, engine-verify, perf-budget, recording-reliability, validate-migration-journal, verify-recording infra-database, merge-queue 14 0
#4337 web 1 ci, engine-verify, perf-budget, recording-reliability, verify-recording merge-queue 13 0
#4289 web 2 ci, engine-verify, infra-database, perf-budget, recording-reliability, verify-recording merge-queue 14 0
#4287 web 32 ci, engine-verify, perf-budget, recording-reliability, verify-recording merge-queue 13 0
#4286 web 4 ci, engine-verify, perf-budget, verify-recording merge-queue 13 0
#4273 web 9 ci, engine-verify, perf-budget, verify-recording merge-queue 13 0
#3408 web 2 ci, docker-build-media-server, engine-verify, perf-budget, recording-reliability, test-self-hosting, verify-recording merge-queue 22 0

Queue behaviour

A temporary queue-proof branch (main plus this change) with a ruleset requiring Engine verify, Verify recording and Merge queue: merge commits, ALLGREEN, up to 5 groups building.

Canary Change Expected Result Queue time
#4349 clean desktop change in crates/utils (CI Rust + GPUI builds, Engine verify FULL, Verify recording, Linux desktop suite) lands landed own group 15m50s; 40m end to end, because two broken entries ahead forced two rebuilds
#4350 compile break in crates/api (only Clippy builds it, so the PR's required checks were green) rejected rejected by Clippy in the queue 2m25s from enqueue to removal; the gate fails on the first failed job
#4351 / #4352 A renames canary_value, B adds a call to it; each green alone, merge cleanly, both queued A then B A lands, B rejected A landed; B rejected with E0425 cannot find function canary_value A 9m10s; B removed 21m24s after enqueue (before the first-failed-job gate)
#4353 apps/web only lands, web checks only landed; the queue ran Typecheck, Web tests, Biome and the apps/web recording contract, with every desktop job skipped green 3m43s after enqueue, then waited its turn behind the entries above
#4357 the gate in this PR, onto the proof branch lands landed 4m
#4355 gh pr merge --admin with the queue rule on and no bypass actors refused Changes must be made through the merge queue -
  • A failing entry costs the entries behind it a rebuild: GitHub retests them without it. Runs of an invalidated group keep running to completion; they cannot change the result.
  • An admin cannot enqueue a PR that branch protection's required approval still blocks (At least 1 approving review is required by reviewers with write access); the proof branch passed with 0 required approvals.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no blocking issues were found.

Summary

Extends pull-request checks to the merge queue and adds a gate that waits for every queue workflow.

  • Pull-request checks run on queued commits when their paths match.
  • The Merge queue check waits for the workflows on each queued commit.

No new actionable issues found. The earlier Unicode filename issue is fixed. The helper self-test passed; PyYAML was unavailable, so the YAML cross-check did not run.

Reviews (8) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

GitHub ignores paths filters for merge_group events. Each path-filtered
workflow now applies its own pull_request paths to the queued change
(scripts/ci/merge_queue.py scope), CI's change detection compares the
queue commit with its base, and the new Merge queue check waits for every
workflow that declares merge_group and fails as soon as one fails.
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Ignored Ignored Preview Nov 18, 2026 9:05am UTC

@sandchest-com

sandchest-com Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Sandchest

Sandchest reviewed 4146260: nothing exploitable found in this change.

Sandchest reviews every change for vulnerabilities an attacker could use · Review details

Comment thread scripts/ci/merge_queue.py Resolved

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Capy found 1 potential issue (1 medium).

View 2 other findings in Capy.

Open in Capy

Comment thread scripts/ci/merge_queue.py Resolved

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Capy found 1 potential issue (1 high).

View 1 other finding in Capy.

Open in Capy

Comment thread scripts/ci/merge_queue.py Resolved
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Capy found no issues.

Open in Capy

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Capy found no issues.

View 2 other findings in Capy.

Open in Capy

@richiemcilroy
richiemcilroy merged commit eecbbd9 into main Nov 18, 2026
111 of 112 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant