Migrate from Mergify
This guide maps a Mergify merge-queue setup to MergeSpan v0.1. It is intentionally conservative: only behavior that exists in MergeSpan is mapped as an equivalent. Everything else is marked not supported and must stay in GitHub branch protection, rulesets, or CI rather than being translated into a queue feature that does not exist.
Installing the App on the repository is the cutover. MergeSpan has no separate enable switch: installation starts queue processing. Do not install it while Mergify is still merging. Prepare the verification workflow, labels, and rulesets first, drain Mergify, and clear its labels. A repository with no
.github/mergespan.tomland no queue labels is not a safe staging state: fileless MergeSpan infers defaults and starts from the active base rulesets as soon as it is installed.
Do not run both queues at once. Mergify and MergeSpan both react to labels and merge pull requests. If both are active on the same base branch, either can merge a pull request the other is verifying. Disable one before enabling the other.
What maps directly
| Mergify concept | MergeSpan equivalent | Notes |
|---|---|---|
| One queue for a base branch | Optional .github/mergespan.toml with base | v0.1 supports one base branch (bootstrapped from main). Without the file, the base is inferred as main. |
| Queue entry label / condition | queue_label (default queue) | MergeSpan uses a label, not a condition expression. Fileless setups use queue. |
merge_method: squash | Always squash | v0.1 has no merge-method setting. |
| Required checks after the PR is up to date | required_checks, or inferred from active base rulesets | Exact GitHub Actions check names on candidate C. Without a config file, MergeSpan takes the required status check contexts from the active rulesets on main, excluding its own mergespan gate. |
| Queue priority via label | urgent_label (default urgent) | Only a binary urgent label; no priority rule engine. Fileless setups use urgent. |
| Queue timeout | timeout_minutes | Applies to candidate validation, not queue wait. Fileless default is 60 minutes. |
| Branch protection / ruleset check injection | Manual rulesets | MergeSpan does not inject rules; configure rulesets yourself. Fileless inference reads rulesets only, not classic branch protection. |
Optional explicit translation
The .github/mergespan.toml file is optional. If the default base, labels, timeout, and the base ruleset’s candidate checks are what you want, skip the file; MergeSpan infers them.
Add the file when you need a custom label, timeout, or explicit check list, or when you want the required checks pinned independently of the ruleset. An explicit file always wins over inference. If the file exists but is invalid, MergeSpan halts; it does not fall back.
# .mergify.yml (illustrative)
queue_rules:
- name: default
queue_conditions:
- base = main
- label = queue
merge_conditions:
- check-success = ci
merge_method: squash
becomes this explicit override, if you need one:
# .github/mergespan.toml
base = "main"
queue_label = "queue"
urgent_label = "urgent"
required_checks = ["ci"]
timeout_minutes = 60
same_repo_only = true
The merge_method: squash line has no equivalent because squash is the only method. Do not copy queue_conditions expressions; only the label maps. Reviews, file-path conditions, author conditions, and other expressions do not map.
What does not map (v0.1)
| Mergify feature | Status in MergeSpan v0.1 | What to do instead |
|---|---|---|
Multiple queue_rules per repository | Not supported | Use one repository/base per queue, or split repositories. |
| Multiple target bases in one installation | Not supported | One queue per repository/base. |
Batching (batch_size, merge batches) | Not supported | MergeSpan verifies one PR at a time. |
| Parallel/speculative checks | Not supported | Serial verification only. |
merge_method: merge, rebase, fast-forward, merge-batch | Not supported | Squash only. |
priority_rules / rich priority expressions | Not supported | Only the urgent label, applied manually. |
auto_merge_conditions | Not supported | Add the queue label (manually, via @mergespan queue, or via your own workflow). |
pull_request_rules actions (comment, label, close, rebase, update, delete_head_branch, etc.) | Not supported | Keep equivalent GitHub Actions or branch protection. MergeSpan does not run a general rule engine. |
merge_protections / custom merge protections | Not supported | Encode requirements as required checks or ruleset rules. |
commands_restrictions | Not supported | Comment commands require repository write access; there is no per-user allowlist. |
| Fork pull request queueing | Not supported (runtime requires same_repo_only = true) | Fork PRs stay out of the queue. |
| Queue branch prefix customization | Not supported | Fixed mergespan/queue/<number>. |
| Mergify dashboard analytics / wait-time history | Partial | MergeSpan has an event timeline and statistics view, not a migration of Mergify data. |
Mergify’s public documentation describes queue rules, batching, and merge methods in Using Queue Rules and Merge Strategies. Use those pages when auditing which of your existing features have no MergeSpan equivalent.
Which old guards and bypass actors to retire
Mergify’s recommended setup asks for a bypass actor with the exempt mode on every ruleset that applies to the base or queue branches, because some merge methods update the base branch directly. MergeSpan does not need that bypass:
- Base branch ruleset: no bypass actors. MergeSpan merges through the pull request API with the App’s
mergespancheck; a human or another App must not bypass the required check. mergespan/queue/**ruleset: restrict creations, updates, and deletions to the MergeSpan App. This is an ownership restriction on temporary branches, not a bypass on the base branch.- Remove Mergify’s bypass actor from every ruleset where it was added. If you keep Mergify installed for rollback, disable its queue behavior; do not leave its bypass active while MergeSpan is the queue.
- Retire guard workflows whose only job is to emulate queue serialization or to gate merges for Mergify. If a workflow performs real validation, keep it and list its check name in
required_checks(or require it on the base ruleset so inference picks it up). If it only waits on a queue label/comment or posts a duplicate status, remove it after MergeSpan is live. - Turn off “Require branches to be up to date before merging” on the base branch. MergeSpan validates the candidate itself; strict mode would invalidate the PR head whenever the base moves.
- Stop using auto-merge for these pull requests.
gh pr merge --autobypasses MergeSpan’s candidate check. This is an operational rule, not a repository setting MergeSpan can enforce.
Migration sequence
- Inventory
.mergify.yml:- every
queue_rulesentry, - every
merge_method, batch_size/ parallel settings,priority_rules,pull_request_rulesthat queue or merge,merge_protections.
- every
- Decide what MergeSpan can own. Keep only one queue rule’s label and checks. Move every condition MergeSpan cannot express into branch protection, rulesets, or CI.
- Prepare the repository before installing MergeSpan:
- Add the verification workflow to the base branch. It must run on
pushtomergespan/queue/**withgithub.event.created == false; see Configuration → Verification workflow requirements. - Create the labels you will use (default
queueandurgent), or confirm they exist with the exact names. - Prepare the base branch ruleset: require a pull request, allow squash only, leave strict up-to-date off, and use no bypass actors. Require each candidate check by its exact name. These required status check contexts are the fileless
required_checks; themergespangate is excluded. - Prepare the
mergespan/queue/**ruleset: restrict creations, updates, and deletions to the MergeSpan App; no human bypass. - Optionally add
.github/mergespan.tomlwith the verified labels, checks, andsame_repo_only = true, then merge it to the base branch. If you skip the file, inference uses basemainand the ruleset contexts. - Merge all of this to the base branch. These are pushes while Mergify may still be watching; ensure its queue behavior is disabled or cannot enqueue the preparatory changes.
- Add the verification workflow to the base branch. It must run on
- Drain and stop Mergify before installation:
- Disable automatic queueing / remove
queue_rulesfrom the active Mergify config, or disable the Mergify app for this repository. - Wait until no Mergify queue entry is active; if a merge is in flight, let it settle.
- Remove both configured labels (
queueandurgent, or your custom names) from every open pull request so MergeSpan cannot pick them up at installation.
- Disable automatic queueing / remove
- Install MergeSpan and cut over:
- Install the App on the repository with the permissions and events in GitHub App. This installation is the enable action.
- Add or confirm the base ruleset’s required
mergespancheck scoped to the MergeSpan App. If it was already added in step 3, confirm it is the MergeSpan App’s check. - A fileless install is supported and uses the inferred configuration from step 3. It is not a “dry run”: do not install with Mergify still active or with queue labels left behind.
- Initialize and verify setup: from the Console, click Reconcile so the repository initializes without waiting for a webhook. Setup must show either the explicit configuration or the inferred configuration with its source and exact required checks. If it shows an inference failure, fix the named ruleset/check and recheck; do not add a file blindly. Verify
config_loadedbefore labeling anything. - Verify with one non-draft pull request:
- add the configured queue label (default
queue); - expect a
mergespancheck,mergespan/queue/<n>, checks on C, squash merge, branch deletion; - check the console event timeline.
- add the configured queue label (default
- Retire the old guards and bypass actors listed above only after step 7 succeeds and no MergeSpan candidate branches remain.
- Rollback plan ready (next section) before you rely on the queue for critical merges.
Safe rollback to Mergify
If MergeSpan misbehaves, roll back without leaving two queues active:
- Stop MergeSpan processing first: pause MergeSpan in the console (no new candidates, no merges). Do not delete the runtime state or candidate branches; they are the recovery source.
- Clear MergeSpan state before resuming Mergify:
- settle any in-flight squash (wait for it to complete or fail; do not start Mergify on the same PR);
- explicitly dequeue any parked candidate (
@mergespan dequeueor removequeue/urgentmanually); - verify the queue is stopped and labels are cleared in the console;
- only then resume the old queue (enable Mergify’s previous configuration, including its bypass actor if your rulesets require it).
- Remove
queuelabels only from pull requests you are handing back. Do not remove labels from a pull request whose squash is already in flight; wait for the merge to settle. - Confirm no MergeSpan candidate is active in the console. If one is verifying, either let it finish or pause and wait; do not start Mergify on the same PR.
- Re-enable Mergify with its previous configuration, including its bypass actor if your rulesets require it.
- Remove MergeSpan’s required check from the base branch ruleset and remove the
mergespan/queue/**ownership rule only after no candidate branches remain. Keeping the ruleset while MergeSpan is paused is harmless; removing it too early lets other actors write to queue branches. - Keep MergeSpan installed but paused during the observation window. Re-enabling it later requires only unpausing; reinitializing is not required because the durable state remains. Uninstalling the App is a cutover, not a pause: it stops observation, so clear queue labels before doing it.
- Do not reinstall the App or delete the database as a diagnostic. The database, labels, and branches are the recovery source.
Rollback limits
- A squash merge already issued cannot be cancelled by
dequeueor by pausing. Check the pull request state before switching queues. - MergeSpan does not migrate Mergify history, analytics, or queue positions.
- If you remove the
mergespanrequired check while candidate branches still exist, GitHub may allow a human to merge a pull request that MergeSpan was verifying. Remove the check only after the pause is observed and no candidate is active. - If Mergify’s old bypass actor is restored, make sure the base branch’s required
mergespancheck is removed first; otherwise Mergify may be blocked by a check only MergeSpan satisfies.