ci(mergify): fix auto-queue - migrate to merge_protections_settings/auto_merge_conditions (deprecation 2026-07-16) #422

Merged
JMR-dev merged 4 commits from ci-mergify-autoqueue-fix into main 2026-07-08 02:31:14 +00:00
JMR-dev commented 2026-07-07 17:33:30 +00:00 (Migrated from github.com)

Problem

Mergify never auto-queues PRs. On a green, matching PR the "Mergify Merge Queue" check just reports "Merge queue is ready — use @Mergifyio queue" and the PR sits there, never merging. The current .mergify.yml triggers queueing via a pull_request_rules queue action, which in current Mergify does manual/explicit enqueueing only — it does not auto-queue.

Automatic queueing now lives in auto_merge_conditions inside merge_protections_settings. The old queue_rules[].autoqueue field / queue-action auto path is deprecated and stops working 2026-07-16.

Change

Replace the non-functional pull_request_rules block with:

merge_protections_settings:
  auto_merge_conditions:
    - base = main
    - -draft
    - -conflict
    - label != broken
    - check-success = CI passed

The auto_merge_conditions list mirrors the exact conditions the old queue action used, so exactly the same PRs auto-queue.

Nothing else changes. queue_rules (batch_size 1, merge_method merge, merge_conditions on CI passed), merge_queue (max_parallel_checks 1), and priority_rules (P0–P9) are untouched. This migration changes only the trigger (manual → automatic), not how the queue validates or merges.

Invariants preserved

  • require-up-to-date STAYS ON. Only batching (batch_size > 1) forces GitHub's "Require branches to be up to date before merging" checkbox off; we keep batch_size: 1. The auto-queue trigger does not touch merge semantics.
  • Serial (batch_size: 1), merge commits (merge_method: merge), max_parallel_checks: 1 — unchanged.
  • Single gate stays the CI passed check — unchanged.
  • P0–P9 priority_rules — unchanged.

How it interacts with GitHub branch protection

auto_merge_conditions feeds the merge queue (not a direct merge): "Every PR is auto-queued. The merge queue then handles routing and merging" (docs.mergify.com/merge-protections/auto-merge). The queued PR is still updated onto the latest main, re-runs CI, and merges on the real green CI passed. Mergify additionally "automatically reads your GitHub branch protections and rulesets and injects them as merge conditions" — so the GitHub gate (CI passed + require-up-to-date) is enforced on top of queue_rules.merge_conditions. This cannot bypass require-up-to-date, which is enforced by GitHub at the merge API level regardless of Mergify.

Docs verified (live, 2026-07-07)

  • merge-queue/rules: "autoqueue is deprecated and will stop working on 2026-07-16. Use auto_merge_conditions in merge_protections_settings instead."
  • configuration/file-format: auto_merge_conditions = "List of conditions or null … Accepts true as shorthand for unconditional auto-merge, or a list of conditions to restrict the audience." Confirmed valid top-level keys include queue_rules, merge_queue, priority_rules, merge_protections_settings.
  • merge-protections/auto-merge + merge-queue/lifecycle: auto-merge feeds the queue when a queue is configured.
  • merge-queue/batches: batching requires require-up-to-date OFF (why we stay serial).

Validation

  • python -c "import yaml; yaml.safe_load(open('.mergify.yml'))" → ok; top-level keys parse to queue_rules, merge_queue, priority_rules, merge_protections_settings.
  • Mergify's public /v1/validate API is behind a Cloudflare challenge (not reachable unauthenticated from CI), so structure was verified against the live docs above instead.

Review note

No auto-merge armed — this changes the live merge process itself, so a human should review before it merges.

🤖 Generated with Claude Code

