fix(#1834): 批量修复 UP 系列静态分析警告(UP007/UP006/UP017/UP035) #1928

Merged
auto-approve-bot merged 2 commits from fix/1834-ruff-static-fixes into develop 2026-09-15 12:59:19 +08:00
Owner

变更内容

批量修复 UP 系列(971处)

  • UP007: Optional[X] → X | None(475处)
  • UP006: List/Dict/Tuple/Set/Type → list/dict/tuple/set/type(290处)
  • UP017: timezone.utc → datetime.UTC(205处)
  • UP035: 移除 typing 模块已弃用导入(91处)

已确认状态

  • B006(4处)、B909(1处)、B904(10处)、B023(1处)→ develop 上已全部修复 ✅
  • B008(468处 FastAPI Depends)→ 已在 ruff 配置中忽略 ✅

影响范围

  • 共修改 224 个文件,涉及 apps/、packages/、tests/、scripts/
  • 均为类型注解现代化改造,无逻辑变更
  • 本地 ruff check 全通过,关键单元测试通过

Closes #1834

## 变更内容 ### 批量修复 UP 系列(971处) - **UP007**: `Optional[X]` → `X | None`(475处) - **UP006**: `List/Dict/Tuple/Set/Type` → `list/dict/tuple/set/type`(290处) - **UP017**: `timezone.utc` → `datetime.UTC`(205处) - **UP035**: 移除 typing 模块已弃用导入(91处) ### 已确认状态 - B006(4处)、B909(1处)、B904(10处)、B023(1处)→ develop 上已全部修复 ✅ - B008(468处 FastAPI Depends)→ 已在 ruff 配置中忽略 ✅ ### 影响范围 - 共修改 224 个文件,涉及 apps/、packages/、tests/、scripts/ - 均为类型注解现代化改造,无逻辑变更 - 本地 ruff check 全通过,关键单元测试通过 Closes #1834
xiaoxia added 1 commit 2026-09-15 12:43:50 +08:00
fix(#1834): 批量修复 UP 系列静态分析警告
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 47s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 47s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m13s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m26s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m48s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m5s
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 26h39m38s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 26h39m44s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 26h39m53s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 26h39m13s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 26h39m6s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 26h39m6s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 26h39m8s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 26h39m13s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 26h39m15s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 26h39m13s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 26h39m13s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 26h39m0s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 26h39m3s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 26h39m16s
4244c558a5
- UP007: Optional[X] -> X | None
- UP006: List/Dict/Tuple/Set/Type -> list/dict/tuple/set/type
- UP017: timezone.utc -> datetime.UTC
- UP035: 移除 typing 模块已弃用的导入

共修复 224 个文件,971 处问题
B006/B909/B904/B023 在 develop 上已全部通过
B008 已在 ruff 配置中忽略(FastAPI Depends 模式)

Closes #1834

🚀 预览环境已部署

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

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

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

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

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1928 | | 预览链接 | [https://pr-1928.preview.xiaoxiajianji.com](https://pr-1928.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
auto-approve-bot added 1 commit 2026-09-15 12:47:47 +08:00
style: auto-format with black + isort + ruff + prettier [skip ci-format-check]
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 2s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 51s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 51s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m9s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m47s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m17s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 2m35s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m9s
AI Code Review / AI Code Review (pull_request) Successful in 6m44s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 6m58s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 10m43s
CI/CD Pipeline / CI Gate (pull_request) Successful in 2s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 8m13s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 38s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 2m42s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 26h25m5s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 26h35m41s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 26h35m49s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 26h35m51s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 26h35m12s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 26h35m18s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 26h24m26s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 26h24m28s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 26h24m28s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 26h24m26s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 26h35m0s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 26h35m0s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 26h35m7s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 26h35m11s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 26h35m7s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 26h35m8s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 26h35m12s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 26h35m13s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 27h10m44s
e93949ac05
auto-approve-bot merged commit 53fb25efcf into develop 2026-09-15 12:59:19 +08:00
auto-approve-bot deleted branch fix/1834-ruff-static-fixes 2026-09-15 12:59:20 +08:00

🗑️ 预览环境已清理

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

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

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