Data report"State of code review 2024" is now liveRead the full report
External merge queue integration (beta)
Learn how to use Graphite with your existing external merge queue.

If you already use a separate, external merge queue offering, Graphite can integrate with that merge queue, reducing the manual work required to merge stacks of PRs.

Graphite's integration will:

  • Merge PRs one-by-one by enqueueing them in your merge queue

  • Automatically rebase PRs before adding them to the merge queue, as necessary

This offers a quick and seamless way to onboard your team to Graphite when you're already using an external merge queue.

Unlike Graphite's merge queue, external merge queues don't use stack context to optimize merges, so you won't benefit from the same performance boosts and guarantees available with the Graphite merge queue.

In particular, with external merge queues Graphite can only merge PRs one at a time: for a stack of PRs ABC, where A is the base PR

  • A will be added to the queue

  • Only when A is successfully merged will Graphite rebase B and then add B to the queue

  • Repeat for C

If you use the GitHub merge queue, no additional setup is required.

When you navigate to a PR on Graphite, Graphite will detect that the PR's repository uses the GitHub merge queue and adjust the merge behavior accordingly.

To merge, click the "Merge when ready" toggle in the top right of the page.

When a PR is the first open PR in the stack and has "Merge when ready" active, Graphite will then add the PR to your GitHub merge queue.

If you use a merge queue outside of the Graphite or GitHub merge queues, Graphite can be configured to add PR to your queue by applying a custom label to the PR.

Note: if you merge PRs with your merge queue another way, such as running CLI commands or calling an API, Graphite won't be able to merge your PRs for you.

Go to Merge queue in the Graphite app settings page (https://app.graphite.dev/settings/merge-queue), and:

  1. Click Add merge queue

  2. Select the repository you want to enable it for by using the dropdown selector

  3. Select External merge queue integration as the merge queue type

  4. Click Next to specify your merge label and save your merge queue settings

Once you've completed the configuration steps above, PRs created in that repo can now be merged via your merge queue.

  • For single PRs, and base PRs in a stack: the merge button is replaced with an "Apply merge label" button that immediately applies the merge label

  • For upstack PRs: the merge button is replaced with an "Apply merge label when ready" button that acts as follows: for a stack of PRs ABC, where A is the base PR:

    • A immediately receives your repo's merge label, handing off merging to your merge queue

    • When A is successfully merged, Graphite rebases B, and upon succeeding applies your repo's merge label. If the rebase fails, Graphite informs the author as usual.

    • It repeats the process for B, and so forth for larger stacks.

During the merge process, the PR status for each PR will communicate if the PR is actively waiting on downstack merges, or if the merge has been handed off to your merge queue.

To track enqueued PRs in your PR inbox, you can create a section with the following settings:

Many merge queues represent merge failures by adding a label denoting that the PR is blocked. You can create a section to track these with the following settings:

  • PRs getting evicted while enqueued: once you mark as a stack as ready to merge, re-stacking those PRs when they're already in your merge queue may result in your merge queue evicting them due to making changes. You may want to avoid re-stacking a PR while your merge queue is processing it.

  • Handling failed merges: your merge queue may take actions like adding a "blocked" label on PRs that failed to merge. To re-enqueue after fixing the issues, manually remove the custom label.

Stay unblocked. Ship faster.
Experience the new developer workflow - create, review, and merge code continuously. Get started with one command.
Learn more

Give your PR workflow
an upgrade today

Stack easier | Ship smaller | Review quicker

Or install our CLI.
Product Screenshot 1
Product Screenshot 2