This article is from Alibaba DevOps Practice Guide written by Alibaba Cloud Yunxiao Team
Code Review (CR) is a way for programmers to work in pairs and learn from each other. In the strict sense, CR can improve code quality, foster talent growth, and develop passions for technology.
First of all, code is an asset with liquidity. Generally, it takes about three to five years to maintain. During this process, the maintenance personnel may be replaced, or the code is referenced by other people. No one wants to maintain or reference lines of code that is messy Therefore, in addition to logic problems in programming, other problems in design, performance, security, and specifications can also be found through CR.
Secondly, CR is an opportunity for programmers to check each other’s code for errors and learn programming skills from each other. If core team members can participate in the daily architecture review, design review, and code review, they will help other’s R&D personnel grow, regardless of whether the R&D personnel is a new employee or an old employee in a bottleneck period. We expect that CR can enhance a team’s strengths. Meanwhile, CR involves interactive discussions on a specific issue or scenario between R&D engineers. Thus, it becomes the best way for engineers to improve their programming capabilities.
Finally, CR gradually becomes a developer culture of IT enterprises through the internal review practice of small teams. When an enterprise has a specific technical culture, it is crucial to help attract and develop talents.
As shown in the figure above, code review is divided into three phases: starting a review, review in progress, and ending a review.
In summary, the conventional code review process has the following major problems:
Alibaba's Code Platform Team uses the intelligent process control methods to solve the problems in the conventional review process and improve the review efficiency, as shown in the following figure:
Specifically, the review process is optimized from the following aspects:
Intelligent algorithms can recommend the most appropriate reviewers automatically. The automatic recommendation mechanism can reduce a large number of communication costs and quickly push the review process forward for large-sized applications and middle platform applications built across different teams.
The reviewer can analyze how long it may take for the current review to be completed by submitting the data, helping reviewers arrange their workloads reasonably. In addition, if a reviewer has multiple code review invitations at the same time, they can prioritize the review tasks based on the estimated required time.
git-repo is a client-side tool developed by Alibaba that allows you to directly initiate a code review request from a client. A review request can be created quickly on the client and browsed on a web browser. git-repo does not change the use habits of Git users but provides extensions to git commands.
In the conventional code review work model, code contributors push code to individual/feature branches and initiate a merged request on a browser page. The whole process goes through multiple steps, and developers must switch among different tools. With git-repo, as long as a user has the read permission on the repository, the user can run commands in the local workspace to contribute code to the server in the form of merged requests.
Alibaba is promoting the code review culture from top to bottom, requiring every developer to be responsible for their code and be a code reviewer to help other colleagues control the quality of published code. If developers want to do a good job in a review, in addition to useful tools, they also need to pay attention to the following points:
How to Apply Fine-Grained Security Control to a Container Platform Using Container Firewall
1,042 posts | 256 followers
FollowAlibaba Cloud Community - February 14, 2022
Alibaba Cloud Community - February 8, 2022
Alibaba Cloud Community - February 5, 2022
Alibaba Cloud Community - February 14, 2022
Alibaba Cloud Community - February 3, 2022
Alibaba Cloud Community - February 18, 2022
1,042 posts | 256 followers
FollowAccelerate software development and delivery by integrating DevOps with the cloud
Learn MoreAn enterprise-level continuous delivery tool.
Learn MoreA low-code development platform to make work easier
Learn MoreHelp enterprises build high-quality, stable mobile apps
Learn MoreMore Posts by Alibaba Cloud Community