Skip to content

SujalKThapa/Pull-Request-Analyzer

Repository files navigation

Pull Request Analyzer

A Python API for analyzing the files and changes contained within a pull request using LangGraph.🦜

Publicly accessible on: http://34.46.245.0:8000/


POST, GET (Results) and GET (Status) screenshots shown above.
POST /analyze-pr:
Accepts GitHub PR details (repo, PR number) and specifies the operation mode. An example request is given below:
http://34.46.245.0:8000/analyze-pr?repo_url=https://github.com/caching-tools/next-shared-cache&pr_number=933&opMode=0

The request returns a "task_id" which can be used to check the status and result of the analysis.
The state diagram for the analysis process has been illustrated below.



The code for the above is available in analyzerApp/agent.py



GET /status/:
Checks the status of the given analysis ``task_id``. An example request is given below:
http://34.46.245.0:8000/status/9cdf9613-ee87-4b8a-9057-56b6e35bd09e

The status values range from "success", "pending" and "failed".

GET /results/<task_id>:
Returns the result for the given analysis task_id. An example request is given below:

http://34.46.245.0:8000/results/9cdf9613-ee87-4b8a-9057-56b6e35bd09e

The nature of the response will be dependent on the Operation Mode specified in the POST request. The different operation modes are:

0: A balance between analysis and code, both lists out potential issues with the code and also provides the code to fix the issues.
1: Less focus on theoretical analysis, it focuses on identifying issues and providing us with the code to solve them.
2: More focus on theoretical analysis, providing detailed descriptions of the issues.


Setup and run:
1. Download the project, and open a terminal on the root folder.
2. Install Docker and Docker-Compose (if not present alrady).
3. Create a .env file with two parameters, similar to the one shown below:
Github_PAT={insert_GitHub_PersonalAccessToken_Here}
GOOGLE_API_KEY={insert_Google_API_Key_here}
  1. Run the following command:
docker-compose --env-file .env up --build

Built as an assignment for PotPieAI using:

  • Python 3.11
  • LangGraph
  • Celery
  • Redis
  • FastAPI

And deployed as a containerized VM using:

  • Docker
  • Google Compute Engine

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors