fix(ci): 修复integration-tests needs依赖 + push事件auto-fix支持 #766
Reference in New Issue
Block a user
Delete Branch "fix/ci-systematic-p0-round2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
变更内容
任务1:修复integration-tests的needs依赖bug
integration-testsjob的needs里写了不存在的validatejobvalidate-code-quality、validate-type-check、validate-migration任务2:Code Quality auto-fix 在push事件也生效
改动文件
.gitea/workflows/ci-pipeline.ymlscripts/ci/auto_fix_formatting.pyCI全绿,自动审批通过。
CI全绿,自动审批通过。
75ed2dceectoc1a5f52004代码审查结果 - PR #766
⚠️ 问题(2个需要修改)
scripts/ci/auto_fix_formatting.py 第79-83行:Git仓库存在时未配置写权限Remote URL
.git目录已存在时(第79行),函数仅执行checkout后直接返回,跳过了后续配置remote_url的步骤(第96行)。如果CI环境复用了缓存的.git目录,或者默认actions/checkout使用的 Token 只有读权限,后续的git push操作将因认证失败(403 Forbidden)或权限不足而报错。scripts/ci/auto_fix_formatting.py 第82行:分支切换失败未做错误处理
check=False执行git checkout,如果切换分支失败(例如本地有未提交的修改导致冲突,或者分支名拼写错误),脚本不会抛出异常,而是静默继续执行。git push推送到错误的提交,导致代码混乱。💡 建议(3个可选)
scripts/ci/auto_fix_formatting.py 第227-230行:API请求建议增加异常捕获
urllib.request.urlopen请求可能会因网络波动、API限流或权限问题抛出异常。建议使用try-except捕获这些异常,打印明确的错误日志并优雅退出,避免抛出难以追踪的 StackTrace。scripts/ci/auto_fix_formatting.py 第206行:Token有效性校验
token时会失败,但建议在获取环境变量后立即检查if not token:并报错退出,以便更早发现配置问题。scripts/ci/auto_fix_formatting.py 第96行:Remote URL配置逻辑优化
ensure_git_repo_for_push函数中,使用git remote add origin可能会在 remote 已存在时报错。建议使用git remote set-url origin ...或先检查 remote 是否存在,以支持重试场景。✅ 格式检查通过 | ❌ 逻辑审查需修改 | ✅ 性能无明显问题
🤖 由 AI 代码审查机器人自动生成 | 2026-07-23 14:04:00 | 模型:
🗑️ 预览环境已清理
PR #766 已关闭或合并,对应的预览环境已被清理。