Inspiration
Every engineering team has the same two nightmares: a developer merges code that violates the project's agreed-upon scope, and a bad commit reaches production before anyone notices. Both problems share a root cause...
There's no autonomous system watching the repo at all times, enforcing the rules you already wrote down and reacting the moment something breaks.
RepoGuard was built to be that system.
What it does
RepoGuard is a webhook-driven application designed to help protect GitLab repositories. It monitors for events and can trigger actions to prevent unwanted code changes from reaching production.
Key functions:
- Event Monitoring: Listens for webhooks from GitLab (e.g., Merge Request events).
- Basic Guarding Logic: Can apply simple, predefined rules to events.
- Alerting/Triggering: Capable of triggering alerts or other actions based on detected events.
- Local UI: Provides a basic UI for configuration and viewing events.
How we built it
RepoGuard was built as a Python application leveraging FastAPI for its web services.
Key aspects:
- Python/FastAPI: Core logic implemented in Python using the FastAPI framework for API endpoints.
- Webhook Integration: Configured to receive and process webhook payloads from GitLab.
- Basic Configuration: Uses a
.envfile for essential settings like GitLab Personal Access Tokens (PAT) and GCP Project IDs. - Uvicorn: Runs locally using Uvicorn as the ASGI server.
- Core Services: Includes basic modules for configuration (
core/config.py), event handling (core/events.py), and a placeholder for guarding logic (core/guardian.py). - Dependency Management: Uses
uvfor managing project dependencies.
Challenges we ran into
Building RepoGuard as a foundational proof-of-concept involved typical challenges of rapid development:
- GitLab API Interaction: Initial setup and interaction with GitLab's API for events and project data.
- Application State Management: Managing basic application state and configurations.
- Event Processing: Designing a reliable way to process incoming webhook events.
- Local Development Loop: Ensuring a smooth local development and testing workflow.
Accomplishments that we're proud of
Key accomplishments include:
- Functional Proof-of-Concept: Successfully established a working application that can receive GitLab webhooks and react to them.
- Clean Architecture: Designed with a modular
corestructure to allow for future expansion. - Ease of Setup: Straightforward setup process with an
.env.exampleand basic run commands. - Flexible Foundation: Provides a solid, extensible foundation for adding more complex logic and integrations.
What we learned
Key takeaways from this hackathon:
- Webhook Fundamentals: Gained practical experience in setting up and processing webhooks.
- FastAPI Development: Reinforced skills in building efficient web services with FastAPI.
- GitLab API Basics: Understanding the fundamental ways to interact with the GitLab platform programmatically.
- Project Scaffolding: Experience in structuring a new project for maintainability and scalability.
What's next for RepoGuard
Future development avenues for RepoGuard:
- Integration with AI Agents: Incorporate advanced AI agents (e.g., Gemini-powered) for intelligent analysis and automated decision-making.
- Model Context Protocol (MCP): Implement proper integration with GitLab's MCP for richer agent interactions and tool use.
- Sub-Agent Architecture: Develop specialized sub-agents (Gatekeeper, Guardian, Architect) to handle distinct responsibilities like compliance checks, incident response, and project scaffolding.
- OAuth 2.0 Authentication: Implement a full OAuth 2.0 flow for secure user authentication instead of Personal Access Tokens.
- Enhanced UI/UX: Develop a more interactive user interface for configuration, monitoring, and agent interaction.
- Advanced Tooling: Expand capabilities with custom and platform-specific tools for deeper repository management.
- Cloud Deployment: Prepare for seamless deployment to cloud platforms like Google Cloud Run.
Built With
- docker
- fastapi
- firestore
- gemini2.5flash
- gitlabmcp
- gitlabrestapi
- google-cloud
- googleadk
- httpx
- node.js
- pydantic
- python
- vertexai
Log in or sign up for Devpost to join the conversation.