๐ Google AI in Action Hackathon 2025 - GitLab Challenge
An AI-powered debugging assistant that helps developers solve problems through interactive questioning directly within GitLab issues. Built with Google Cloud AI and GitLab webhooks to accelerate software development.
AI Rubber Duck is an intelligent debugging companion that integrates directly into your GitLab workflow. When developers get stuck, they create an issue with "Rubber Duck Help Me" in the title, and our AI assistant provides contextual guidance through Socratic questioning.
- ๐ค AI-Powered Assistance: Uses Google Gemini AI for intelligent responses
- ๐ GitLab Integration: Seamless webhook integration with GitLab issues
- ๐ Context-Aware: Understands your entire project structure
- ๐ฌ Interactive Conversations: Supports multi-turn debugging sessions
- โก Real-Time: Instant responses to issue creation and comments
- Google Cloud: Firestore (database), Gemini AI (language model)
- GitLab: Webhooks API, Issues API, Repository API
- Backend: Python Flask, python-gitlab library
- Platform: Web-based service
-
๐ฌ Demo Video:
Click the image above to watch the demo video
-
๐ Website: [Ai Rubber Duck For Gitlab's Issues]
-
๐ฎ Live Demo: [Demo Gitlab Repo With Issues and Webhook Configured]
To enable the AI Rubber Duck functionality in your GitLab project:
-
Access Webhook Settings
- Go to your GitLab project โ Settings โ Webhooks
-
Configure Webhook Details
- URL:
https://rubber-duck-ai-957711343120.us-central1.run.app/webhook(or ngrok URL for testing) - Secret Token: Use same value as
GITLAB_WEBHOOK_SECRETshould benkcuxx7uvUsywxT - Trigger Events: Enable the following:
- โ Issues events
- โ Comments (Note events)
- โ Merge request events
- URL:
-
Save It
- Click Add webhook to save
Once configured, simply create an issue with "Rubber Duck Help Me" in the title or description, and the AI will analyze your project context and provide helpful assistance!
- Python 3.8+
- GitLab account with project
- Google Cloud account
- Public URL (ngrok for testing)
-
Clone Repository
git clone <repository-url> cd version_2
-
Install Dependencies
pip install -r requirements.txt
-
Google Cloud Setup
- Enable Firestore API and Google AI API
- Create service account with Firestore Admin role
- Download key as
account-key.json
-
Environment Configuration
# Create .env file FLASK_APP=app/app.py APP_GITLAB_URL=https://gitlab.com APP_TARGET_GITLAB_TOKEN=your_gitlab_token APP_GOOGLE_AI_API_KEY=your_google_ai_key GITLAB_WEBHOOK_SECRET=your_webhook_secret GOOGLE_CLOUD_PROJECT=your_project_id GOOGLE_SERVICE_ACCOUNT_PATH=account-key.json -
Run Application
flask run -p 5000
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ GitLab โ โ Flask Web โ โ Google Cloud โ
โ Platform โ โ Application โ โ Services โ
โ โ โ โ โ โ
โ โโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโ โ
โ โ Issues โโโโโโโโคโบโ Webhook โ โ โ โ Firestore โ โ
โ โ Comments โ โ โ โ Handler โโโโโโโโคโบโ Database โ โ
โ โ Merges โ โ โ โ โ โ โ โ โ โ
โ โโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโ โ
โ โ โ โ โ โ โ
โ โโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโ โ
โ โ Repository โโโโโโโโคโบโ Business โ โ โ โ Gemini โ โ
โ โ Content โ โ โ โ Logic โโโโโโโโคโบโ AI โ โ
โ โ API โ โ โ โ Handler โ โ โ โ Models โ โ
โ โโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
Data Flow:
1. Developer creates issue with "Rubber Duck Help Me"
2. GitLab sends webhook to Flask app
3. Handler fetches project context from Firestore
4. AI processes issue + context โ generates response
5. Response posted back to GitLab issue
-
Webhook Handler (
app/app.py)- Receives GitLab webhooks
- Validates secret tokens
- Routes events to appropriate handlers
-
Business Logic (
app/handler.py)- Processes issue events
- Manages project registration
- Orchestrates AI responses
-
GitLab Integration (
src/gitlab_integration.py)- Fetches issue details and comments
- Posts AI responses back to issues
- Retrieves repository content
-
AI Integration (
src/google_ai_integration.py)- Configures Google Gemini AI
- Generates contextual responses
- Supports Socratic questioning mode
-
Data Storage (
src/firestore_integration.py)- Stores project metadata
- Caches repository content
- Tracks conversation history
- Project Registration: First webhook triggers repository content fetch and Firestore storage
- Issue Processing: AI receives issue + full project context to generate relevant questions
- Response Generation: Gemini AI creates Socratic questions based on problem and codebase
- Content Updates: Merge events automatically refresh repository context
The AI receives comprehensive context including:
- Project metadata and structure
- README and configuration files
- Relevant source code files
- Issue history and previous responses
Issue Title: Rubber Duck Help Me - ReferenceError in Node.js server
User Problem:
Getting error: ReferenceError: ten is not defined
Line: ten(port, () => {
AI Response:
Looking at your error "ReferenceError: ten is not defined", I can see this is on the line where
you're trying to start a server.
Can you tell me what you intended to write instead of "ten"?
What function do you typically use to start a server listening on a port?
Issue Title: Rubber Duck Help Me - User login keeps failing
User Problem:
My authentication endpoint returns 401 even with correct credentials
AI Response (with project context):
I can see you're using bcrypt for password hashing in your auth.js file.
Let's think through this step by step:
1. Are you comparing the plain text password with the hashed password correctly?
2. Can you show me how you're calling bcrypt.compare()?
3. What does your user lookup query return - does it find the user?
Issue Title: Rubber Duck Help Me - Database connection timeout
AI Response (after analyzing config files):
I notice you're using MongoDB connection pooling in your config.
When you say "timeout", let's narrow this down:
1. Is this happening on the initial connection or during queries?
2. Have you checked if your connection string includes the correct timeout parameters?
3. Looking at your .env.example, are all required environment variables set?
Developer creates issue โ AI asks clarifying questions โ Developer responds โ
AI provides deeper analysis โ Solution discovered โ AI congratulates and summarizes
- Multi-Language Support: Expand beyond Python/JavaScript to Java, C++, Go
- IDE Integration: VS Code extension for direct AI assistance
- Enhanced Context: Include test files and documentation in AI analysis
- Performance Optimization: Faster response times and better caching
- Custom AI Training: Project-specific models trained on team's coding patterns
- Team Analytics: Insights into common debugging patterns and knowledge gaps
- Smart Suggestions: Proactive issue detection based on code changes
- Integration Expansion: GitHub, Bitbucket, Azure DevOps support
- Multi-Tenant Support: Organization-level management and analytics
- Advanced Security: SSO integration and audit logging
- API Rate Limiting: Usage controls and quota management
- Custom Deployment: On-premises and private cloud options
- Code Understanding: Better static analysis integration
- Learning from Interactions: AI improvement from successful debugging sessions
- Predictive Assistance: Anticipate issues before they occur
- Knowledge Graph: Build connections between common problems and solutions
๐ Source Code: [GitHub Repository URL]
๐ Devpost: [Hackathon Submission URL]
Built for Google AI in Action Hackathon 2025 - Accelerating Software Development with AI
