Inspiration
Every engineering team I've worked with faces the same silent problems: pull requests sit unreviewed for days, new issues pile up unlabelled, nobody knows who's doing quality work, and team leads spend hours each week just trying to understand the state of their codebase. These are solvable problems — they just need an agent that never sleeps.
What it does
DevFlow Agent is an AI-powered GitLab workspace manager with four autonomous capabilities:
1. Automatic PR Code Review & Scoring The moment a developer opens a merge request, DevFlow automatically fetches the diff, description, and review history via the GitLab MCP server. Gemini 2.5 Flash evaluates the MR across six quality dimensions — description quality (25%), code clarity (25%), test coverage signal (20%), PR size appropriateness (15%), review responsiveness (10%), and iteration quality (5%) — and posts a detailed review comment with scores, per-file change summaries, and potential impact analysis.
2. Automatic Issue Triage When a new issue is opened, DevFlow reads the title and description, checks available project labels, classifies the issue, applies the correct labels, estimates priority (Critical/High/Medium/Low), and posts a triage comment with a one-sentence summary and suggested next step — all within 30–60 seconds.
3. Stale MR Detection A scheduled scan identifies merge requests with no activity for N days and posts a friendly nudge comment to the author, keeping the team's review queue clean.
4. Daily Team Digest A single command generates a full markdown report: all open MRs with days since last activity, stale MRs, open issue count, current leaderboard snapshot, and an AI-written team health summary with recommendations.
Developer Leaderboard Dashboard Every scored PR feeds a persistent Firestore leaderboard. Points = PR Score × Complexity Multiplier (1.0 for small PRs, 1.3 for medium, 1.6 for large). Developers with 3+ MRs scoring above 70 in a week earn a streak. The React dashboard shows real-time rankings, individual MR score histories, and per-dimension progress bars.
How we built it
Agent Framework: Google Cloud Agent Builder (ADK 2.0) with an LlmAgent orchestrating all tool calls.
LLM: Gemini 2.5 Flash — chosen for its speed and long-context capability needed to process large diffs.
GitLab Integration: The @zereight/mcp-gitlab MCP server (100+ tools) connected via McpToolset with stdio transport. All GitLab operations — reading MRs, fetching diffs, posting comments, updating issue labels — go through the MCP server.
Backend: Flask API server deployed on Google Cloud Run with gunicorn. Webhook events from GitLab trigger background subprocess workers that run the full ADK agent pipeline.
Database: Cloud Firestore stores all PR scores, developer stats, and leaderboard data.
Frontend: React + TypeScript + Tailwind CSS dashboard served directly from the Cloud Run instance, reading from Firestore via the Flask API.
Infrastructure: Dockerfile with multi-stage build (Node.js 20 for MCP server + Python 3.11 for agent). Cloud Build for CI, Artifact Registry for images, Cloud Run with min-instances=1 and no CPU throttling for responsive webhooks.
Challenges we ran into
MCP Server Reliability in Cloud Run: The biggest technical challenge was running the GitLab MCP server (a Node.js subprocess) reliably inside a Cloud Run container. The subprocess needed to start cleanly in a background thread, but asyncio event loop isolation, CPU throttling, and npm package version drift between builds all caused intermittent failures. The fix required pinning the exact MCP package version, using the globally installed binary directly instead of npx, and disabling CPU throttling on the Cloud Run instance.
GitLab 18 Work Item Webhook Format: GitLab 18 changed issue webhooks to send object_kind: "issue" through the work items system. Mapping the new payload structure to our existing handler required careful inspection of webhook delivery logs via the GitLab API.
ADK 2.0 Import Paths: The ADK 2.0 release changed import paths significantly. StdioConnectionParams, McpToolset, and the runner API all required hard-won pattern discovery before working correctly.
Accomplishments we're proud of
- A fully autonomous agent that requires zero developer configuration — open a MR, and DevFlow handles the rest
- The PR scoring rubric produces surprisingly nuanced and accurate reviews, including specific rationale for each dimension
- End-to-end latency from MR open to review comment posted: under 60 seconds
- The leaderboard creates genuine team engagement — developers compete to improve their scores
What we learned
Building a production agent on Cloud Run taught us that reliability matters more than features. The MCP server subprocess management, CPU throttling behaviour, and webhook reliability issues took far more time to solve than the AI logic itself. The ADK framework made the agent logic clean and composable, but deployment to a serverless environment required careful engineering around subprocess lifecycle.
What's next
- Streak notifications and weekly leaderboard emails
- Multi-project support with a unified cross-team dashboard
- MR score trends over time — showing whether a developer's code quality is improving
- Integration with GitLab CI/CD pipeline results to factor test pass/fail into the score
- Slack/Teams integration for digest delivery
Built With
- cloud-run
- firestore
- gemini-2.5-flash
- gitlab-mcp-server
- google-cloud-agent-builder
- python
- react
- typescript
- vertex-ai
Log in or sign up for Devpost to join the conversation.