Skip to content

Comments

fix: Add 80% incremental coverage gating for WASM Go plugins#3048

Draft
Jing-ze wants to merge 6 commits intoalibaba:mainfrom
Jing-ze:fix-codecov
Draft

fix: Add 80% incremental coverage gating for WASM Go plugins#3048
Jing-ze wants to merge 6 commits intoalibaba:mainfrom
Jing-ze:fix-codecov

Conversation

@Jing-ze
Copy link
Collaborator

@Jing-ze Jing-ze commented Oct 24, 2025

Ⅰ. Describe what this PR did

This PR implements codecov patch-based incremental coverage gating for WASM Go plugins, requiring 80% coverage for new/modified code before PR merge.

  • Added wasm-plugin-patch status check in codecov.yml with 80% coverage threshold
  • Unified WASM plugin flags to wasm-go-plugin for consistent coverage tracking
  • Fixed codecov report links to use correct app.codecov.io URLs

Ⅱ. Does this pull request fix one issue?

No specific issue, but improves code quality enforcement for WASM plugins.

Ⅲ. Why don't you add test cases (unit test/integration test)?

This PR modifies CI/CD configuration files and doesn't change application logic.

  • Configuration updates in codecov.yml
  • Workflow modifications in .github/workflows/wasm-plugin-unit-test.yml
  • No functional code changes that require additional testing

Ⅳ. Describe how to verify it

  1. Create a test PR with WASM plugin changes
  2. Verify codecov upload succeeds (check GitHub Actions logs)
  3. Check coverage status appears in PR with 80% threshold
  4. Test coverage gating by adding code with <80% coverage
  5. Confirm PR blocking when coverage threshold not met

Ⅴ. Special notes for reviews

  • 80% incremental coverage threshold for all WASM Go plugins
  • Dual gating system: 30% manual check + 80% codecov patch check
  • Flag unification: All WASM plugins now use wasm-go-plugin flag

- Updated Codecov configuration to include a new coverage target for the wasm-go-plugin with a threshold of 80%.
- Modified GitHub Actions workflows to trigger on all branches instead of just 'main'.
- Adjusted coverage report links in the summary to point to the PR coverage report.
- Added logging in the AddForSystem function to improve traceability in the wasm-go plugin.

Change-Id: Iec1a60446d8981aad96698351d8e46526fe6bda2
Co-developed-by: Cursor <noreply@cursor.com>
- Modified the build-and-test workflow to trigger on pushes to the 'main' branch instead of all branches.
- Updated the wasm-plugin unit test workflow to also trigger on pushes to the 'main' branch, while maintaining path filters.

This change streamlines the CI process by focusing on the primary branch.

Change-Id: I7ff335d00ea6a13d0ad3a363cd1a3b551645efd8
Co-developed-by: Cursor <noreply@cursor.com>
- Updated the build-and-test and wasm-plugin unit test workflows to remove quotes around the 'main' branch name in the trigger configuration.
- This change ensures consistency in branch naming conventions across workflows.

Change-Id: I5dcc0d8830f7135904f384c3650839b14b3335f7
Co-developed-by: Cursor <noreply@cursor.com>
- Added 'base: main' to the default and wasm-plugin-patch coverage targets in the Codecov configuration.
- This change ensures consistency in coverage reporting across different targets.

Change-Id: Id1e5312b5f6218207fa7884f31eb3882dc7a91ee
Co-developed-by: Cursor <noreply@cursor.com>
@lingma-agents
Copy link

lingma-agents bot commented Oct 24, 2025

为 WASM Go 插件添加 80% 增量覆盖率门禁与相关配置优化

变更概述
  • 新功能

    • codecov.yml 中新增 wasm-plugin-patch 覆盖率检查项,设定 80% 的增量覆盖率阈值,仅针对 plugins/wasm-go/extensions/** 路径下的代码变更生效。
    • 为 WASM Go 插件在 GitHub Actions 工作流中统一使用 wasm-go-plugin 标志上传覆盖率报告,并启用 fail_ci_if_error 以确保 CI 在上传失败时中断。
  • 配置调整

    • 更新 codecov.yml 配置,为 defaultwasm-plugin-patchproject 覆盖率规则统一设置 base: main,以确保覆盖率对比基于主分支。
    • 在 GitHub Actions 的总结输出中,更新 Codecov PR 报告链接格式为 https://app.codecov.io/gh/{repo}/pull/{number},确保跳转正确。
  • 问题修复

    • 修复 WASM 插件覆盖率上传步骤中缺少 flags 和错误处理配置的问题,增强覆盖率检查的可靠性。
  • 其他

    • plugins/wasm-go/extensions/ai-agent/dashscope/message.go 中添加了调试日志,记录 AddForSystem 方法的输入内容,便于调试追踪(此为辅助性变更,非核心逻辑)。
变更文件
文件路径 变更说明
.​github/​workflows/​wasm-plugin-unit-test.​yml 为 WASM 插件覆盖率上传步骤添加了统一的 flags 标识 `wasm-go-plugin`,并启用 `fail_ci_if_error` 确保上传失败时 CI 中断。同时更新了 Codecov PR 报告链接格式。
codecov.yml 新增 `wasm-plugin-patch` 覆盖率门禁规则,设置 80% 阈值并限定路径与标志。统一各覆盖率规则的 `base: main` 配置。
plugins/​wasm-go/​extensions/​ai-agent/​dashscope/​message.​go 引入 `log` 包并在 `AddForSystem` 方法中添加调试日志输出。

💡 小贴士

与 lingma-agents 交流的方式

📜 直接回复评论
直接回复本条评论,lingma-agents 将自动处理您的请求。例如:

  • 在当前代码中添加详细的注释说明。

  • 请详细介绍一下你说的 LRU 改造方案,并使用伪代码加以说明。

📜 在代码行处标记
在文件的特定位置创建评论并 @lingma-agents。例如:

  • @lingma-agents 分析这个方法的性能瓶颈并提供优化建议。

  • @lingma-agents 对这个方法生成优化代码。

📜 在讨论中提问
在任何讨论中 @lingma-agents 来获取帮助。例如:

  • @lingma-agents 请总结上述讨论并提出解决方案。

  • @lingma-agents 请根据讨论内容生成优化代码。

…reamline settings and avoid redundancy.

Change-Id: I8c74c8a1ba31f032e81e5a23b103be104e63cb66
Co-developed-by: Cursor <noreply@cursor.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 44.61%. Comparing base (810ef8f) to head (3aab38e).

Files with missing lines Patch % Lines
...s/wasm-go/extensions/ai-agent/dashscope/message.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3048      +/-   ##
==========================================
+ Coverage   43.42%   44.61%   +1.18%     
==========================================
  Files          82       85       +3     
  Lines       10922    11404     +482     
==========================================
+ Hits         4743     5088     +345     
- Misses       5850     5961     +111     
- Partials      329      355      +26     
Flag Coverage Δ
wasm-go-plugin 71.16% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...s/wasm-go/extensions/ai-agent/dashscope/message.go 82.35% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants