The idea behind this app is to address one of the biggest bottlenecks in development teams: code reviews. Finding the right person to review a pull request quickly can be challenging, often leading to delays that slow down releases and impact collaboration. In open-source projects, the issue is even more critical—slow responses to contributor PRs can lead to disengagement and potentially losing valuable contributors. This app aims to improve the review assignment process, ensuring that PRs get the attention they need as soon as possible. The app will monitor new PRs through GitHub events or integration messages in Rocket.Chat and use a statistical scoring system to suggest the most suitable reviewer based on past review patterns. Once assigned, the app will send friendly but persistent reminders to ensure the review happens in a timely manner. Additionally, it will leverage AI-powered code review using specialized LLMs to catch minor issues before human reviewers step in, reducing unnecessary workload and allowing developers to focus on more meaningful code improvements. By optimizing the review process, the app will help eliminate unnecessary delays, keep contributors engaged, and ensure PRs move through the pipeline more efficiently.
- You need a Rocket.Chat Server Setup
- Rocket.Chat.Apps CLI,
- In case you don't have run:
npm install -g @rocket.chat/apps-cli
- Every RocketChat Apps runs on RocketChat Server, thus everytime you wanna test you need to deploy the app with this note. lets start setting up:
-
Clone the repo
git clone https://github.com/moyrsd/Rocket.Chat.Code.Review.Assistant.git
-
Install NPM packages
npm ci
-
Deploy app using:
rc-apps deploy --url <url> --username <username> --password <password>
-
In the rocket chat app go to settings and put your github Oauth credentials. To genarate github credentials
- Click on your icon on top right and select Settings
- Go to Developer Settings, which is the downmost option in the contextual bar of the Settings
- Click on Oauth Apps and genarate a new Oauth App
- It will give you a client id and client secret put that in your settings of rc app
-
To subscribe to webhook events you have to foward your local webhook api endpoint using something like ngrok or smee.io and put that link in the weebhook url.I am using smee in this case
- go to smee.io
- get the smee url and type the following command in the cmd which will look something like this
smee -u https://smee.io/Sample token --target http://localhost:3000/api/apps/public/826f0d95-9e25-48a6-a781-a32f147230a5/githubwebhook- You will get the apiendpoint url from app info, scroll down, at the most bottom you will find this.
- Now put your smee url in place of webhook url in either a repo or github app
- If you are using a github repo :
- Make sure you have admin access to the repo
- Go to the settings of that repo
- Click on webhook from the left contextual bar and then click Add Webhook
- paste the smee url in the payload url
- If you are using github App :
- Click on your icon on top right and select Settings
- Go to Developer Settings, which is the downmost option in the contextual bar of the Settings
- Click on Github Apps and create a new app
- Find webhook url in that and paste your smee url there, give pull request permission in the app
- Now add some repo in the app and you are good to go
Below is a curated list of helpful resources for working with GitHub Apps, Webhooks, APIs, and related integrations:
- GitHub Apps Documentation - Official documentation on GitHub Apps.
- Probot Framework - A framework for building GitHub Apps in Node.js.
- GitHub Webhooks Documentation - Comprehensive guide to GitHub webhooks.
- Types of GitHub Webhooks - Overview of available webhook types.
- Octokit REST.js - Official GitHub REST API client for JavaScript.
- Google Summer of Code Resources - A repository containing useful GSoC material.
- Rocket.Chat Developer Docs - Guide for registering API endpoints in Rocket.Chat.
- Creating GitHub Apps - Step-by-step guide to building GitHub Apps.
- GitHub Apps Hello World - A sample GitHub App to get started.
- Apps.MailBridge - A project example for GitHub Apps.
- GitHub Apps vs OAuth Apps - Key differences between GitHub Apps and OAuth Apps.
- GitHub OAuth Apps Documentation - Documentation for creating and managing OAuth Apps.
- ACM Research Paper - Research on topics related to software integration.
- ArXiv Preprint - A paper relevant to the field of APIs and integrations.
- Postman GitHub API - A tool for testing GitHub API endpoints.
Feel free to explore these resources to kickstart or deepen your understanding of GitHub integrations!
