Are code reviews a bottleneck in your delivery pipeline?
According to our global data, elite teams — defined as the top 10% of engineering organizations — review pull requests less than a day after opening them.
If it takes your team days or weeks to get their pull requests reviewed, code reviews are likely a bottleneck in the software delivery life cycle.
Slow code reviews lead to costly delays. Pull requests become stale, leading to complex merge conflicts and large backlogs of work. As engineers wait for reviews, they may also delay important work that depends on getting their open pull requests reviewed and merged.
More efficient code reviews provide engineers with faster feedback on their work and unblock them so they can move on to their next most important tasks. They can spend less time reworking outdated pull requests, bugging their team for reviews, and waiting on feedback — and more time on work that matters.
Here’s how to get started measuring and improving review time.
Monitor your code review process
Slow code reviews are often hidden bottlenecks for teams, who can’t easily see if there is a backlog of pull requests that need to be reviewed and merged.
Monitors provide you with an early warning to take action when code reviews are taking longer than normal to review, approve, or merge.
Specifically, monitors can alert you when the average pull request review time — the time elapsed between opening a pull request and the first review — exceeds a certain threshold that you can customize (e.g. 24 hours). Alerts are automatically sent by Slack or email at specific times every day, week, or month.
When teams are alerted to potential bottlenecks, they can focus their efforts on reviewing open pull requests and unblocking their team.
Stay ahead of slow code reviews
To prevent slow code reviews, you can proactively monitor Pull Request Age — the time that a pull request has been open.
If you get an alert about pull request review time exceeding a threshold, you can pinpoint your biggest blockers by exploring your team’s pull requests to determine which have been open the longest. These pull requests can create bottlenecks because they are more likely to become stale, require rework, or lead to painful merge conflicts.
We built a Lead Time Dashboard to help teams uncover which pull requests are causing delays and prioritizing reviews.
Making improvements to code reviews
While monitors alert you to immediate bottlenecks in your development pipeline, digging into your DevOps metrics and trends will help you improve efficiency over the long-term.
If code reviews are consistently burdensome or time-consuming, you can experiment with more significant changes to your review process:
- Smaller pull requests are easier and faster to review. They are less complex for reviewers and contain only a single unit of work.
- Annotated pull requests guide reviewers through changes faster. They explain the motivations behind their changes and provide context to other team members.
- Checklists eliminate frequent errors. They also provide clear expectations for anyone opening a pull request.
- Better tooling can streamline the review process. GitHub’s Pull Requests and Issues extension makes it easy to review and manage your GitHub pull requests and issues directly in VS Code. Better linters and automated checks can remove manual work from the review process.
By establishing a baseline for your team, you can better understand the impact of improvements to the review process. As you experiment with new tools or workflows, you can measure how those changes streamline your team’s code reviews.
Getting started
Making code reviews more efficient is often an important step toward improving your team’s overall development velocity.
With better data and alerts around review time, you can empower your team to prioritize and streamline their code reviews — making them less stressful and more collaborative.