feat(ci): 全面审计修复CI配置 - 18个问题(P0×3 + P1×7 + P2×8) #196

Closed
xiaoxia wants to merge 19 commits from feature/ci-full-audit-fix into develop

19 Commits

Author SHA1 Message Date
xiaoxia bbfc45e5f7 ci(P2-8): 优化worker.Dockerfile镜像体积,清理Python字节码和apt缓存 2026-07-09 14:00:23 +08:00
xiaoxia 8a9ee6ab11 ci(P2-8): 优化api.Dockerfile镜像体积,清理Python字节码和apt缓存 2026-07-09 14:00:22 +08:00
xiaoxia bf2649e445 ci(P2-7): 增加Trivy镜像安全扫描(高危漏洞检测,仅告警不阻断) 2026-07-09 13:58:58 +08:00
xiaoxia 48f5f8efa5 ci(P2-5): 测试失败时上传结果产物,pytest输出改为详细模式 2026-07-09 13:58:09 +08:00
xiaoxia e14e007537 ci(P2-2): validate job增加pip依赖缓存,加速重复构建 2026-07-09 13:57:33 +08:00
xiaoxia e52b7bcaac ci(P2-6): daily-check中所有Playwright E2E测试增加重试机制 2026-07-09 13:56:59 +08:00
xiaoxia f58b4bd5d6 ci(P2-6): 所有Playwright E2E测试增加--retries=2重试机制,降低偶发失败率 2026-07-09 13:56:44 +08:00
xiaoxia f2b3e16ca1 ci(P2-4): 增加 concurrency 控制,同一分支重复push自动取消旧构建 2026-07-09 13:56:14 +08:00
xiaoxia 58107ca6ce ci(P2-3): 放宽 validate job timeout 从10分钟到20分钟,避免偶发超时 2026-07-09 13:56:01 +08:00
xiaoxia 69c4ad32dc ci(P1-4): 生产部署增加失败自动回滚+优雅停止,最小化服务中断 2026-07-09 13:55:17 +08:00
xiaoxia 5f3e034f98 ci(P1-3): staging部署增加smoke test失败自动回滚机制 2026-07-09 13:51:50 +08:00
xiaoxia c6d1136ae3 ci(P1-7): 重写 cleanup_old_images.sh:移除过时Registry清理和明文密码,仅保留本地清理
CI/CD Pipeline / Frontend Lint (push) Successful in 1m41s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 10m0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
2026-07-09 13:50:49 +08:00
xiaoxia 90e5f47975 ci(P1-6): 增强 auto_merge_prs.sh 安全检查:CI状态+标签白名单+Review审批
CI/CD Pipeline / Frontend Lint (push) Successful in 1m34s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 10m0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
2026-07-09 13:50:04 +08:00
xiaoxia 2a6d3f0d8b ci(P1-5): 统一 build_release_images.sh 的 :dev tag 并推送至 Registry
CI/CD Pipeline / Frontend Lint (push) Successful in 1m53s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 10m0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
2026-07-09 13:49:20 +08:00
xiaoxia 5772de2ade ci(P1-2): 删除 performance-check 中第一个死代码 step
CI/CD Pipeline / Frontend Lint (push) Successful in 1m41s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 10m0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
performance-check job 中有两个 step 都在做性能测试:
- 第一个 step(118行)使用 while read 子 shell 方式,变量全部丢失,结果完全没用
- 第二个 step 使用函数方式,正确统计结果

删除无用的第一个 step,减少约一半的请求次数和执行时间。
2026-07-09 13:47:07 +08:00
xiaoxia ed398b8c78 ci(P1-1): 删除重复的 tests.yml 流水线
CI/CD Pipeline / Frontend Lint (push) Successful in 1m41s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 10m0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
ci-cd.yml 的 validate job 已经覆盖了 tests.yml 的全部功能:
- 单元测试 + 集成测试
- Black 代码格式化检查
- Flake8 静态分析
- 还有安全扫描、迁移检查等 tests.yml 没有的检查

且 ci-cd.yml 已配置 pull_request 触发,PR 时会自动运行。
删除重复流水线,减少维护成本。
2026-07-09 13:46:11 +08:00
xiaoxia bc83a361b1 ci(P0-3): 修复 daily-check.yml 中 job outputs 配置错误
CI/CD Pipeline / Frontend Lint (push) Successful in 1m49s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 10m0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
- staging-api-tests.outputs.report: steps.smoke → steps.report
  (smoke step 输出的是 api_report,report step 才输出 report)
- staging-e2e.outputs.report: steps.smoke → steps.e2e
  (该 job 的 step id 是 e2e,不是 smoke)
- 修复后 daily-report job 才能正确获取各巡检项状态
2026-07-09 13:45:40 +08:00
xiaoxia b012a7da00 ci(P0-2): 删除调试残留的 test-ssh-secret.yml
CI/CD Pipeline / Frontend Lint (push) Successful in 1m56s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 10m0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
该文件是用于调试 SSH secret 配置的临时 workflow,
仅在修改自身时触发,无实际业务用途,应从生产 workflow 目录移除。
2026-07-09 13:44:17 +08:00
xiaoxia f678504b97 ci(P0-1): 移除明文测试账号密码,改用 Gitea Secrets
CI/CD Pipeline / Frontend Lint (push) Successful in 2m16s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 10m1s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
- 创建 STAGING_TEST_USER / STAGING_TEST_PASSWORD 两个 secret
- 修改 daily-check.yml 中 5 处明文凭据引用
- 涉及 staging-api-tests 和 performance-check 两个 job
2026-07-09 13:44:05 +08:00