Add AI-enhanced webhook mode for intelligent pipeline analysis

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Summary

GitLab webhooks currently provide limited information about pipeline failures, requiring AI-powered analysis tools to make multiple API calls to gather necessary context. This creates latency and complexity for intelligent CI/CD monitoring tools.

Proposal

Introduce an "AI Analysis Mode" for webhooks that includes:

  1. Failed job logs - Direct inclusion of logs from failed jobs
  2. Code context - Information about recent commits and changed files
  3. Structured error data - Pre-categorized error summary for AI consumption
  4. Runner metadata - Infrastructure context for better analysis

Motivation

The rise of AI-powered DevOps tools (like GitHub Copilot for CI/CD, CircleCI's AI insights, and custom solutions) requires richer webhook payloads for effective analysis.

Current Pain Points

  • Tools must make 3-5 additional API calls per failed pipeline
  • Increased latency (2-5 seconds) before analysis can begin
  • Rate limiting issues when monitoring many projects
  • Incomplete context leads to less accurate AI analysis

Use Cases

  1. Automated Error Resolution: AI tools that automatically create fix MRs
  2. Intelligent Retry Logic: Systems that retry only transient failures
  3. Pattern Recognition: Tools that learn from error patterns across projects
  4. Smart Notifications: AI that knows when to alert vs auto-fix

Example Enhanced Payload

{
  "object_kind": "pipeline",
  "object_attributes": { "status": "failed" },
  "failed_jobs_logs": [{
    "job_id": 12345,
    "job_name": "test",
    "logs": "ModuleNotFoundError: No module named 'pandas'"
  }],
  "ai_metadata": {
    "error_summary": {
      "dependency_errors": 1,
      "syntax_errors": 0,
      "test_failures": 0
    }
  }
}

Benefits

  • Performance: Reduce API calls by 80% for AI tools
  • Accuracy: Better context = better AI analysis
  • Adoption: Easier integration for AI tool developers
  • Innovation: Enable new types of intelligent automation

Implementation

MR: !192569 (closed) - Initial backend implementation

Hackathon Context

This feature was developed as part of the Google Cloud + GitLab Hackathon 2025, where we built AI Pipeline Guardian - an AI-powered tool that demonstrates the need for this enhancement.

Related Links

  • AI Pipeline Guardian - Example tool that would benefit
  • Google Cloud + GitLab Hackathon
Edited Sep 24, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading