With the popularity ChatGPT, it was only a matter of time before developers began to use this technology to automate manual processes that require a little more finesse, such as reviewing pull requests.  Pull requests are a common practice in software development, where developers submit their code changes to a shared repository for review and approval by other developers. This process helps ensure that the code is consistent, readable, and free of errors or bugs. However, doing this manually can be time-consuming and tedious, not to mention subjective.

This is where artificial intelligence can help. Using Open AI’s Generative Pre-Trained Transformer (GPT) models, AI-based pull request reviews aim to automate and improve the quality and efficiency of code reviews.

 

Benefits and Challenges

Since AI does not have human limitations, it can review code changes in seconds or minutes. These changes will be consistent, objective, and there will be improved code quality and security as a result. However, the decisions made by the AI are based upon a predetermined set of rules. These predefined rules may have some inherent bias or error due to biased data. In addition, while we as people have the capacity for nuance and context, AI doesn’t always capture this. For this reason, among others, there is still a need for human oversight and a need for humans to be able to intervene or override the AI’s decisions entirely.

Examples of AI-Based Pull Request Review Services

Several services are already making the leap forward into artificial intelligence-based pull request reviews. One such service is CodeRabbit. This service uses OpenAI’s most advanced system in order to review pull requests. CodeRabbit can also review code line-by-line and suggest changes, provide a summary and release notes of a pull request, and even allow for in-context conversation about the code. This service is intended to be used as a GitHub Action.

Another service is found as an extension to Azure Pipelines: GPT Pull Request Review. This extension has the option of using Azure Open AI service, but you can also choose which Open AI model you prefer. This extension is a task is your build definition and can be found in the Visual Studio Marketplace.

AI-based pull request reviews are a promising and exciting innovation that can transform the way developers write, review, and maintain code. For more information, or to get started today, contact our team of experts here at PRAKTIK.