Cycle Time Breakdown: Minimizing PR Review Time

Cycle time is a critical metric that assesses the efficiency of your development process and captures the total time taken from the first commit to when the PR is merged or closed. 

PR Review Time is the third stage i.e. the time taken from the Pull Request creation until it gets merged or closed. Efficiently reducing PR Review is crucial for optimizing the development workflow. 

In this blog post, we'll explore strategies to effectively manage and reduce review time to boost your team's productivity and success.

What is Cycle Time?

Cycle time is a crucial metric that measures the average time PR spends in all stages of the development pipeline. These stages are: 

  • The Coding time represents the time taken to write and complete the code changes.
  • The Pickup time denotes the time spent before a pull request is assigned for review.
  • The Review time encompasses the time taken for peer review and feedback on the pull request.
  • The Merge time shows the duration from the approval of the pull request to its integration into the main codebase.

A shorter cycle time indicates an optimized process and highly efficient teams. This can be correlated with higher stability and enables the team to identify bottlenecks and quickly respond to issues with change. 

Why Measuring Cycle Time Matters? 

  • PR cycle time allows software development teams to understand how efficiently they are working. Low cycle time indicates a faster review process and quick integrations of code changes, leading to a high level of efficiency. 
  • Measuring cycle time helps to identify stages in the development process where work is getting stuck or delayed. This allows teams to pinpoint bottlenecks and areas that require attention. 
  • Monitoring PR Cycle Time regularly informs process improvements. Hence, helping teams create and implement more effective and streamlined workflows.
  • Cycle time fosters continuous improvement. This enables them to adapt to changing requirements more quickly, maintain a high level of productivity, and ship products faster. 
  • Cycle time allows better forecasting and planning which allows engineering teams to estimate project timelines regularly and manage stakeholder expectations.  

What is PR Review Time? 

The PR Review Time encompasses the time taken for peer review and feedback on the pull request. It is a critical component of PR Cycle Time that represents the duration of a Pull Request (PR) spent in the review stage before it is approved and merged. Review time is essential for understanding the efficiency of the code review process within a development team.

Conducting code reviews as frequently as possible is crucial for a team that strives for ongoing improvement. Ideally, code should be reviewed in near real-time, with a maximum time frame of 2 days for completion.

If your review time is high, the platform will display the review time as red - 

How to Identify High Review Time?

Long reviews can be identifed in the "Pull Request" tab and see all the open PRs.

You can also identify all the PRs having a high cycle time by clicking on view PRs in the cycle time card. 

See all the pending reviews in the “Pull Request” and identify them with the oldest review in sequence. 

Causes of High Review Time

Unawareness of the PR being issued

It's common for teams to experience communication breakdowns, even the most proficient ones. To address this issue, we suggest utilizing typo's Slack alerts to monitor requests that are left hanging. This feature allows channels to receive notifications only after a specific time period (12 hrs as default) has passed, which can be customized to your preference.

Another helpful practice is assigning a reviewer to work alongside developers, particularly those new to the team. Additionally, we encourage the team to utilize personal Slack alerts, which will directly notify them when they are assigned to review a code.

Large PRs

When a team is swamped with work, extensive pull requests may also be left unattended if reviewing them requires significant time. To avoid this issue, it's recommended to break down tasks into shorter and faster iterations. This approach not only reduces cycle time but also helps to accelerate the pickup time for code reviews.

Team is diverted to other work

When a bug is discovered that requires a patch to be made, a high-priority feature comes down from the CEO. In such situations, countless unexpected events may demand immediate attention, causing other ongoing work, including code reviews, to take a back seat.

Too much WIP

Code reviews are frequently deprioritized in favor of other tasks, such as creating pull requests with your own changes. This behavior is often a result of engineers misunderstanding how reviews fit into the broader software development lifecycle (SDLC). However, it's important to recognize that code waiting for review is essentially at the finish line, ready to be incorporated and provide value. Every hour that a review is delayed means one less hour of improvement that the new code could bring to the application.

Too few people are assigned to do reviews

Certain teams restrict the number of individuals who can conduct PR reviews, typically reserving this task for senior members. While this approach is well-intentioned and ensures that only top-tier code is released into production, it can create significant bottlenecks, with review requests accumulating on the desks of just one or a few people. This ultimately results in slower cycle times, even if it improves code quality.

Ways to Reduce Review Time

Here are some steps on how you can monitor and reduce your review time

Set Goals for the review time

With typo, you can set the goal to keep the review time under 24 hrs recommended by us. After setting the goal, the system sends personal Slack real-time alerts when PRs are assigned to be reviewed. 

Focus on high-priority items

Prioritize the critical functionalities and high-risk areas of the software during the review, as they are more likely to have significant issues. This can help you focus on the most critical items first and reduce review time.

Regular code reviews 

Conduct code reviews frequently to catch and fix issues early on in the development cycle. This ensures that issues are identified and resolved quickly, rather than waiting until the end of the development cycle.

Create standards and guidelines 

Establish coding standards and guidelines to ensure consistency in the codebase, which can help to identify potential issues more efficiently. Keep a close tab on the following metrics that can impact your review time  - 

  • PR merged w/o review
  • Pickup time
  • PR size

Effective communication 

Ensure that there is clear communication among the development team and stakeholders to quickly identify issues and resolve them timely. 

Conduct peer reviews 

Peer reviews can help catch issues that may have been missed during individual code reviews. By having team members review each other's code, you can ensure that all issues are caught and resolved quickly.

Conclusion

Minimizing PR review time is crucial for enhancing the team's overall productivity and efficient development workflow. By implementing these, organizations can significantly reduce cycle times and enable faster delivery of high-quality code. Prioritizing these practices will lead to continuous improvement and greater success in software development process.