## Problem Mergify never auto-queues PRs. On a green, matching PR the "Mergify Merge Queue" check just reports **"Merge queue is ready — use `@Mergifyio queue`"** and the PR sits there, never merging. The current `.mergify.yml` triggers queueing via a `pull_request_rules` `queue` action, which in current Mergify does **manual/explicit** enqueueing only — it does not auto-queue. Automatic queueing now lives in **`auto_merge_conditions` inside `merge_protections_settings`**. The old `queue_rules[].autoqueue` field / queue-action auto path is **deprecated and stops working 2026-07-16**. ## Change Replace the non-functional `pull_request_rules` block with: ```yaml merge_protections_settings: auto_merge_conditions: - base = main - -draft - -conflict - label != broken - check-success = CI passed ``` The `auto_merge_conditions` list **mirrors the exact conditions** the old queue action used, so exactly the same PRs auto-queue. **Nothing else changes.** `queue_rules` (batch_size 1, merge_method merge, merge_conditions on `CI passed`), `merge_queue` (max_parallel_checks 1), and `priority_rules` (P0–P9) are untouched. This migration changes only the **trigger** (manual → automatic), not how the queue validates or merges. ## Invariants preserved - **require-up-to-date STAYS ON.** Only *batching* (`batch_size > 1`) forces GitHub's "Require branches to be up to date before merging" checkbox off; we keep `batch_size: 1`. The auto-queue trigger does not touch merge semantics. - **Serial** (`batch_size: 1`), **merge commits** (`merge_method: merge`), **`max_parallel_checks: 1`** — unchanged. - **Single gate stays the `CI passed` check** — unchanged. - **P0–P9 `priority_rules`** — unchanged. ## How it interacts with GitHub branch protection `auto_merge_conditions` feeds the **merge queue** (not a direct merge): *"Every PR is auto-queued. The merge queue then handles routing and merging"* (docs.mergify.com/merge-protections/auto-merge). The queued PR is still updated onto the latest `main`, re-runs CI, and merges on the real green `CI passed`. Mergify additionally *"automatically reads your GitHub branch protections and rulesets and injects them as merge conditions"* — so the GitHub gate (`CI passed` + require-up-to-date) is enforced on top of `queue_rules.merge_conditions`. **This cannot bypass require-up-to-date**, which is enforced by GitHub at the merge API level regardless of Mergify. ## Docs verified (live, 2026-07-07) - `merge-queue/rules`: *"`autoqueue` is deprecated and will stop working on 2026-07-16. Use `auto_merge_conditions` in `merge_protections_settings` instead."* - `configuration/file-format`: `auto_merge_conditions` = *"List of conditions or null … Accepts `true` as shorthand for unconditional auto-merge, or a list of conditions to restrict the audience."* Confirmed valid top-level keys include `queue_rules`, `merge_queue`, `priority_rules`, `merge_protections_settings`. - `merge-protections/auto-merge` + `merge-queue/lifecycle`: auto-merge feeds the queue when a queue is configured. - `merge-queue/batches`: batching requires require-up-to-date OFF (why we stay serial). ## Validation - `python -c "import yaml; yaml.safe_load(open('.mergify.yml'))"` → **ok**; top-level keys parse to `queue_rules`, `merge_queue`, `priority_rules`, `merge_protections_settings`. - Mergify's public `/v1/validate` API is behind a Cloudflare challenge (not reachable unauthenticated from CI), so structure was verified against the live docs above instead. ## Review note **No auto-merge armed** — this changes the live merge process itself, so a human should review before it merges. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mergify[bot] commented 2026-07-07 17:34:10 +00:00 (Migrated from github.com)

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 📃 Configuration Change Requirements

Mergify configuration change

  • check-success = Configuration changed
# Merge Protections 🟢 **Merge protection satisfied** — ready to merge. <details><summary>Show 1 satisfied protection</summary> ## 🟢 📃 Configuration Change Requirements Mergify configuration change - [X] `check-success = Configuration changed` </details>
mergify[bot] commented 2026-07-07 17:51:46 +00:00 (Migrated from github.com)

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request
Tick the box to add this pull request to the merge queue (same as `@mergifyio queue`). - [ ] Queue this pull request <!-- mergify:queue-control:queue -->
Sign in to join this conversation.