惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
M
MIT News - Artificial intelligence
量子位
N
Netflix TechBlog - Medium
The Cloudflare Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
B
Blog
博客园_首页
博客园 - Franky
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
H
Help Net Security
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell

Graphite blog

Introducing Code Tours: a new way to review Introducing Cursor Cloud Agents in Graphite Building the future of software development with Cursor Reimagining the PR Page: Designing for speed and focus Graphite changelog [11-20-2025] Graphite changelog [11-04-2025] Graphite changelog [10-16-2025] The future of engineering is collaborative (and already here) Meet Graphite Agent: the next evolution of AI code review Introducing frozen branches: A safer way to build on your teammates’ work Graphite changelog [09-17-2025] How we sped up code search for Graphite Chat Introducing Graphite Chat AI is writing code—here's why it also needs to review that code How I got Claude to write code I could actually ship How we built the first stack-aware merge queue (and why it matters) How we organize our monorepo to ship fast Graphite brings stacking to Tower Code review tooling: Should you build or buy? Making AI code review available to everyone Introducing: The new Graphite + Linear integration Graphite raises $52M and launches Diamond to reimagine code review for the age of AI Why AI will never replace human code review How stacked PRs unblock distributed development teams Graphite is going to Developer Week 2025 Beating the end of year code freeze How Graphite’s eng team ships code remarkably fast Why we chose Anthropic's Claude to power Graphite Reviewer AI code generation will remain fragmented How we redesigned Graphite's landing page in-house
Cheaper CI & faster merging with batching
Stephen Pink · 2024-05-09 · via Graphite blog

For the fourth day of launch week, we wanted to stay with the theme of shipping top asks from our largest and fastest-moving Graphite customers. Many of these most productive teams use Graphite’s merge queue to automate and speed up their merge process while keeping their trunk branches green. Today we’re excited to announce one of our most highly-requested merge queue features: batch merging.

Batching enables higher throughput and lower CI costs

As your team starts using a merge queue to keep your trunk branch green and/or merge stacks faster, it’s important to make sure your queue doesn’t slow down your releases or balloon your CI costs.

Batching is a workflow where the merge queue groups several to-be-merged PRs together into a temporary combined PR, runs CI on it, and then merges all of them together if everything passes. If something goes wrong, the merge queue can bisect the batch and help you find the breaking change.

Batching is an effective strategy for both handling a higher volume of PRs and reducing CI spend. You can customize the batch size for each repo depending on your desired throughput.

Picking the right merge strategy for your repo

We previously shipped Parallel CI to also increase merge queue throughput, and have seen customers able to reduce their merge times to approximately equal the time it takes to run CI on a single pull request. Parallel CI also ensures every PR and stack individually passes CI, ensuring that every commit on main is “green” and safe to revert to.

Batch merging takes a different approach: relaxing the requirement for correctness on every single commit in the batch in favor of reducing overall CI runs (and costs) and enabling more throughput. Batching still ensures that all tests are passing at head on your trunk branch after the batch merges, but you shouldn’t turn on batching if you require every single commit in history to build correctly. However, for most fast-moving teams, trading off perfect revert-ability for significantly faster queue times and lower CI costs is worthwhile.

How batch merging works

Batch merging relies heavily on two concepts: draft PRs and fast-forward merge. Imagine you have five stacks queued to merge, and your batch size is four (configurable in your merge queue settings):

  1. The Graphite merge queue will create a single draft PR that contains stack #4 rebased onto stack #3 rebased onto stack #2, which is finally rebased onto stack #1.

  2. Once we create this draft PR, the merge queue now waits for CI to run on it.

  3. ✅ If CI passes, the merge queue will simply update main to point to the HEAD commit hash of this draft PR (performing a fast-forward merge). Fast forward merge is great because it allows us to merge several PRs into main in a single operation. We simply update main to be the commit hash for the draft PR.

  4. ❌ If CI fails, keep on reading…

What happens when there is an error in a batch?

The Graphite merge queue has two options for what to do when a batch fails CI:

  1. Remove the entire batch from the queue and have PR authors isolate the issue and re-queue their PRs.

  2. Bisect and find the culprit PR/stack, and add every other PR/stack in the batch back to to the queue (coming soon).

Getting started with merge queue batching

Merge queue batching is currently in public beta. Enable it in your merge queue settings!

Related articles