ci-ai: KI-Schicht für die Gitea-CI (PR-Review, Security-Erklärung, CI-Failure-Analyse)
Provider-agnostische LLM-Anbindung (Anthropic jetzt, Jetson/Ollama später per Env-Var umschaltbar). Stdlib-only Skripte + Beispiel-Workflows. GitLab-Duo-Parität für self-hosted Gitea + act_runner. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
41
workflows/ci-failure.example.yml
Normal file
41
workflows/ci-failure.example.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
# Feature C — KI-Analyse fehlgeschlagener CI-Jobs.
|
||||
# KEIN eigenständiger Workflow, sondern ein MUSTER: diesen if:failure()-Job ans
|
||||
# Ende eines echten Build/Test-Workflows hängen (needs: auf die CI-Jobs setzen).
|
||||
# Er nimmt das geteilte Job-Log und lässt die KI die Ursache erklären.
|
||||
#
|
||||
# Beispiel-Einbettung in einen vorhandenen Workflow:
|
||||
#
|
||||
# jobs:
|
||||
# build:
|
||||
# runs-on: eulernest
|
||||
# container: ghcr.io/catthehacker/ubuntu:act-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Build
|
||||
# run: |
|
||||
# set -o pipefail
|
||||
# make 2>&1 | tee /tmp/ci.log # <-- Log mitschneiden
|
||||
#
|
||||
# explain-on-failure:
|
||||
# needs: [build]
|
||||
# if: failure()
|
||||
# runs-on: eulernest
|
||||
# container: python:3.12-slim
|
||||
# steps:
|
||||
# - name: Tooling
|
||||
# run: apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates
|
||||
# - name: KI-Analyse
|
||||
# env:
|
||||
# AI_PROVIDER: anthropic
|
||||
# AI_MODEL: claude-3-5-haiku-latest
|
||||
# ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
# GITEA_TOKEN: ${{ github.token }}
|
||||
# GITEA_API: https://git.eulernest.eu/api/v1
|
||||
# run: |
|
||||
# git clone --depth 1 https://git.eulernest.eu/user2595/ci-ai.git /opt/ci-ai
|
||||
# python /opt/ci-ai/scripts/ai_explain.py ci-failure /tmp/ci.log
|
||||
#
|
||||
# Hinweis: /tmp wird zwischen Jobs NICHT automatisch geteilt. Für echtes Cross-
|
||||
# Job-Log-Sharing das Log als actions/upload-artifact hochladen und im Folge-Job
|
||||
# wieder herunterladen — ODER (einfacher) den explain-Schritt als if:failure()
|
||||
# direkt in DENSELBEN Job hängen, wie in security.example.yml gezeigt.
|
||||
Reference in New Issue
Block a user