RhodeCode Enterprise comes with a lot of powerful features for collaborative software engineering. In this blog article I provide an overview of the typical code review process and explain best practices for large scale environments.
The code review process has three major steps:
- Locate and Open Changes Made after your Last Review
- Review Code Changes and Mark Issues
- Approve or Disapprove Code Changes
1. Locate Changes Made After Your Last Review
The easiest way to begin your code review is to start off where you left the last time. The code approval system leaves a circle shaped icon next to each commit reviewed. We recommend to use the "Change Log" to quickly browse between all revisions and find unreviewed commits.
- Open the repository which you want to review
- Select "Graph Log" in right corner of the sub-navigation
- Find the last reviewed commit (track the coloured circle icon next to the author name)
- Open the first unreviewed commit by clicking on the commit message or revision number
2. Review Changes and Mark Issues
RhodeCode Enterprise displays all code changes made in your commit in a helpful file by file view. Each changed file is displayed separately and changed elements are highlighted to grasp your attention. Removals are highlighted in red and additions / new code lines are highlighted in green. The basic overview is ideal for quick and easy code reviews. It provides a narrow view on the changed text lines and displays only a small context to remove any distractions.
More complex code changes may require to read through the whole file and are ideally reviewed in the very useful Side-By-Side Diff. Side-By-Side Diffs display the old and the new version of a file in a split screen and the scrolling between the two file version is synchronised. File changes are highlighted on the scrollbar to quickly navigate through the file which is very helpful for large scale files.
How to Mark Code Issues
During code review you can click on any line in your text file and leave an inline comment to pinpoint issues directly where they are in the code. This allows you to leave feedback, suggest improvements, pinpoint further issues or delegate next steps to solve the issue. The best way to delegate actions is to use the Mention function. Type @Username in the inline comment and the user will receive a notification. This helps to quickly and efficiently leave proper feedback in your code reviews and will help improving the overall code quality.
3. Approve / Disapprove Code Changes
As part of the code review system RhodeCode provides the option to approve changes made in each changeset. All users with suitable permissions can change the review status of an update. Select 'Change changeset status' at the bottom of an update / changeset to use the approval function.
A traffic light system helps you to leave a final assessment on the code update. The review status will be displayed next to the update which provides a quick followup on recent reviews and helps your team to improve the code quality.
Please notice:
Proper deployment automation is tough but RhodeCode's API will help you. The approval state of each commit can be accessed via API. We highly recommend to use the API to automate follow up processes like continuous integration checks and deployment mechanisms.
Please contact us for feedback and check out more articles about code review and how to use RhodeCode Enterprise at our knowledge base. Thanks!
Thomas