Blog News Troubleshoot delays with our Code Review Analytics tool
March 18, 2020
4 min read

Troubleshoot delays with our Code Review Analytics tool

Introduced in GitLab 12.7, Code Review Analytics can help you dig deeper into slow-moving merge requests.

code_review_analytics.png

Modern software development moves fast. Development teams can fix issues and have a release deployed to customers within minutes, all fed through a continuous testing, build, and deployment process. Thanks to containerization, development teams can experiment with new techniques and technologies for particular application services, without affecting an application as a whole.

But with this speed and potential pace of change, it's easy to lose sight of what matters: Are any of these changes important for customers and their needs, or do they bring any business value? This is what Value Stream Analytics hopes to answer.

Drawing on lessons learned from the lean movement, delivery teams, engineering managers, and directors are applying "value stream mapping" to understand and optimize delivery of value, from the time an idea is born to its impact on the business in production. GitLab's analytics capabilities provide near real-time insights into the flow of value through the team's value stream without requiring complex system integrations, configuration, or add-on tools.

At the highest project overview level Value Stream Analytics (since GitLab 12.3, and previously called "cycle analytics") helps measure the velocity of development cycles in your team, and the time it takes them from planning to monitoring for each project. Currently, it tracks the seven stages to make calculations, and the associated feature:

  • Issue (Tracker): Time to schedule an issue (by milestone or by adding it to an issue board)
  • Plan (Board): Time to first commit
  • Code (IDE): Time to create a merge request
  • Test (CI): Time it takes GitLab CI/CD to test your code
  • Review (Merge Request/MR): Time spent on code review. Measures the median time taken to review the merge request that has the closing issue pattern, between its creation and until it's merged.
  • Staging (Continuous Deployment): Time between merging and deploying to production
  • Total (Total): Total lifecycle time. That is the velocity of the project or team. Previously known as production.

If the Value Stream Analytics feature shows that reviews are your team's most time-consuming step or your team agrees that code review is moving too slowly, then it's time to dig deeper. GitLab 12.7 introduced Code Review Analytics to help you dig deeper into slow-moving merge requests and understand what is causing delays.

In our 2019 and 2020 developer surveys, delays in code review featured near the top of developer process painpoints. Code review is not as time consuming as testing (the unanimous winner in 2019 and 2020), but respondents aknowledged they need more help to speed up the code reviews. This initial release of Code Review Analytics is a first step toward providing greater insight into delays and bottlenecks during the code review process.

You can find the Code Review dashboard under the menu for your project, then Project Analytics > Code Review. The view is a table of open merge requests with at least one non-author comment, and review time is measured from the first non-author comment. You can also see a summary of the changes introduced by the merge request, the number of comments, commits, and the approvers needed. The default sort order is from the oldest merge request, but you can filter results using the search box above the table. By highlighting aged Code Reviews, teams are encouraged to complete work-in-process rather than picking up new items from the backlog and to dispose of the "inventory" waste of unmerged commits.

Code analytics dashboard

Clicking the title of the merge request takes you to a normal merge request view where you can recap the discussions and activity so far to debug problems such as:

  • If there are many comments or commits, perhaps the code is too complex.
  • If a particular author is involved, maybe more training is required.
  • If no or few comments and approvers appear, your team may be understaffed or may be in the habit of starting new work instead of assisting teammates to close MRs and deliver features.

We will be bringing improvements and more features to code review analytics over the coming months, and in the meantime we welcome your feedback.

About the guest author

Chris is a freelance technical communicator for numerous developer-focused companies. Happy creating text, videos, courses, and interactive learning experiences, in his spare time he writes games and interactive fiction.

We want to hear from you

Enjoyed reading this blog post or have questions or feedback? Share your thoughts by creating a new topic in the GitLab community forum. Share your feedback

Ready to get started?

See what your team could do with a unified DevSecOps Platform.

Get free trial

New to GitLab and not sure where to start?

Get started guide

Learn about what GitLab can do for your team

Talk to an expert