fix(ci): actions/cache@v4 加 continue-on-error——缓存故障不阻断 job #1587

Merged
xiaoxia merged 1 commits from fix/cache-continue-on-error into develop 2026-08-31 23:54:55 +08:00
Owner

问题

.gitea/workflows/ci-pipeline.yml 中所有 5 个 actions/cache@v4 步骤没有 continue-on-error。当 Gitea Actions 缓存基础设施出现瞬态故障(git cache EOF / 归档损坏)时,cache restore 步骤直接失败 → 整个 job 挂掉,后续的 pip install 重试逻辑根本跑不到。

修复

给所有 5 个 actions/cache@v4 步骤加 continue-on-error: true。缓存恢复失败时 job 不会中断,继续执行 pip install 走 fresh download(各 job 的 pip install 已有重试逻辑兜底)。

修改内容

5 个位置(结构完全一样):

Job Cache 类型 行号
validate-style pip cache ~152
validate-security pip cache ~255
validate-python pip cache ~356
unit-tests pip cache ~461
frontend-unit-test npm cache ~670

不改动的内容

  • 其他任何 CI 步骤不变
  • cache 的 key/path/restore-keys 不变
## 问题 .gitea/workflows/ci-pipeline.yml 中所有 5 个 `actions/cache@v4` 步骤没有 `continue-on-error`。当 Gitea Actions 缓存基础设施出现瞬态故障(git cache EOF / 归档损坏)时,cache restore 步骤直接失败 → 整个 job 挂掉,后续的 pip install 重试逻辑根本跑不到。 ## 修复 给所有 5 个 `actions/cache@v4` 步骤加 `continue-on-error: true`。缓存恢复失败时 job 不会中断,继续执行 pip install 走 fresh download(各 job 的 pip install 已有重试逻辑兜底)。 ## 修改内容 5 个位置(结构完全一样): | Job | Cache 类型 | 行号 | |-----|-----------|------| | validate-style | pip cache | ~152 | | validate-security | pip cache | ~255 | | validate-python | pip cache | ~356 | | unit-tests | pip cache | ~461 | | frontend-unit-test | npm cache | ~670 | ## 不改动的内容 - 其他任何 CI 步骤不变 - cache 的 key/path/restore-keys 不变
xiaoxia added 1 commit 2026-08-31 22:42:26 +08:00
fix(ci): actions/cache@v4 加 continue-on-error——缓存故障不阻断 job
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 3m20s
AI Code Review / AI Code Review (pull_request) Successful in 3m32s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 5m5s
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m18s
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 Worker Image (pull_request) Successful in 48s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 6m28s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 14m53s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (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 / Validate - Python (mypy + alembic) (pull_request) Successful in 16m10s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 26m53s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 37m22s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 47m49s
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 Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 2s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 4m38s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 5m30s
f412b322f0
所有 5 个 actions/cache@v4 步骤加 continue-on-error: true:
- validate-style pip cache
- validate-security pip cache
- validate-python pip cache
- unit-tests pip cache
- frontend-unit-test npm cache

当 Gitea Actions 缓存基础设施出现瞬态故障(git cache EOF /
归档损坏)时,cache restore 步骤会标黄但不中断 job,
后续的 pip install 重试逻辑自动 fresh download 兜底。
Collaborator

【阻塞级判定】

  • 是否存在阻塞级问题:否
  • 阻塞级问题数量:0 个

📊 审查概览

  • 整体评价:通过
  • 建议级问题数量:0 个

🔴 阻塞级问题(必须修复)

💡 改进建议(不阻塞合并)

良好实践

  1. CI 容错性增强:在所有 actions/cache 步骤中添加 continue-on-error: true 是提升 CI 稳定性的良好实践。这确保了当缓存服务不可用、存储配额已满或发生网络抖动时,管道不会因此中断,而是优雅地回退到直接安装依赖项,避免了因非代码问题导致的构建失败。

🤖 由 AI 代码审查机器人自动生成 | 2026-08-31 14:52:01 | 模型:

### 【阻塞级判定】 - 是否存在阻塞级问题:否 - 阻塞级问题数量:0 个 ### 📊 审查概览 - 整体评价:通过 - 建议级问题数量:0 个 ### 🔴 阻塞级问题(必须修复) 无 ### 💡 改进建议(不阻塞合并) 无 ### ✅ 良好实践 1. **CI 容错性增强**:在所有 `actions/cache` 步骤中添加 `continue-on-error: true` 是提升 CI 稳定性的良好实践。这确保了当缓存服务不可用、存储配额已满或发生网络抖动时,管道不会因此中断,而是优雅地回退到直接安装依赖项,避免了因非代码问题导致的构建失败。 --- <sub>🤖 由 AI 代码审查机器人自动生成 | 2026-08-31 14:52:01 | 模型: </sub> <!-- AI_CODE_REVIEW_AUTO_COMMENT -->

🚀 预览环境已部署

项目 详情
PR号 #1587
预览链接 https://pr-1587.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1587 | | 预览链接 | [https://pr-1587.preview.xiaoxiajianji.com](https://pr-1587.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
xiaoxia merged commit 56766c6a1a into develop 2026-08-31 23:54:55 +08:00

🗑️ 预览环境已清理

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

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

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