Decoding Excellence Part-I: Capillary’s “DevCompanion” and the Art of PR Mastery with ChatGPT

Bony Mondal
Capillary Technologies
4 min readApr 5, 2024

Capillary Technologies, a B2B SaaS platform, is dedicated to offering intelligent technology solutions that drive business growth and foster enduring customer relationships. The management of extensive product portfolios and adherence to high coding standards are crucial aspects of our operations. To expedite the code review process and enhance overall efficiency, we explored the integration of OpenAI ChatGPT into our workflow. This blog post delves into our journey of implementing DevCompanion, a solution aimed at seamlessly incorporating ChatGPT into our code review process.

What is DevCompanion?

Positioned as a companion to developers for streamlined development, DevCompanion employs a script containing OpenAI API methods to retrieve and review responses. Additionally, we have developed a dedicated service that seamlessly manages requests from repositories, tightly integrated with GitHub. Operating on a Kubernetes cluster ensures scalability for efficient operations.

This application simplifies the processing of GitHub requests associated with raised Pull Requests (PRs), orchestrating the communication of essential details to OpenAI ChatGPT. The integration leverages the Language Model (LLM) to provide meaningful and insightful PR reviews.

Architecture Diagram:

Integration of DevCompanion with GitHub

Our integration process begins with the creation of a workflow (PR action) on the GitHub repository, triggered whenever a PR is raised to the base branch. The information from the PR is sent to our “DevCompanion” service, which runs the script file with the PR details. The reviewed response from OpenAI ChatGPT is then posted back to GitHub as a comment in the PR.

Choosing ChatGPT over various open-source tools

After researching various solutions, including open-source tools, we found that many did not align with our specific concerns or address particular issues. Opting for OpenAI ChatGPT, leveraging pre-trained Language Model (LLM) models, proved meaningful for conducting PR reviews and identifying Common Weakness Enumeration (CWE) issues. ChatGPT significantly contributes to identifying and resolving corner case issues through its recommendations

“Sample PR review generated from the DevCompanion.

The first PR review successfully identified a human error, while the second review detected a hardcoded string and the removal of a parameter from the caller function.

Logs for the DevCompanion review are accessible in the “call the wrapper service” section through GitHub Actions

These logs enable the prompt identification of any issues in transmitting Pull Request details to our DevCompanion.

Now let’s discuss how we are monitoring the metrics for the DevCompanion:

Metrics for DevCompanion are visualized in the Grafana dashboard, with data stored in our MySQL database. We monitor daily and overall cost expenditures incurred by OpenAI for input requests and upon completion.

Challenges and plans regarding the DevCompanion

With a focus on enhancing stability and robustness, we’ve outlined numerous plans for DevCompanion. Our aim is to ensure that PR reviews become more meaningful, thereby contributing to the overall stability of our technology stack.

What is the extent of efficiency improvement, and what is the overall reduction in time achieved?

The implementation of DevCompanion has notably optimized our workflow, significantly diminishing the time previously spent on manual PR reviews, which typically ranged from ~2 to 3 hours. While it doesn’t entirely replace manual reviews, DevCompanion effectively addresses basic coding practices and identifies overlooked issues. This shift alleviates the burden of manual scrutiny, enabling developers to concentrate on the logical aspect of coding. As a result, PR review time has been substantially reduced, allowing for enhanced efficiency and greater emphasis on core development tasks.

Conclusion

Streamlining PR Reviews with ChatGPT

The integration of ChatGPT for PR reviews has emerged as a game-changer, significantly reducing manual review time from hours to mere minutes. By leveraging its extensive dataset, ChatGPT effectively identifies errors and provides insightful recommendations, enhancing the efficiency of the code review process. This streamlined approach not only accelerates development cycles but also empowers developers to focus more on coding, thereby fostering overall productivity and innovation within the organization.

The Multifaceted Role of AI in Organizational Growth

The successful implementation of DevCompanion underscores the multifaceted role of AI in driving organizational growth. By harnessing AI capabilities, such as ChatGPT, companies can overcome challenges in maintaining code quality and fostering innovation. Beyond streamlining PR reviews, AI empowers organizations to establish stable technology stacks, navigate complexities of growth, and ultimately, achieve resilience and technological advancement. Embracing AI represents a strategic investment in the future, paving the way for continuous evolution and success in a rapidly changing landscape.

“The 2nd part of this series will cover some of the challenges in the current approach and respective solutions.”

--

--