fix(e2e): 替换已删除的 POST /templates 为 GET /templates 获取默认模板 #1931

Merged
auto-approve-bot merged 1 commits from fix/e2e-template-cleanup into develop 2026-09-15 13:49:32 +08:00
Owner

背景

#1918 删除模板 CRUD 端点后,apps/web/e2e/core-generation.spec.ts 第 148 行 expect(template.status()).toBe(201) 一直失败,阻塞 staging E2E。

修改

  • 移除手动 POST /api/v1/templates 创建测试模板的代码(该端点已删除)
  • 改为调用 GET /api/v1/templates,利用 #1926 P0 修复中 GET /templates 对新用户自动兜底创建默认模板的逻辑
  • 断言返回 items[0].id 为 truthy,后续流程依赖的默认模板已存在
  • 删除不再使用的 TemplateResponse 类型

验证

  • Prettier 格式化通过
  • 改动仅在 e2e 测试文件,不影响生产代码
  • 本地无需跑 Playwright(需真实账号环境),等 CI 跑 e2e 验证

关联: #1926, #1918

## 背景 #1918 删除模板 CRUD 端点后,`apps/web/e2e/core-generation.spec.ts` 第 148 行 `expect(template.status()).toBe(201)` 一直失败,阻塞 staging E2E。 ## 修改 - 移除手动 `POST /api/v1/templates` 创建测试模板的代码(该端点已删除) - 改为调用 `GET /api/v1/templates`,利用 #1926 P0 修复中 GET /templates 对新用户自动兜底创建默认模板的逻辑 - 断言返回 `items[0].id` 为 truthy,后续流程依赖的默认模板已存在 - 删除不再使用的 `TemplateResponse` 类型 ## 验证 - Prettier 格式化通过 - 改动仅在 e2e 测试文件,不影响生产代码 - 本地无需跑 Playwright(需真实账号环境),等 CI 跑 e2e 验证 关联: #1926, #1918
xiaoxia added 1 commit 2026-09-15 13:38:17 +08:00
fix(e2e): replace removed POST /templates with GET /templates (#1926 auto-default)
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m33s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m41s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m53s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m53s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 4m42s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 4m50s
AI Code Review / AI Code Review (pull_request) Successful in 6m43s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 10m13s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 4s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 9m19s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 21s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 39s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 12m59s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 25h34m45s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 25h45m17s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 25h45m23s
CI/CD Pipeline / PR Build API Image (pull_request) Failing after 25h45m25s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 25h44m46s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 25h44m45s
CI/CD Pipeline / PR Build Worker Image (pull_request) Failing after 25h44m47s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 25h34m9s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 25h34m9s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 25h34m11s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 25h44m49s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 25h34m6s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 25h44m39s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 25h44m44s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 25h44m45s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 25h44m39s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 25h44m43s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 25h44m44s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 25h44m46s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 26h20m20s
8e9e8a1c8e
auto-approve-bot approved these changes 2026-09-15 13:40:10 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot approved these changes 2026-09-15 13:40:10 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot merged commit 0e5127df05 into develop 2026-09-15 13:49:32 +08:00
auto-approve-bot deleted branch fix/e2e-template-cleanup 2026-09-15 13:49:33 +08:00

🗑️ 预览环境已清理

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

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

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

🚀 预览环境已部署

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

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

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

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

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1931 | | 预览链接 | [https://pr-1931.preview.xiaoxiajianji.com](https://pr-1931.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
Sign in to join this conversation.