-
-
Server boots up on port 3000, ready to catch pipeline failures and auto-heal them.
-
Pipeline fails on main branch. Auto-healer detects it instantly and kicks off the repair process.
-
Gemini AI reads the error, fetches the code, and generates a fix with 98% confidence in seconds.
-
Fix passes tests. A merge request opens on GitLab automatically zero human intervention needed.
Inspiration
Pipeline failures are the ultimate developer productivity killer. Developers spend nearly a quarter of their time reading raw logs, tracing stack lines, identifying code owners, and writing boilerplate fixes. I was inspired to create an autonomous agent that could handle this entire lifecycle headlesslytransforming a broken build into a self-healing loop.
What it does
When a GitLab CI/CD pipeline fails, the Pipeline Auto-Healer automatically:
- Intercepts the failure event instantly via GitLab webhooks.
- Analyzes raw job logs to isolate the stack trace and extract error details.
- Queries GitLab Orbit to map codebase dependencies, locate the exact file context, and resolve the team member responsible for the module.
- Calls Google Gemini to generate a precise, minimal patch.
- Clones the repository in a sandbox to verify that tests pass before pushing any code.
- Opens a verified Merge Request complete with a beautiful, interactive diagnostic report.
How I built it
- Core Orchestrator: Written in TypeScript running on Express to handle webhook routing.
- GitLab Integration: Built with the GitLab REST API and
simple-gitto automate branch creation, commits, and MR submissions. - GitLab Orbit GraphQL: Traverses the graph representation to resolve ownership and callers.
- AI Engine: Uses the Google GenAI SDK to interface with Gemini.
- Sandbox Validation: Spawns isolated local directories to run unit tests programmatically before pushing.
- Duo Integration: Fully configured with
agent-config.ymland custom flow manifests to publish the agent to the GitLab AI Catalog.
Challenges I ran into
- Context Limits & Noise: Raw pipeline trace logs can be huge and full of container setup noise. I had to build custom regex parsers for Python, JS/TS, and Go to cleanly isolate the stack trace before sending it to the LLM.
- Sandbox Security & Reliability: Ensuring that running test suites locally in a temporary directory did not pollute the main host system required careful filesystem management and timeout boundaries.
Accomplishments that I'm proud of
- Getting the end-to-end self-healing loop running: seeing a pipeline fail, watching the agent intercept it, and seeing a working Merge Request appear automatically inside GitLab is like magic.
- Developing robust log parsing that auto-detects programming languages (Python, JS/TS, Go) and cleans paths.
- Successfully publishing the agent custom flow to the GitLab AI Catalog!
What I learned
- I learned how to model codebase dependencies using graph-based APIs like GitLab Orbit, which provides much richer context than standard source code lookups.
- I gained deep experience in structuring reliable, multi-step agentic workflows where AI output is verified programmatically before taking action in production repositories.
What's next for Pipeline Auto-Healer
- Add native support for Docker-in-Docker sandboxing to completely isolate the test verification stage.
- Enhance the AI agent to support multi-file modifications and automated dependency upgrades.
- Integrate with GitLab Duo Chat so developers can interactively discuss and refine the auto-healer's proposed patches directly in the IDE.
Built With
- axios
- express.js
- gitlab-api
- gitlab-ci-cd
- gitlab-duo
- gitlab-orbit-api
- google-gemini-api
- jest
- node.js
- simple-git
- typescript
- winston-logger
Log in or sign up for Devpost to join the conversation.