Files
xiaoxia-saas/.gitea/workflows/code-review.yml
T
xiaoxia 92a1c25828
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 15s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1m55s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 2m33s
AI Code Review / AI Code Review (pull_request) Successful in 2m38s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 4m19s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1398h11m6s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1398h11m32s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1398h11m32s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1398h11m32s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 1398h11m32s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1398h11m34s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 1398h11m33s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1398h11m34s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1398h11m35s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1398h11m35s
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 1398h43m39s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 1398h43m40s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1398h43m38s
feat(ci): 接入AgentLoop Trace上报,实现CI全链路监控 (#598)
- ci_trace_report.py放到scripts/ci/目录
- 7个workflow共25个job接入Trace上报
- 复用step_timer_start.sh记录的start_time
- 失败不影响CI(永远exit 0)
2026-07-20 09:17:49 +08:00

66 lines
2.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: AI Code Review
on:
pull_request:
types:
- opened
- synchronize
- reopened
# 同一个 PR 只跑一个 review,新的取消旧的
concurrency:
group: code-review-${{ gitea.repository }}-${{ gitea.event.pull_request.number }}
cancel-in-progress: true
jobs:
code-review:
name: AI Code Review
runs-on: ubuntu-latest
# 跳过草稿 PR
if: ${{ !gitea.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install requests
- name: Run AI Code Review
env:
# Gitea 配置(自动从运行环境获取)
GITEA_API_URL: ${{ gitea.server_url }}
GITEA_TOKEN: ${{ secrets.REVIEW_GITEA_TOKEN }}
REPO_NAME: ${{ gitea.repository }}
PR_NUMBER: ${{ gitea.event.pull_request.number }}
# LLM 提供商: coze (扣子原生Bot) / openai (OpenAI兼容)
LLM_PROVIDER: "coze"
# 扣子模式配置(默认国内站 api.coze.cn)
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
COZE_BOT_ID: ${{ secrets.COZE_BOT_ID }}
LLM_MODEL: ${{ secrets.LLM_MODEL }}
# 可选参数
MAX_DIFF_CHARS: "30000"
LLM_TIMEOUT: "120"
run: |
python3 scripts/ci_code_review.py
# 审查脚本异常不影响 CI 通过
continue-on-error: true
- name: Report CI trace
if: always()
shell: sh
env:
AGENTLOOP_LICENSE_KEY: ${{ secrets.AGENTLOOP_LICENSE_KEY }}
run: |
STATUS="ok"
[ ${{ job.status }} = "success" ] || STATUS="error"
START_TIME=""
[ -f /tmp/ci_job_start_time ] && START_TIME=$(cat /tmp/ci_job_start_time)
python3 scripts/ci/ci_trace_report.py --service xiaoxia-saas-ci --status $STATUS --start-time "$START_TIME" || true