Inspiration
In hectic development settings, handling merge requests (MRs) takes a lot of time and is prone to mistakes. Particularly in large teams, manual code reviews frequently overlook minor errors, security flaws, or style infractions. Our goal was to create an AI-powered reviewer that could help or even approve or reject merge requests on its own, with explainable feedback and rollback mechanisms, motivated by the emergence of autonomous agents and the growing complexity of DevOps pipelines.
What it does
AutoMergeMind is an autonomous merge decision engine that integrates with GitLab and is powered by LLM. It uses the GitLab API to retrieve open merge requests. uses an LLM with contextual project awareness to analyze differences. produces explanations for acceptance or rejection that are readable by humans.
This review includes comments on the MR. Depending on trust metrics, it is possible to start rollbacks or auto-merge.
How we built it
Backend: Using FastAPI, it exposes endpoints to initiate review processes. LLM Integration: Performed code review with justification using OpenAI's GPT models through their Python SDK. GitLab API: Requests to retrieve MRs, add comments, merge, or close them that are authenticated. Local Developer: Using a virtual environment with live reload via Uvicorn, the project was developed and tested in Visual Studio Code. CI/CD Simulation: Made use of fictitious repositories and agents to replicate real-world merge workflows.
Challenges we ran into
Import resolution problems: Because of improper settings, we initially encountered VS Code path errors.Python and JSON pathing had an impact on imports of modules such as services.llm_review and utils.gitlab. Managing environment-specific dependencies, such as requests, openai, and httpx delayed initial runs, is known as package management. Model tuning: Careful prompt engineering was needed to produce precise and succinct merge justifications. Cross-directory imports: Using sibling directories such as routes/, services/, and utils/ to ensure a clean project structure.
Accomplishments that we're proud of
Developed a fully autonomous review-comment-merge cycle for a functional AI merge reviewer. Within 48 hours, backend services, LLMs, and the GitLab API were integrated. Like a senior reviewer, I provided relevant and comprehensible feedback in response to a merge request.
What we learned
For the quick prototyping of LLM-enabled APIs, FastAPI is incredibly productive. Iterative development greatly benefits from Uvicorn's hot reload. For LLMs to make accurate code judgments, they require quick refinement and contextual input. Setting up virtual environments and managing paths are essential for efficient development processes.
What's next for AutoMergeMind
Incorporate support for Bitbucket and GitHub alongside GitLab. To lessen reliance on OpenAI for enterprise privacy, train a lightweight local model. To enable teams to determine confidence thresholds for autonomous merges, implement trust scoring. Use Dockerized test pipelines to incorporate rollback simulations.
Log in or sign up for Devpost to join the conversation.