fix(ci): 同步daily-check和acr-cleanup的docker兼容性修复到main #1012

Merged
xiaoxia merged 2 commits from fix/ci-workflow-docker-main-sync into main 2026-07-27 08:46:05 +08:00
Owner

cherry-pick #981的核心修复到main分支,用于schedule类workflow的最终验证。

修复内容:

  • daily-check.yml: checkout步骤改为curl下载step_checkout.sh方式,兼容docker runner
  • acr-cleanup.yml: 同上,修复Setup Python秒败问题

相关PR: #981
相关工单: #980

cherry-pick #981的核心修复到main分支,用于schedule类workflow的最终验证。 修复内容: - daily-check.yml: checkout步骤改为curl下载step_checkout.sh方式,兼容docker runner - acr-cleanup.yml: 同上,修复Setup Python秒败问题 相关PR: #981 相关工单: #980
xiaoxia added 2 commits 2026-07-27 07:57:33 +08:00
fix(ci): docker runner兼容性修复 - acr-cleanup.yml
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 11s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 59s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 56s
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 / Frontend Lint (pull_request) Successful in 29s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m1s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 56s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m2s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 2m52s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 1m15s
AI Code Review / AI Code Review (pull_request) Successful in 2m36s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m29s
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 / Unit Tests (pull_request) Successful in 3m27s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m53s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Has been cancelled
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 / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 22s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
540463d873
Collaborator

代码审查结果 - PR #1012

⚠️ 问题(3个需要修改)

  1. .gitea/workflows/acr-cleanup.yml 第41行, .gitea/workflows/daily-check.yml 第30/101/211行curl 命令缺少 -f (fail) 参数。如果 API 返回 404 或 500 错误,curl 默认会将错误页面 HTML 输出到 stdout 并返回 0,导致 bash 尝试解析执行 HTML 代码,产生难以排查的错误或安全风险。
  2. .gitea/workflows/acr-cleanup.yml 第41行, .gitea/workflows/daily-check.yml 第30/101/211行:移除了原有的 Python 脚本中实现的健壮的重试机制(5次重试、指数退避)。新的 curl 命令没有重试逻辑,在网络不稳定的环境下极易导致 CI 流水线失败。
  3. .gitea/workflows/acr-cleanup.yml 第36-41行:移除了 actions/setup-python@v5 步骤。如果该 Job 的后续步骤依赖 Python 3.12 环境,现在将完全依赖 Runner 镜像预装的 Python 版本,存在环境不一致导致构建失败的风险。

💡 建议(1个可选)

  1. .gitea/workflows/acr-cleanup.yml 第41行, .gitea/workflows/daily-check.yml 第30/101/211行:直接使用 curl ... | bash 存在供应链安全风险(如脚本被篡改或中间人攻击)。建议改为下载脚本到临时文件后执行,或者使用 bash <(curl ... -f) 以减少管道带来的不确定性,并确保 curl 失败时流程终止。

格式检查通过 | 逻辑审查需修改 | 建议关注性能


🤖 由 AI 代码审查机器人自动生成 | 2026-07-27 00:26:01 | 模型:

## 代码审查结果 - PR #1012 ### ⚠️ 问题(3个需要修改) 1. **.gitea/workflows/acr-cleanup.yml 第41行, .gitea/workflows/daily-check.yml 第30/101/211行**:`curl` 命令缺少 `-f` (fail) 参数。如果 API 返回 404 或 500 错误,`curl` 默认会将错误页面 HTML 输出到 stdout 并返回 0,导致 `bash` 尝试解析执行 HTML 代码,产生难以排查的错误或安全风险。 2. **.gitea/workflows/acr-cleanup.yml 第41行, .gitea/workflows/daily-check.yml 第30/101/211行**:移除了原有的 Python 脚本中实现的健壮的重试机制(5次重试、指数退避)。新的 `curl` 命令没有重试逻辑,在网络不稳定的环境下极易导致 CI 流水线失败。 3. **.gitea/workflows/acr-cleanup.yml 第36-41行**:移除了 `actions/setup-python@v5` 步骤。如果该 Job 的后续步骤依赖 Python 3.12 环境,现在将完全依赖 Runner 镜像预装的 Python 版本,存在环境不一致导致构建失败的风险。 ### 💡 建议(1个可选) 1. **.gitea/workflows/acr-cleanup.yml 第41行, .gitea/workflows/daily-check.yml 第30/101/211行**:直接使用 `curl ... | bash` 存在供应链安全风险(如脚本被篡改或中间人攻击)。建议改为下载脚本到临时文件后执行,或者使用 `bash <(curl ... -f)` 以减少管道带来的不确定性,并确保 `curl` 失败时流程终止。 --- ❌ 格式检查通过 | ❌ 逻辑审查需修改 | ✅ 建议关注性能 --- <sub>🤖 由 AI 代码审查机器人自动生成 | 2026-07-27 00:26:01 | 模型: </sub> <!-- AI_CODE_REVIEW_AUTO_COMMENT -->
xiaoxia merged commit 77704e7ec6 into main 2026-07-27 08:46:05 +08:00
xiaoxia deleted branch fix/ci-workflow-docker-main-sync 2026-07-27 08:46:05 +08:00

🗑️ 预览环境已清理

PR #1012 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1012 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.