chore: develop → main 同步 v0.1.99 #116

Merged
xiaoxia merged 19 commits from develop into main 2026-06-29 21:32:49 +08:00
Owner

同步内容

v0.1.92 ~ v0.1.99 的所有变更同步到 main:

  • PR#108: editingPlanner mock→真实API
  • PR#109: 扩展生成任务API(方案A),含数据库迁移 014+015
  • PR#110: tasks.ts mock→真实API
  • PR#111: tasks.ts 类型对齐后端schema
  • PR#112: fix/projects-500-and-dashboard
  • PR#113: 清理 entities.py 重复实体定义
  • PR#114: 修复3个P0端点500错误根因
  • PR#115: 删除AssetModel幽灵列storage_key

自动化测试 v0.1.99 验证通过。

## 同步内容 v0.1.92 ~ v0.1.99 的所有变更同步到 main: - PR#108: editingPlanner mock→真实API - PR#109: 扩展生成任务API(方案A),含数据库迁移 014+015 - PR#110: tasks.ts mock→真实API - PR#111: tasks.ts 类型对齐后端schema - PR#112: fix/projects-500-and-dashboard - PR#113: 清理 entities.py 重复实体定义 - PR#114: 修复3个P0端点500错误根因 - PR#115: 删除AssetModel幽灵列storage_key 自动化测试 v0.1.99 验证通过。
xiaoxia added 19 commits 2026-06-29 21:32:40 +08:00
fix(api): editingPlanner 对接后端 /templates API,删除遗留 editPlans.ts (#108)
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
8c4c428cdc
Squash merge PR#108
- editingPlanner.ts: mock → 真实 /templates API(7个函数)
- editPlans.ts: 已删除
- 代码审计通过
fix: TypeScript类型错误修复 - warning→warnings, seg.id非空断言
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
8c678b9cd0
feat: 扩展生成任务API支持模板模式
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
ea9e536740
方案A: 后端扩展3处API改动,支持前端模板中心化模型。

1. POST /api/v1/generation/tasks — project_id改为可选,新增template_id/asset_ids/title_ids/voice_ids
2. GET /api/v1/generation/tasks + GET /api/v1/tasks — 新增用户级列表(跨project)
3. POST /api/v1/tasks/{task_id}/retry + POST /api/v1/generation/tasks/{task_id}/retry — 简化重试

改动涉及:
- Domain: GenerationTask新增6个字段,放宽create()校验
- Application: CreateGenerationTaskCommand新增字段
- Ports: GenerationTaskRepository新增list_by_user()
- Adapter: SQLAlchemy模型+仓储实现新字段和list_by_user
- Schema: 双模式校验(project模式/模板模式)
- Routes: generation_tasks + task_center双路由注册
- Migration: 015_add_generation_task_extensions

向后兼容:所有旧端点和参数不变。
fix: retry 端点增加归属校验 (P1 安全修复)
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
d2097744e4
- generation_tasks.py: retry_generation_task 增加 created_by_user_id 校验
- task_center.py: retry_task_by_id 增加 created_by_user_id 校验
- 非任务创建者返回 403 Access denied
Merge pull request 'feat: 扩展生成任务API支持模板模式(方案A)' (#109) from feat/generation-api-extension into develop
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
35446732ea
fix: tasks.ts mock → 真实 API 迁移,对接后端方案 A(PR #109)
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
c2a522babf
- createGenerationTask: 关闭 mock,调用 POST /generation/tasks
- getUserTasks: 关闭 mock,调用 GET /tasks(用户级列表)
- retryTask: 关闭 mock,调用 POST /tasks/{task_id}/retry
- 删除所有 mock 数据和 USE_MOCK 开关
Merge pull request 'fix: tasks.ts mock → 真实 API 迁移,对接后端方案 A' (#110) from fix/tasks-mock-to-real-api into develop
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
70ad41bf94
fix: tasks.ts 类型定义对齐后端 schema(P2 修复)
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
265e49587f
- CreateGenerationTaskResponse: task_id→id, message→error_message, 补全所有字段
- TaskItem: 补充 project_id, template_id 字段

对齐后端 GenerationTaskResponse 和 UserTaskResponse schema
Merge pull request 'fix: tasks.ts 类型定义对齐后端 schema(P2 修复)' (#111) from fix/tasks-response-type-alignment into develop
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
3c6b8aa362
fix: 修复 projects 500 + 实现 dashboard/overview 端点
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
e723025889
Bug 1: GET /api/v1/projects → 500
- _to_project_response() 缺少 owner_user_id 和 shared_users 字段
- 补全 ProjectResponse schema 必填字段

Bug 2: GET /api/v1/dashboard/overview → 404
- 新建 dashboard schema + route
- 添加 count_by_user / count_by_project_ids / sum_storage_by_project_ids 仓储方法
- 注册 /api/v1/dashboard 路由
fix: PR#112 P2 建议修复
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
d2578a9093
P2-1: list_by_user[:5] → list_recent_by_user(user_id, limit=5) SQL层LIMIT
P2-2: DashboardOverviewResponse 补充 subscription 字段(plan + is_active)

- packages/ports/generation_task_repository.py: 新增 list_recent_by_user
- packages/adapters/sqlalchemy_impl/generation_task_repository.py: 实现
- apps/api/app/schemas/dashboard.py: 新增 SubscriptionInfo + subscription 字段
- apps/api/app/api/routes/dashboard.py: 使用新接口 + 填充 subscription
Merge pull request 'fix: 修复 projects 500 + 实现 dashboard/overview 端点' (#112) from fix/projects-500-and-dashboard into develop
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
4c1139b681
fix: 清理 entities.py 重复实体定义,统一使用独立域模块
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
f80a311082
移除 entities.py 中与其他独立域文件重复的 dataclass 定义:
- ClassificationJob → 统一从 classification.py 导入
- GenerationTask → 统一从 generation_task.py 导入
- GeneratedVideo → 统一从 generated_video.py 导入
- EditTemplate → 已废弃,无引用

重复定义导致字段不一致(如 GenerationTask 缺少 template_id/asset_ids,
GeneratedVideo.file_size 类型 float vs int),可能引发运行时错误。

Fixes: #150

Co-Authored-By: 灵应 <437848575@qq.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merge pull request 'fix: 清理 entities.py 重复实体定义,消除域模型冲突' (#113) from fix/domain-entity-cleanup into develop
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
401a55cfcb
fix: 修复 3 个 P0 端点 500 错误的真正根因
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
f9e8d6efdc
Bug 1 — GET /api/v1/assets → 500:
  asset_repository 所有方法为 async def,但调用方为同步上下文,
  未 await 导致返回 coroutine 对象而非实际数据。
  修复:全部改为 def(同步),与 SQLAlchemy 同步 Session 一致。

Bug 2 — POST /api/v1/generation/tasks → 500:
  GenerationTaskModel 仍定义 edit_plan_id 列,但迁移 011 已从数据库
  删除该列,INSERT 时报 column does not exist。
  修复:从 model、repository、domain entity、application use case、
  所有路由中彻底移除 edit_plan_id 引用。

Bug 3 — GET /api/v1/dashboard/overview → 500:
  generation_task_repository._to_domain() 访问 model.edit_plan_id,
  该列已被迁移 011 删除,触发 AttributeError。
  修复:同上,移除 edit_plan_id 引用。

涉及文件:
  - packages/adapters/sqlalchemy_impl/asset_repository.py (async→sync)
  - packages/ports/asset_repository.py (async→sync 接口)
  - packages/adapters/sqlalchemy_impl/models.py (移除 edit_plan_id 列)
  - packages/adapters/sqlalchemy_impl/generation_task_repository.py
  - packages/domain/generation_task.py
  - packages/application/generation_tasks.py
  - apps/api/app/api/routes/generation_tasks.py
  - apps/api/app/api/routes/task_center.py
fix: 从迁移 015 中移除残留的 edit_plan_id(代码审计 P1)
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
7783f36172
迁移 011 已删除 edit_plan_id 列,迁移 015 不应再 add_column。
同时从 downgrade() 中移除对应的 drop_column。
Merge pull request 'fix: 修复 3 个 P0 端点 500 错误根因(async/sync 不匹配 + edit_plan_id 残留)' (#114) from fix/p0-endpoint-500-root-cause into develop
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
6b5959bafd
fix: 删除 AssetModel 幽灵列 storage_key(数据库中不存在)
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
7b08029e2e
根因:AssetModel 定义了 storage_key 列,但 assets 表从未包含此列。
SQLAlchemy 的 session.query(AssetModel) 生成 SELECT 时包含
assets.storage_key,导致 PostgreSQL 报错 column does not exist。

影响端点:
- GET /api/v1/assets?library_id=xxx → 500
- POST /api/v1/generation/tasks → 500(调用 find_by_library 验证素材)
- GET /api/v1/dashboard/overview → 500(调用 count_by_project_ids 统计)

修复:删除 models.py 中 AssetModel 的 storage_key 列定义。
域实体的 storage_key 字段通过 _to_domain() 从 model.file_url 映射,不受影响。
Merge pull request 'fix: 删除 AssetModel 幽灵列 storage_key(修复 P0 端点 500)' (#115) from fix/p0-endpoint-500-root-cause into develop
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
Tests / lint (pull_request) Failing after 231h21m54s
Tests / test (pull_request) Failing after 231h21m55s
afea0a7566
xiaoxia merged commit f07efd57b3 into main 2026-06-29 21:32:49 +08:00
Sign in to join this conversation.