Phase 4 Backend P0 cleanup #276

Merged
xiaoxia merged 1 commits from cleanup/phase4-backend-p0 into develop 2026-07-13 18:04:49 +08:00
Owner

Phase 4 Backend P0 清理

1. 删除 aiosmtplib 废弃依赖

  • 从 requirements.txt 移除 aiosmtplib==3.0.2(项目中未使用)

2. 清理未使用配置项

  • 删除 5 个未使用配置:API_PREFIXREDIS_MAX_CONNECTIONJWT_SECRET_KEY_OLDSECRET_ROTATION_DAYSLOG_LEVEL
  • 保留 ENABLE_REDIS_SESSIONS(在 dependencies.py 中实际使用)
  • 同步清理 .env.production.example 和 init_production_env.sh

3. 修复项目权限检查 TODO

  • test_error_scenarios.py 中的 TODO 已过期(权限已实现)
  • 更新断言:访问/删除他人项目应返回 403

4. 合并两套 Storage 实现

  • packages/shared/storage.py:合并 API 特有功能(HTTPS endpoint 修复、diagnose() 诊断、详细日志)
  • apps/api/app/core/storage.py:改为薄层 re-export wrapper,保持向后兼容
  • 更新测试 mock 目标指向 packages.shared.storage

变更文件(9个)

  • requirements.txt
  • apps/api/app/config.py
  • apps/api/app/core/storage.py
  • packages/shared/storage.py
  • .env.production.example
  • scripts/init_production_env.sh
  • tests/integration/test_error_scenarios.py
  • tests/unit/test_audio_url_presign.py
  • tests/unit/test_p02_oss_credential_validation.py
## Phase 4 Backend P0 清理 ### 1. 删除 aiosmtplib 废弃依赖 - 从 requirements.txt 移除 `aiosmtplib==3.0.2`(项目中未使用) ### 2. 清理未使用配置项 - 删除 5 个未使用配置:`API_PREFIX`、`REDIS_MAX_CONNECTION`、`JWT_SECRET_KEY_OLD`、`SECRET_ROTATION_DAYS`、`LOG_LEVEL` - 保留 `ENABLE_REDIS_SESSIONS`(在 dependencies.py 中实际使用) - 同步清理 .env.production.example 和 init_production_env.sh ### 3. 修复项目权限检查 TODO - test_error_scenarios.py 中的 TODO 已过期(权限已实现) - 更新断言:访问/删除他人项目应返回 403 ### 4. 合并两套 Storage 实现 - `packages/shared/storage.py`:合并 API 特有功能(HTTPS endpoint 修复、diagnose() 诊断、详细日志) - `apps/api/app/core/storage.py`:改为薄层 re-export wrapper,保持向后兼容 - 更新测试 mock 目标指向 `packages.shared.storage` ### 变更文件(9个) - requirements.txt - apps/api/app/config.py - apps/api/app/core/storage.py - packages/shared/storage.py - .env.production.example - scripts/init_production_env.sh - tests/integration/test_error_scenarios.py - tests/unit/test_audio_url_presign.py - tests/unit/test_p02_oss_credential_validation.py
xiaoxia added 1 commit 2026-07-13 17:48:12 +08:00
Phase 4 Backend P0 cleanup
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 6s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 10s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1m6s
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (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 / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Failing after 28m22s
a3967c6829
1. Remove unused aiosmtplib dependency from requirements.txt
2. Remove 5 unused config items (API_PREFIX, REDIS_MAX_CONNECTION,
   JWT_SECRET_KEY_OLD, SECRET_ROTATION_DAYS, LOG_LEVEL) from config.py,
   .env.production.example, and init_production_env.sh.
   Kept ENABLE_REDIS_SESSIONS (actively used in dependencies.py).
3. Fix project permission check TODOs in test_error_scenarios.py —
   permissions are implemented, updated assertions to expect 403.
4. Merge two Storage implementations into shared package:
   - packages/shared/storage.py: merged API features (HTTPS endpoint
     fix, diagnose(), detailed logging) into SharedStorageService
   - apps/api/app/core/storage.py: thin re-export wrapper for
     backward compatibility
   - Updated test mocks to target packages.shared.storage
xiaoxia merged commit d061bccdd2 into develop 2026-07-13 18:04:49 +08:00
Sign in to join this conversation.