Compare commits

..

5 Commits

Author SHA1 Message Date
xiaoxia f30af27762 ci: Validate并行化-拆分为CodeQuality/TypeCheck/Migration三个并行job
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 45s
AI Code Review / AI Code Review (pull_request) Successful in 7m14s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 37s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 22m29s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 35m32s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1350h7m12s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1350h9m21s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1350h9m21s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1350h9m26s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1350h9m28s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1350h9m38s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 1350h9m40s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 1350h9m42s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 1350h9m44s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1350h17m51s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1350h17m53s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1350h17m49s
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been skipped
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (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 1350h41m36s
2026-07-22 09:07:40 +08:00
xiaoxia ab921517f6 ci: 新增迁移验证脚本(Validate并行化) 2026-07-22 09:05:58 +08:00
xiaoxia 8afa8b6b29 ci: 新增mypy检查脚本(Validate并行化) 2026-07-22 09:05:57 +08:00
xiaoxia d7138010fc ci: 新增代码质量检查脚本(Validate并行化) 2026-07-22 09:05:56 +08:00
xiaoxia 809339fee3 fix: check_ci_status按时间取最新status,修复auto-merge一直等pending的bug
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Build Staging Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (push) Has been cancelled
CI/CD Pipeline / Production Browser E2E (push) Failing after 1350h26m51s
CI/CD Pipeline / Deploy Production (push) Failing after 1350h26m53s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 1350h26m57s
CI/CD Pipeline / Build Production Web Image (push) Failing after 1350h26m59s
CI/CD Pipeline / Build Production API Image (push) Failing after 1350h26m59s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1350h28m8s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 1350h29m19s
CI/CD Pipeline / PR Build API Image (push) Failing after 1350h29m23s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been skipped
CI/CD Pipeline / Unit Tests (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Failing after 1351h1m33s
CI/CD Pipeline / Build Staging API Image (push) Has been skipped
CI/CD Pipeline / Build Staging Web Image (push) Has been skipped
2026-07-22 08:58:00 +08:00
4 changed files with 18 additions and 58 deletions
+2 -43
View File
@@ -718,36 +718,6 @@ jobs:
echo "Docker login failed ($i/3), retrying in 5s..."
sleep 5
done
- name: Pre-build worker base images (fallback if not exist)
if: matrix.service == 'worker'
id: prebuild
shell: sh
run: |
set -eu
REGISTRY="git.xiaoxiajianji.com/xiaoxia-saas"
BASE_BUILDER="${REGISTRY}/worker-base-builder:latest"
BASE_RUNTIME="${REGISTRY}/worker-base-runtime:latest"
# 尝试拉取基础镜像
echo "检查基础镜像..."
if docker pull "$BASE_BUILDER" 2>/dev/null && docker pull "$BASE_RUNTIME" 2>/dev/null; then
echo "基础镜像已存在,使用远程镜像"
echo "fallback=false" >> $GITHUB_OUTPUT
else
echo "基础镜像不存在,本地构建(fallback模式)..."
# 构建builder基础镜像
echo "构建 worker-base-builder..."
docker build -f infra/docker/worker-base-builder.Dockerfile -t "$BASE_BUILDER" .
# 构建runtime基础镜像
echo "构建 worker-base-runtime..."
docker build -f infra/docker/worker-base-runtime.Dockerfile -t "$BASE_RUNTIME" .
echo "fallback=true" >> $GITHUB_OUTPUT
echo "基础镜像本地构建完成"
fi
- name: Build PR image (verify only, no push)
shell: sh
run: |
@@ -761,18 +731,6 @@ jobs:
EXTRA_BUILD_ARGS="$EXTRA_BUILD_ARGS NGINX_CONF=infra/docker/nginx-staging.conf"
fi
# Worker fallback模式:基础镜像本地已构建,用普通docker build绕过buildx
if [ "${{ matrix.service }}" = "worker" ] && [ "${{ steps.prebuild.outputs.fallback }}" = "true" ]; then
echo "Fallback模式:用普通docker build(基础镜像本地已构建)"
BUILD_ARG_STR=""
for arg in $EXTRA_BUILD_ARGS; do
BUILD_ARG_STR="$BUILD_ARG_STR --build-arg $arg"
done
docker build -f ${{ matrix.dockerfile }} -t "${IMAGE_TAG}" $BUILD_ARG_STR .
echo "Fallback PR Build successful"
exit 0
fi
NO_CACHE_FLAG=""
for i in 1 2 3; do
echo "PR Build attempt $i/3"
@@ -1621,4 +1579,5 @@ jobs:
[ ${{ 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
python3 scripts/ci/ci_trace_report.py --service xiaoxia-saas-ci --status $STATUS --start-time "$START_TIME" || true
+15 -13
View File
@@ -31,20 +31,22 @@ def main():
print("pending")
return
# API返回按时间倒序,第一个就是最新的
for s in statuses:
if s.get("context") == target_context:
status = s.get("status", "pending")
# skipped 视为通过(条件跳过的任务不需要等)
if status == "skipped":
print("success")
else:
print(status)
return
# 筛选目标context,按时间倒序取最新的
matching = [s for s in statuses if s.get("context") == target_context]
if not matching:
# 找不到说明CI还没开始写状态,返回pending继续等待
print("pending")
return
# 找不到这个context说明CI还没开始写状态,返回pending继续等待
# (如果workflow真的被跳过,它会有一条status为skipped的记录)
print("pending")
# Gitea statuses API按时间正序返回,必须取最新的一条
latest = max(matching, key=lambda s: s.get("created_at", ""))
status = latest.get("status", "pending")
# skipped 视为通过(条件跳过的任务不需要等)
if status == "skipped":
print("success")
else:
print(status)
if __name__ == "__main__":
+1 -1
View File
@@ -280,7 +280,7 @@ def main():
# 提交修复
run("git add -A")
run('git commit -m "style: auto-format with black + isort + prettier"')
run('git commit -m "style: auto-format with black + isort + prettier [ci skip]"')
# 推送(head_branch已从ensure_git_repo获取)
print(f"\nPR来源分支: {head_branch}")
-1
View File
@@ -2,4 +2,3 @@
# CI 公共步骤:Job 开始计时
echo "JOB_START_TIME=$(date +%s)" >> $GITHUB_ENV
echo "Job started at $(date)"
# trigger CI run for PR validation