Create
cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 
Sign up Log in

AI-Powered Code Reviews at Codegeist 2023 πŸš€πŸ‘©β€πŸ’»πŸ”

Introduction πŸŒ

In today's tech world, AI's role is clear. We've faced challenges in explaining code changes to teammates unfamiliar with certain aspects or realizing some parts of our code could be better. These moments showed us how AI can make code reviews easier. 
We improved this process for our team and are excited to share it with other developers, and also submit our work to Codegeist Unleashed 2023, as a great opportunity to share our app with a broader audience.

 

What It Does πŸ› οΈ

It allows you to ask questions related to your Pull Request to an AI that knows all about its context (commits, code changes, etc). The key value is you do not need to provide context explicitly, it already knows! This great assistant is not just about explaining code modifications but also suggests code enhancements and scans for potential vulnerabilities.



comment-response.png

1. Ask AI Buddy to improve the code in your Pull Request, and it will help you immediately. 



config.png

2. You can configure your OpenAI mode to use, and even customize the promt that is being sent. 



ai-chat.png

3. Additionally, you can use the Chat feature to ask your questions to the AI without  creating PR comments that everybody can see. 

 

How We Built It  πŸ—οΈ

 

Our fondness for Scala inspired us to craft our app using ScalaJS for Forge. The entirety of our app’s source, both the backend and the CustomUI frontend, is developed in Scala. This code is then transpiled into JavaScript for Forge's consumption.

However, our journey wasn't without its challenges:

  • Without type information, Scala is hard to write. Therefore, we used ScalablyTyped to translate the TypeScript type definitions to Scala type definitions. It works for most Forge APIs.
  • The time limits imposed by Forge are a challenge, as the AI processing can take a long time. We used a Forge Queue/Events to give us a higher limit. However, it sometimes still runs into timeouts.
  • For the CustomUI, we're also using ScalaJS with vite.js for quickly reloading code changes.



Challenges we ran into πŸš§

 

Transferring the context to the AI, ensuring it brings an actual value added to a Pull Request, was arguably our most significant challenge. That challenge was 2-fold:

  • complying with the payload size limit accepted by the OpenAI API
  • providing the context in a format properly processed by the model

 

Accomplishments We're Proud Of πŸ†

One of our crowning achievements is the inline comments feature. The AI recognizes your exact location in the code, offering precise insights. This proves invaluable when grappling with intricate code segments.

What We Learned πŸ“š

The AI's prowess in dissecting complex code and suggesting refactors was a revelation. Our initial testing phase yielded astoundingly relevant responses, fostering our belief that users will mirror our sentiments. However, a word of caution: while the AI's feedback on code security is often beneficial, it should be viewed critically and not as a replacement for established static code analysis tools.

 

What's Next for Mibex πŸš€

We will be adding this feature to one of our existing apps - Code Review Assistant. We invite you to explore its capabilities for your Data Center repositories. And stay tuned for our upcoming PR automation projects!

 

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events