Compare commits

...

1 Commits

Author SHA1 Message Date
xiaoxia 6ea8ae6b0c fix(ci): P0系统性修复 - concurrency/UnitTests/门禁同步\n\n- 任务1: develop push事件关闭cancel-in-progress,PR事件保留\n- 任务2: Unit Tests修复 - PYTHONPATH加packages目录+numpy双保险\n- 任务4: auto_approve/auto_merge同步新增5个required checks\n\n任务3(分支保护门禁)已通过Gitea API直接修改
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 32s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 59s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m17s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m20s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 33s
AI Code Review / AI Code Review (pull_request) Successful in 2m24s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 4m4s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 11s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 4m10s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m9s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m28s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 5m0s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 9m56s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 47m57s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 11s
2026-07-23 18:36:43 +08:00
4 changed files with 17 additions and 3 deletions
+2 -1
View File
@@ -22,7 +22,8 @@ permissions:
contents: read
concurrency:
group: ci-pipeline-${{ gitea.event_name }}-${{ gitea.ref }}
cancel-in-progress: true
# PR事件取消进行中的旧run,push事件不取消(确保完整CI跑完)
cancel-in-progress: ${{ gitea.event_name == 'pull_request' }}
jobs:
check-frontend-only:
name: Check if frontend-only change
+5
View File
@@ -32,6 +32,11 @@ else
"CI/CD Pipeline / Validate - Type Check (mypy) (pull_request)"
"CI/CD Pipeline / Validate - Migration (alembic) (pull_request)"
"CI/CD Pipeline / Frontend Lint (pull_request)"
"CI/CD Pipeline / Unit Tests (pull_request)"
"CI/CD Pipeline / Frontend Unit Tests (pull_request)"
"CI/CD Pipeline / PR Build API Image (pull_request)"
"CI/CD Pipeline / PR Build Web Image (pull_request)"
"CI/CD Pipeline / PR Build Worker Image (pull_request)"
)
fi
+5
View File
@@ -32,6 +32,11 @@ else
"CI/CD Pipeline / Validate - Type Check (mypy) (pull_request)"
"CI/CD Pipeline / Validate - Migration (alembic) (pull_request)"
"CI/CD Pipeline / Frontend Lint (pull_request)"
"CI/CD Pipeline / Unit Tests (pull_request)"
"CI/CD Pipeline / Frontend Unit Tests (pull_request)"
"CI/CD Pipeline / PR Build API Image (pull_request)"
"CI/CD Pipeline / PR Build Web Image (pull_request)"
"CI/CD Pipeline / PR Build Worker Image (pull_request)"
)
echo "检查required门禁(与分支保护一致)"
fi
+5 -2
View File
@@ -42,6 +42,9 @@ for i in 1 2 3; do
done
pytest --version
# 双保险:确保numpy已安装
python3 -m pip install -q numpy==1.26.4 || true
# --- 增量测试选择(仅PR) ---
UNIT_TEST_MODE="full"
SELECTED_TEST_FILES="tests/unit"
@@ -75,7 +78,7 @@ echo "=== 运行单元测试 (模式: $UNIT_TEST_MODE) ==="
if [ "$UNIT_TEST_MODE" = "incremental" ]; then
echo "=== 增量测试模式 ==="
PYTHONPATH="$PWD/apps/api:$PWD/apps/worker:$PWD" python3 -m coverage run \
PYTHONPATH="$PWD/apps/api:$PWD/apps/worker:$PWD/packages:$PWD" python3 -m coverage run \
--source=apps/api/app,apps/worker/worker_app,packages \
--omit="*/migrations/*,*/tests/*,*/test_*.py,*/site-packages/*" \
--branch \
@@ -84,7 +87,7 @@ if [ "$UNIT_TEST_MODE" = "incremental" ]; then
python3 -m coverage xml -o coverage.xml
python3 -m coverage report --fail-under=10 > /dev/null || true
else
PYTHONPATH="$PWD/apps/api:$PWD/apps/worker:$PWD" python3 -m coverage run \
PYTHONPATH="$PWD/apps/api:$PWD/apps/worker:$PWD/packages:$PWD" python3 -m coverage run \
--source=apps/api/app,apps/worker/worker_app,packages \
--omit="*/migrations/*,*/tests/*,*/test_*.py,*/site-packages/*" \
--branch \