fix: cover.py step3 改用 user+template 查找预览任务;删除 generation.py 冗余 rendered_url
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 1m33s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 1m36s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m24s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 2m31s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 5m7s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 6m38s
CI/CD Pipeline / Integration Tests (push) Successful in 1m58s
CI/CD Pipeline / Unit Tests (push) Successful in 9m9s
CI/CD Pipeline / Build Staging API Image (push) Successful in 12m11s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 48s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 36s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 44s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 2m51s
CI/CD Pipeline / Canary Release to Production (push) Failing after 855h3m55s
CI/CD Pipeline / Deploy Production (push) Failing after 855h10m36s
CI/CD Pipeline / CI Gate (push) Failing after 855h10m36s
CI/CD Pipeline / Build Production Web Image (push) Failing after 855h10m37s
CI/CD Pipeline / Build Production API Image (push) Failing after 855h10m37s
CI/CD Pipeline / PR Build Web Image (push) Failing after 855h19m46s
CI/CD Pipeline / PR Build API Image (push) Failing after 855h19m47s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 855h19m48s
CI/CD Pipeline / Production Browser E2E (push) Failing after 855h44m5s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 855h44m6s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 855h53m15s
CI/CD Pipeline / Frontend Lint (push) Failing after 855h53m16s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 1m33s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 1m36s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m24s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 2m31s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 5m7s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 6m38s
CI/CD Pipeline / Integration Tests (push) Successful in 1m58s
CI/CD Pipeline / Unit Tests (push) Successful in 9m9s
CI/CD Pipeline / Build Staging API Image (push) Successful in 12m11s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 48s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 36s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 44s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 2m51s
CI/CD Pipeline / Canary Release to Production (push) Failing after 855h3m55s
CI/CD Pipeline / Deploy Production (push) Failing after 855h10m36s
CI/CD Pipeline / CI Gate (push) Failing after 855h10m36s
CI/CD Pipeline / Build Production Web Image (push) Failing after 855h10m37s
CI/CD Pipeline / Build Production API Image (push) Failing after 855h10m37s
CI/CD Pipeline / PR Build Web Image (push) Failing after 855h19m46s
CI/CD Pipeline / PR Build API Image (push) Failing after 855h19m47s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 855h19m48s
CI/CD Pipeline / Production Browser E2E (push) Failing after 855h44m5s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 855h44m6s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 855h53m15s
CI/CD Pipeline / Frontend Lint (push) Failing after 855h53m16s
P0 修复:预览任务创建时 plan_id 尚未存在,source_edit_plan_id 始终为空, 导致封面生成第三步查找永远匹配不到。改为按 user_id + template_id + is_preview + status=completed 查找最近预览任务。 技术债:generation.py 复用预览产物分支删除冗余 rendered_url 写入, 统一只写 rendered_storage_key。 新增 repository 方法:list_latest_completed_preview(user_id, template_id)
This commit is contained in:
@@ -148,6 +148,22 @@ class SQLAlchemyGenerationTaskRepository:
|
||||
)
|
||||
return [_to_domain(m) for m in models]
|
||||
|
||||
def list_latest_completed_preview(self, user_id: str, template_id: str, limit: int = 1) -> list[GenerationTask]:
|
||||
"""按用户+模板查找最近已完成的预览任务。"""
|
||||
models = (
|
||||
self.session.query(GenerationTaskModel)
|
||||
.filter(
|
||||
GenerationTaskModel.created_by_user_id == user_id,
|
||||
GenerationTaskModel.template_id == template_id,
|
||||
GenerationTaskModel.is_preview,
|
||||
GenerationTaskModel.status == "completed",
|
||||
)
|
||||
.order_by(GenerationTaskModel.created_at.desc())
|
||||
.limit(limit)
|
||||
.all()
|
||||
)
|
||||
return [_to_domain(m) for m in models]
|
||||
|
||||
def list_by_source_edit_plan(self, plan_id: str) -> list[GenerationTask]:
|
||||
models = (
|
||||
self.session.query(GenerationTaskModel)
|
||||
|
||||
Reference in New Issue
Block a user