Post-Commit Reviews

Pre-Commit Code Review Workflows

Code Reviews and Developer Velocity

There are myriad benefits to code review. As a 2016 paper from Microsoft details:

  • turnaround time for code review is in the order of a few seconds

Post-Commit Reviews

An alternative to pre-commit reviews is post-commit reviews, which lets a developer merge changes to trunk, and address reviewer comments in follow-up pull requests.

Post-Commit Reviews != Post-Deployment Reviews

It’s a commonly held misconception that post-commit reviews automatically means post-deploy reviews — i.e., code being reviewed after it’s deployed. This doesn’t necessarily have to be the case.

Post-Commit Pre-Deploy Reviews
  • or in cases where it’s not necessary for an audit-trail or mandatory sign-off on changes (for prototype projects, internal tools that don’t handle customer sensitive data and so forth), for code review to happen post-deployment.

Benefits of Post-Commit Reviews

Focus

By far and away, the biggest benefit of post-commit reviews is developer focus.

Encourages Better Development Practices

There’s a case to be made for the fact that post-commit reviews encourage better development practices.

  • consensus around aspects like style-guide, coding idioms, concurrency primitives etc.
  • investment in better automation practices and tooling.

Post-Commit Reviews Can Detect More Bugs Before Code Review

Often, code is only merged to trunk once all unit-tests have passed. This is no different for post-commit reviews than it’s for pre-commit reviews.

Challenges of Post-Commit Reviews

Post-commit reviews can provide many benefits but also pose some challenges.

High-Functioning, High-Trust Environments

Needless to say, post-commit reviews work best in teams where there’s a high degree of trust among the team members. Building trust and learning how to work well as a team takes time. It also poses unique challenges on how to onboard new team members or junior engineers, who might not be familiar enough with the problem domain, programming language, frameworks, tools, testing guidelines, or even the company’s CI/CD infrastructure to be able to adapt to a post-commit review culture right away.

Investment in Automation

The next requirement for fostering a successful “post-commit” review culture is a heavy investment in automation and monitoring infrastructure. Requiring developers to manually revert changes and work around merge conflicts if a commit proves to be problematic can undo almost all the gains in developer productivity a post-commit review culture brings in the first place. Reverting commits needs to be automated, which requires close integration between the testing infrastructure and the source control management (SCM) tool.

Conclusion

Walking the tightrope between developer productivity and high quality code is always going to be a challenging undertaking, requiring smart choices and tradeoffs. Iteration speed of developers can be improved by either flavor of post-commit reviews, viz.,

  • post-commit, post-deploy reviews

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cindy Sridharan

Cindy Sridharan

@copyconstruct on Twitter. views expressed on this blog are solely mine, not those of present or past employers.