몇 초 만에 CI/CD 파이프라인 실패를 진단하는 AI 도구를 만든 방법
Source: Dev.to
무엇을 하는가
CI/CD 파이프라인이 실패하면 PipelineIQ가 자동으로:
- 오류 로그를 캡처하고
- Claude AI에 분석을 요청하고
- 정확한 근본 원인과 해결 단계가 포함된 Slack 알림을 몇 초 안에 전달합니다
예시 Slack 알림
🔴 Pipeline Failure: Stripe API connection timeout blocking payment webhooks
AI Diagnosis: The deployment is failing because the application cannot establish a connection to Stripe's API within the 30‑second timeout limit. This is preventing payment webhook processing.
Recommended Fix: Check STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY in production environment variables. Test connectivity to api.stripe.com from your deployment environment. Increase API timeout from 30s to 60s.
로그를 파고들 필요 없음. 추측도 없음. 구체적이고 실행 가능한 단계 제공.
스택
- FastAPI – 비동기 지원 파이썬 백엔드
- Supabase – Row Level Security가 적용된 PostgreSQL 데이터베이스
- Anthropic Claude API – AI 진단 엔진
- Slack API – 풍부한 블록 기반 알림
- Railway – 프로덕션 배포
- GitHub Actions – 하나의 워크플로우 단계로 통합
통합 방식
기존 GitHub Actions 워크플로우에 한 단계만 추가하면 됩니다:
- name: Notify PipelineIQ
if: always()
run: |
curl -X POST $PIPELINEIQ_URL/api/v1/pipelines/runs \
-H "X-PipelineIQ-Key: $PIPELINEIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"repo_full_name": "${{ github.repository }}",
"branch": "${{ github.ref_name }}",
"commit_sha": "${{ github.sha }}",
"commit_message": "${{ github.event.head_commit.message }}",
"workflow_name": "${{ github.workflow }}",
"status": "${{ job.status }}",
"started_at": "${{ github.event.head_commit.timestamp }}"
}'
성공이든 실패든 모든 실행이 저장됩니다. 실패가 발생하면 자동으로 AI 진단이 트리거됩니다.
AI 진단 엔진
FastAPI 백그라운드 작업이 실패가 저장될 때 Claude를 호출합니다:
async def run_ai_diagnosis(run: dict, org_id: str, supabase: Client):
insight = await diagnose_from_run(run)
if not insight:
return
supabase.table("insights").insert({
"severity": insight.get("severity"),
"title": insight.get("title"),
"diagnosis": insight.get("diagnosis"),
"recommendation": insight.get("recommendation"),
"estimated_time_save_minutes": insight.get("estimated_time_save_minutes"),
"confidence": insight.get("confidence"),
}).execute()
await send_pipeline_alert(insight, run)
Claude는 심각도, 진단, 권고, 신뢰도 점수 및 예상 절감 시간을 포함한 구조화된 JSON을 반환합니다. 전체 과정은 5초 이내에 완료됩니다.
향후 계획
- 모든 레포지토리의 파이프라인 상태를 한눈에 볼 수 있는 웹 대시보드
- DORA 메트릭(배포 빈도, 변경 실패율, 복구 시간)
- 환경 드리프트 감지
- 산업 벤치마크 — 팀의 성과를 어떻게 비교할 수 있을까?
무료 체험
PipelineIQ는 현재 무료 베타 버전입니다. 엔지니어링 팀이 직접 사용해보고 부족한 점에 대한 솔직한 피드백을 제공해 주시면 좋겠습니다.
댓글로 질문에 답변해 드립니다—특히 파이프라인 실패를 매일 겪는 DevOps 엔지니어분들의 의견을 환영합니다.