Skip to content

[AI] fix: 修复同步 PR 质量门禁快照断言 - #46

Merged
jiahim merged 1 commit into
automation/sync-openai-docsfrom
codex/fix-pr45-quality-gate
Aug 31, 2026
Merged

[AI] fix: 修复同步 PR 质量门禁快照断言#46
jiahim merged 1 commit into
automation/sync-openai-docsfrom
codex/fix-pr45-quality-gate

Conversation

@jiahim

@jiahim jiahim commented Aug 31, 2026

Copy link
Copy Markdown
Owner

问题

#45 同步了 OpenAI 官方文档的真实增删后,静态站测试仍断言旧数据集的固定页面数和固定更新批次数量,导致 Quality gate 失败:

  • 有效英文页面已变为 390,测试仍要求至少 400
  • 最新批次已变为 1 新增 / 62 修改 / 33 删除,测试仍要求旧批次 1 / 56 / 0

修复

  • 英文、中文生成文档与源清单、翻译清单做精确 sourceUrl 集合比较
  • 检查清单键、生成集合唯一性和非空数据,防止漏页被重复页面掩盖
  • 从更新记录独立解析时间并选择最新批次,校验规范化 ID、文件名与时间唯一性
  • 校验批次条目的 HTTPS 来源、路径/路由/URL 映射和分类唯一性
  • 动态选择有效代表页面,移除会随官方内容变化的页面数量、字节数和具体路由快照
  • 测试路径改为基于 import.meta.url 定位仓库

TDD 与验证

  • 原始 [AI] docs: 同步 OpenAI 官方英文文档 #45 数据:Web 测试 17/20,精确复现 CI 的 3 个失败
  • 修复后 Web 测试:20/20
  • mutation:重复英文 sourceUrl 会失败
  • mutation:批次 URL 降级为 HTTP 会失败
  • 根测试:106/106
  • 根/Web TypeScript 检查:通过
  • Web ESLint:通过
  • 文档及翻译清单完整性:通过
  • Next.js 构建:793 个静态页面,退出码 0
  • git diff --check:通过

合入顺序

本 PR 以 automation/sync-openai-docs 为 base。合入本 PR 后,#45 的 head 会更新并重新运行面向 main 的标准 Quality gate;随后再审核并合入 #45

关联:#45

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open-ai-api-chinese Ready Ready Preview Aug 31, 2026 6:45am

@jiahim
jiahim merged commit 603b050 into automation/sync-openai-docs Aug 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant