-
-
PR Pal installed in Jira workspace.
-
Logs from Forge app captured during the demo.
-
Sample Jira issue previously created from testing demonstrating how Open AI picked up on some advanced coding topics.
-
Sample Jira issue created during Demo.
-
Pull request with requested changed by PR Pal.
-
BitBucket webhook configuration to point to the Forge app.
Inspiration
The inspiration for this project comes from the everyday work as software engineers. Part of our job is reviewing other people's code. Sometimes, this is a painless process. Other times, it's a daunting task. We've all looked at code that looks code, maybe added a comment or two to fix things that are incorrect and we've also missed many things that should have been called out in the review. We only notice it when we update our local repository with code from the remote repository and we start seeing issues in code that we thought was reviewed. I personally have this experience at least once a week. I look at code that I reviewed recently only to find issues that I missed and end up getting side tracked to fix these issues or assign them to the original developer. With PR Pal, those days are long gone.
What it does
PR Pal is an event driven Jira app powered by Open AI that is the first line of defense against bad code. What's better than having a code reviewer? An AI powered code reviewer that's been trained on endless data to get it right. The flow starts with creating a pull request in BitBucket. When the PR is created or modified, a webhook event is fired with the PR info to PR Pal which has a webtrigger listening for events. The event then gets parsed and the link to the diff is extracted. PR Pal then calls a proxy service (hosted in Azure) to retrieve the raw diff info from BitBucket. The diff is then fed into Open AI using the gpt-4 model and a custom prompt fine tuned to call out issues in the modified code. Once Open AI interprets the code, it returns a response in JSON format which includes some basic info about the diff and if the modified code contains any issues. If the code does contain issues, a ticket is automatically created in Jira with the relevant PR info.
How we built it
The Jira app is built in forge and uses a webtrigger to receive webhook events from BitBucket. The proxy services that retrieves the diff info from BitBucket is a simple REST API that is hosted in Azure.
Challenges we ran into
The main challenge was connecting BitBucket to the Forge app and retrieving data from the Forge app. Since there is an issue with mixing permissions/scopes of Jira and BitBucket in the same app, we needed to build a proxy service that we could call to retrieve the diff info from BitBucket. The service accepts the diff URL from the webhook event that was sent to the Forge app, retrieves the raw diff from BitBucket, and the response is sent back to the Forge app to continue processing.
Accomplishments that we're proud of
What we learned
The Forge platform is very powerful for extending Jira and BitBucket. I was not aware of how beneficial it could be to build apps that can help with day to day and repetitive tasks that can sometimes be a bit mundane for developers. We also learned that the prompt for Open AI needs to be very specific. We spent a lot of time trying out ~50 different variations of what would be the final prompt that we were satisfied with for this project. The prompt itself can still be improved but after many rounds of testing, we were happy with the results it was producing.
What's next for PR Pal
It would be great to fine tune the AI component to return more accurate results. Sometimes, Open AI returns a result that is unexpected or inaccurate or unexpected. We'd also like to expand the functionality to be more interactive with PR's. Rather than just requesting changes, the app would be able to comment on the exact lines of code having issues and potentially even adding suggestions to the PR for the developer to have an easy way to fix the issue.
Built With
- asp.net
- forge
- javascript
- openai

Log in or sign up for Devpost to join the conversation.