fix: 后端代码健康修复 (P1-1/P1-2/P2-1/P2-2/P2-3) #68

Merged
xiaoxia merged 8 commits from develop into main 2026-06-28 10:48:47 +08:00
Owner

修复内容

P1-1: auth.py forgot_password 硬编码 localhost

  • 文件: apps/api/app/api/routes/auth.py
  • 修复: base_url="http://localhost:3000"base_url=settings.APP_BASE_URL

P1-2: generation.py 直接创建DB连接

  • 文件: apps/worker/worker_app/tasks/generation.py
  • 修复: _download_library_assets() 改用 Worker 的 SessionLocal 替代直接 create_engine(),避免连接泄漏

P2-1: EditingMode 枚举重复定义

  • 文件: apps/worker/video_processing/editing_modes.py
  • 修复: 改为从 packages.domain.edit_plan 导入 EditingMode,消除重复定义

P2-2: SMTP_FRON_NAME 拼写错误

  • 文件: apps/api/app/config.py
  • 修复: SMTP_FRON_NAMESMTP_FROM_NAME(修复后与 dependencies.py 的引用一致)

P2-3: UserModel 配额字段类型不一致

  • 文件: packages/adapters/sqlalchemy_impl/models.py
  • 修复: max_projects, max_storage_gb, used_storage_gbFloat 改为 Integer

P2-4: .env.production DATABASE_MAX_OVERFLOW

  • 状态: 已解决 - .env.production 已从 Git 历史移除,代码默认值已为正确的 10

⚠️ 注意: P2-3 的字段类型变更需要数据库迁移脚本配合执行。

## 修复内容 ### P1-1: auth.py forgot_password 硬编码 localhost - **文件**: `apps/api/app/api/routes/auth.py` - **修复**: `base_url="http://localhost:3000"` → `base_url=settings.APP_BASE_URL` ### P1-2: generation.py 直接创建DB连接 - **文件**: `apps/worker/worker_app/tasks/generation.py` - **修复**: `_download_library_assets()` 改用 Worker 的 `SessionLocal` 替代直接 `create_engine()`,避免连接泄漏 ### P2-1: EditingMode 枚举重复定义 - **文件**: `apps/worker/video_processing/editing_modes.py` - **修复**: 改为从 `packages.domain.edit_plan` 导入 `EditingMode`,消除重复定义 ### P2-2: SMTP_FRON_NAME 拼写错误 - **文件**: `apps/api/app/config.py` - **修复**: `SMTP_FRON_NAME` → `SMTP_FROM_NAME`(修复后与 dependencies.py 的引用一致) ### P2-3: UserModel 配额字段类型不一致 - **文件**: `packages/adapters/sqlalchemy_impl/models.py` - **修复**: `max_projects`, `max_storage_gb`, `used_storage_gb` 从 `Float` 改为 `Integer` ### P2-4: .env.production DATABASE_MAX_OVERFLOW - **状态**: 已解决 - `.env.production` 已从 Git 历史移除,代码默认值已为正确的 10 --- ⚠️ **注意**: P2-3 的字段类型变更需要数据库迁移脚本配合执行。
xiaoxia added 5 commits 2026-06-28 10:27:36 +08:00
fix(P1-1): auth.py forgot_password 硬编码 localhost 改为 settings.APP_BASE_URL
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
d1f2dbffa4
fix(P1-2): generation.py _download_library_assets 改用 Worker SessionLocal 替代直接 create_engine
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
ecfa0d33e4
fix(P2-1): EditingMode 枚举改为从 packages.domain 导入,消除重复定义
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
95fbf52049
fix(P2-2): SMTP_FRON_NAME 拼写错误修正为 SMTP_FROM_NAME
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
095e3b5d00
fix(P2-3): UserModel 配额字段 max_projects/max_storage_gb/used_storage_gb 从 Float 改为 Integer
Tests / test (pull_request) Failing after 0s
Tests / lint (pull_request) Failing after 0s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
9c287145a1
xiaoxia added 1 commit 2026-06-28 10:34:06 +08:00
fix(frontend): 深度健康检查 - 清理死代码和修复合并冲突
Tests / test (pull_request) Failing after 0s
Tests / lint (pull_request) Failing after 0s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
5c46fe648d
- 删除未使用的API模块: projects.ts, generation.ts, subscription.ts, projectTitles.ts
- 删除未使用的业务组件: InviteMemberModal.tsx, MemberList.tsx, PermissionMatrix.tsx
- 删除未引用的布局组件: Sidebar.tsx
- 删除未引用的状态管理: uiStore.ts
- 修复 business.css 中残留的git合并冲突标记
- 移除 business.css 中重复的注释行

所有删除的文件均经过引用检查,确认无任何页面/组件/hook引用
Author
Owner

🔧 前端健康检查修复 (前端编码 Agent)

已完成的检查项

1. 配置文件完整性

  • package.json / tsconfig.json / vite.config.ts 均完整

2. TypeScript 严格检查

  • strict: true / noUnusedLocals: true / noUnusedParameters: true

3. 空文件/死代码清理

  • 空文件:0个 | console.log残留:0个

4. 框架一致性

  • 统一 Vite + React,无 Next.js 痕迹

5. 深度清理(本次提交)

  • 删除4个未使用API模块: projects.ts, generation.ts, subscription.ts, projectTitles.ts
  • 删除3个未使用业务组件: InviteMemberModal.tsx, MemberList.tsx, PermissionMatrix.tsx
  • 删除未引用的 Sidebar.tsx 和 uiStore.ts
  • 修复 business.css 中的git合并冲突标记
  • 总计删除654行无用代码,所有删除均经过全量引用检查
## 🔧 前端健康检查修复 (前端编码 Agent) ### 已完成的检查项 **1. 配置文件完整性** ✅ - package.json / tsconfig.json / vite.config.ts 均完整 **2. TypeScript 严格检查** ✅ - strict: true / noUnusedLocals: true / noUnusedParameters: true **3. 空文件/死代码清理** ✅ - 空文件:0个 | console.log残留:0个 **4. 框架一致性** ✅ - 统一 Vite + React,无 Next.js 痕迹 **5. 深度清理(本次提交)** - 删除4个未使用API模块: projects.ts, generation.ts, subscription.ts, projectTitles.ts - 删除3个未使用业务组件: InviteMemberModal.tsx, MemberList.tsx, PermissionMatrix.tsx - 删除未引用的 Sidebar.tsx 和 uiStore.ts - 修复 business.css 中的git合并冲突标记 - 总计删除654行无用代码,所有删除均经过全量引用检查
xiaoxia added 2 commits 2026-06-28 10:48:36 +08:00
fix(deploy): Worker 容器内存限制从 4G 降至 2G
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
ec96feee22
- Worker 实际内存使用仅 ~156MiB,4G 限制远超需求
- 业务服务器总内存仅 1.7Gi,过高限制影响其他容器
- 2G 限制已足够应对视频处理峰值需求
Merge pull request 'fix(deploy): Worker 容器内存限制从 4G 降至 2G' (#69) from fix/worker-memory-limit into develop
Tests / test (pull_request) Failing after 1s
Tests / lint (pull_request) Failing after 0s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
8cb3b045e4
xiaoxia merged commit 02f21e0f1d into main 2026-06-28 10:48:47 +08:00
Sign in to join this conversation.