8000 fix(CI): 修复 GitHub Actions 后端覆盖率门禁误判与 UI 类型检查失败 by ThreeFish-AI · Pull Request #245 · ThreeFish-AI/negentropy · GitHub
[go: up one dir, main page]

Skip to content

fix(CI): 修复 GitHub Actions 后端覆盖率门禁误判与 UI 类型检查失败#245

Merged
ThreeFish-AI merged 2 commits intofeature/1.0.0from
vk/d6a9-github-actions-w
Mar 13, 2026
Merged

fix(CI): 修复 GitHub Actions 后端覆盖率门禁误判与 UI 类型检查失败#245
ThreeFish-AI merged 2 commits intofeature/1.0.0from
vk/d6a9-github-actions-w

Conversation

@ThreeFish-AI
Copy link
Owner
@ThreeFish-AI ThreeFish-AI commented Mar 13, 2026

背景

GitHub Actions 近期所有 CI 运行均失败,涉及 Backend Test Suite 和 UI Test Suite 两条流水线。本 PR 定位并修复了全部代码层面的问题。

修复内容

1. Backend 集成测试与性能测试覆盖率门禁误判

  • 根因pyproject.tomladdopts 全局注入 --cov,集成测试 15/15 全部通过但覆盖率仅 25%,触发 fail_under=50 门禁失败
  • 修复:集成测试和性能测试的 pytest 命令添加 --no-cov,覆盖率门禁仅对单元测试生效
  • 文件.github/workflows/reusable-negentropy-backend-quality.yml

2. ADK 消息流标准化器变量作用域错误

  • 根因lib/adk.tstext 变量在 else 块内定义(第 278 行),却在外层作用域的 tool 角色消息处理中被引用(第 420 行),导致 TypeScript 编译失败
  • 修复:改为在使用处调用 extractTextParts(payload).join("") 提取文本
  • 文件apps/negentropy-ui/lib/adk.ts

3. 测试数据与 Schema 定义不一致

  • 根因adkFunctionResponseSchema 要求必填 name 字段,测试数据未同步更新
  • 修复:补充 name: "google_search" 字段
  • 文件apps/negentropy-ui/tests/unit/lib/adk.test.ts

备注:Dependency Review Guard

  • 该 Workflow 失败原因是仓库未启用 GitHub Dependency Graph,需管理员在 Settings → Code security and analysis 中手动启用,非代码问题

验证结果

  • pnpm typecheck 通过
  • pnpm typecheck:test 通过
  • pnpm test 全部 334 个测试通过(59 个文件)
  • GitHub Actions Backend Test Suite ✅
  • GitHub Actions UI Test Suite ✅

🤖 Generated with Claude Code

pyproject.toml 的 addopts 全局注入了 --cov,导致集成测试和性能
A2B3
试
虽然全部通过但因覆盖率不足 50% 而失败。添加 --no-cov 显式覆盖,
覆盖率门禁仅对单元测试生效。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
1. lib/adk.ts: tool 角色消息处理中 text 变量超出 else 块作用域,
   改为调用 extractTextParts() 在使用处提取文本。
2. adk.test.ts: functionResponse 测试数据补充必填的 name 字段,
   与 schema.ts 中 adkFunctionResponseSchema 的定义保持一致。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
@ThreeFish-AI ThreeFish-AI merged commit f488851 into feature/1.0.0 Mar 13, 2026
21 of 22 checks passed
@ThreeFish-AI ThreeFish-AI changed the title GitHub Actions 的 Workflow 执行有异常(具体链接如下),深入分析并修复。你可以在推送代码到 GitHub 远程 Repo 后,等待 GitHub Actions 在线 (vibe-kanban) fix(CI): 修复 GitHub Actions 后端覆盖率门禁误判与 UI 类型检查失败 Mar 13, 2026
@ThreeFish-AI ThreeFish-AI deleted the vk/d6a9-github-actions-w branch March 13, 2026 07:02
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

0