Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.toml and 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 conceptMergeSpan equivalentNotes
One queue for a base branchOptional .github/mergespan.toml with basev0.1 supports one base branch (bootstrapped from main). Without the file, the base is inferred as main.
Queue entry label / conditionqueue_label (default queue)MergeSpan uses a label, not a condition expression. Fileless setups use queue.
merge_method: squashAlways squashv0.1 has no merge-method setting.
Required checks after the PR is up to daterequired_checks, or inferred from active base rulesetsExact 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 labelurgent_label (default urgent)Only a binary urgent label; no priority rule engine. Fileless setups use urgent.
Queue timeouttimeout_minutesApplies to candidate validation, not queue wait. Fileless default is 60 minutes.
Branch protection / ruleset check injectionManual rulesetsMergeSpan 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 featureStatus in MergeSpan v0.1What to do instead
Multiple queue_rules per repositoryNot supportedUse one repository/base per queue, or split repositories.
Multiple target bases in one installationNot supportedOne queue per repository/base.
Batching (batch_size, merge batches)Not supportedMergeSpan verifies one PR at a time.
Parallel/speculative checksNot supportedSerial verification only.
merge_method: merge, rebase, fast-forward, merge-batchNot supportedSquash only.
priority_rules / rich priority expressionsNot supportedOnly the urgent label, applied manually.
auto_merge_conditionsNot supportedAdd 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 supportedKeep equivalent GitHub Actions or branch protection. MergeSpan does not run a general rule engine.
merge_protections / custom merge protectionsNot supportedEncode requirements as required checks or ruleset rules.
commands_restrictionsNot supportedComment commands require repository write access; there is no per-user allowlist.
Fork pull request queueingNot supported (runtime requires same_repo_only = true)Fork PRs stay out of the queue.
Queue branch prefix customizationNot supportedFixed mergespan/queue/<number>.
Mergify dashboard analytics / wait-time historyPartialMergeSpan 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 mergespan check; 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 --auto bypasses MergeSpan’s candidate check. This is an operational rule, not a repository setting MergeSpan can enforce.

Migration sequence

  1. Inventory .mergify.yml:
    • every queue_rules entry,
    • every merge_method,
    • batch_size / parallel settings,
    • priority_rules,
    • pull_request_rules that queue or merge,
    • merge_protections.
  2. 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.
  3. Prepare the repository before installing MergeSpan:
    • Add the verification workflow to the base branch. It must run on push to mergespan/queue/** with github.event.created == false; see Configuration → Verification workflow requirements.
    • Create the labels you will use (default queue and urgent), 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; the mergespan gate is excluded.
    • Prepare the mergespan/queue/** ruleset: restrict creations, updates, and deletions to the MergeSpan App; no human bypass.
    • Optionally add .github/mergespan.toml with the verified labels, checks, and same_repo_only = true, then merge it to the base branch. If you skip the file, inference uses base main and 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.
  4. Drain and stop Mergify before installation:
    • Disable automatic queueing / remove queue_rules from 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 (queue and urgent, or your custom names) from every open pull request so MergeSpan cannot pick them up at installation.
  5. 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 mergespan check 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.
  6. 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_loaded before labeling anything.
  7. Verify with one non-draft pull request:
    • add the configured queue label (default queue);
    • expect a mergespan check, mergespan/queue/<n>, checks on C, squash merge, branch deletion;
    • check the console event timeline.
  8. Retire the old guards and bypass actors listed above only after step 7 succeeds and no MergeSpan candidate branches remain.
  9. 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:

  1. 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.
  2. 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 dequeue or remove queue/urgent manually);
    • 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).
  3. Remove queue labels 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.
  4. 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.
  5. Re-enable Mergify with its previous configuration, including its bypass actor if your rulesets require it.
  6. 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.
  7. 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.
  8. 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 dequeue or by pausing. Check the pull request state before switching queues.
  • MergeSpan does not migrate Mergify history, analytics, or queue positions.
  • If you remove the mergespan required 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 mergespan check is removed first; otherwise Mergify may be blocked by a check only MergeSpan satisfies.

References