Skip to content

Conversation

@ianzone
Copy link
Contributor

@ianzone ianzone commented Nov 6, 2025

这个 PR 做了什么? (简要描述所做更改)
更新 node 版本为 node22, node24
更新 macOS 至 latest arm 架构,actions/runner-images#13046

这个 PR 是什么类型? (至少选择一个)

这个 PR 涉及以下平台:

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 钉钉小程序
  • QQ 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

Summary by CodeRabbit

  • Chores

    • 扩展 CI 矩阵,新增对 Node.js 22 与 24 的支持并将主机改为 -latest 以提升平台覆盖。
    • macOS 构建目标切换为 aarch64;Ubuntu 同时包含 glibc 与 musl 目标以扩展兼容性。
    • 调整排除/包含规则以匹配新矩阵并移除对旧主机的特殊排除。
    • 统一安装步骤为 pnpm install --frozen-lockfile。
  • Tests

    • 增加全局测试超时设置,延长测试执行时限。

@coderabbitai
Copy link

coderabbitai bot commented Nov 6, 2025

Walkthrough

更新了两个 GitHub Actions 工作流的矩阵与宿主/目标映射:将 Node.js 版本矩阵由 18/20 升级为 22/24,统一或替换为 *-latest runner,调整 macOS 为 aarch64 目标,扩展 Ubuntu 目标集合,并简化 pnpm 安装命令与相应排除规则。

Changes

Cohort / File(s) 变更摘要
Node.js CI 工作流
\.github/workflows/nodejs.yml
node-version 矩阵从 [18.x, 20.x] 更新为 [22, 24];将 host 矩阵改为 macos-latest, windows-latest, ubuntu-latest;调整包含/排除规则(移除 macos-13 相关排除,新增对 macos-latest 与 windows 的 22 排除);macOS 目标改为 aarch64-apple-darwin;Ubuntu 目标包含 x86_64-unknown-linux-gnux86_64-unknown-linux-musl;将安装命令 pnpm -r install --frozen-lockfile 改为 pnpm install --frozen-lockfile
Rust 绑定 构建工作流
\.github/workflows/build-rust-binding.yml
node-version18.x 升级到 22;将 macOS runner 从 macos-13 (x86_64) 改为 macos-latest (aarch64) 并移除原先对 macos-13 的 strip 步骤;将 ubuntu-22.04 替换为 ubuntu-latest,保留 x86_64-unknown-linux-gnux86_64-unknown-linux-musl 目标;各主机的构建命令有小幅调整,但总体流程保持一致。
配置与项目脚本
packages/taro-components/scripts/stencil/stencil.config.ts
在测试全局配置中新增 testTimeout: 60000,并做了轻微注释/空白调整,无其他功能变更。

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Matrix as CI Matrix
  participant Runner as Runner (macos-latest / windows-latest / ubuntu-latest)
  participant Setup as Setup Node.js
  participant Install as pnpm install
  participant Build as Build/Test/Package

  Note over Matrix: 生成 matrix: node-version [22,24] & hosts [macos-latest, windows-latest, ubuntu-latest]
  Matrix->>Runner: 派发作业(按 host 与 node-version)
  Runner->>Setup: 安装指定 Node.js 版本
  Setup->>Install: 运行 `pnpm install --frozen-lockfile`
  Install->>Build: 执行构建/测试/打包步骤(按目标三元组)
  alt macos-latest (Apple Silicon)
    Note right of Runner: 使用 target aarch64-apple-darwin
  else ubuntu-latest
    Note right of Runner: 使用 targets x86_64-unknown-linux-gnu & x86_64-unknown-linux-musl
  end
  Build->>Matrix: 上传工件 / 报告结果
Loading

Estimated code review effort

🎯 3 (中等) | ⏱️ ~20 分钟

  • 需特别检查矩阵包含/排除规则与 host→target 映射(macOS aarch64、Ubuntu 多目标)的正确性。
  • 验证移除 macOS strip 步骤对产物符号处理的影响。
  • 确认将 pnpm -r install 改为 pnpm install 在并行/工作区场景下行为是否与预期一致。

Possibly related PRs

Suggested reviewers

  • luckyadam
  • yoyo837
  • tutuxxx

诗歌

🐰✨ 新矩阵轻轻跳,
节点换装二二俩,
苹果小芯快又巧,
Linux 双路齐登场,
CI 花园又一嚣。

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning PR标题"chore: node24"不够全面,未能准确反映多个工作流文件的更新内容。 建议更新PR标题为"chore: upgrade Node.js versions and update CI workflows"或类似更准确的描述。
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 600e302 and 5ee1482.

📒 Files selected for processing (1)
  • packages/taro-components/scripts/stencil/stencil.config.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-05-25T18:02:31.387Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。

Applied to files:

  • packages/taro-components/scripts/stencil/stencil.config.ts
📚 Learning: 2025-09-05T18:40:45.775Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/taro-platform-harmony-hybrid/package.json:43-45
Timestamp: 2025-09-05T18:40:45.775Z
Learning: 在 tarojs/plugin-platform-harmony-hybrid 包中,tarojs/components-library-react、tarojs/components-library-solid 和 tarojs/components-library-vue3 必须作为直接依赖(dependencies)而不能作为 peer 依赖,因为插件源码中有对这些包的直接引用,包括 componentAdapter* getter 方法和 webpack 别名配置。

Applied to files:

  • packages/taro-components/scripts/stencil/stencil.config.ts
📚 Learning: 2025-08-08T02:32:58.265Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.265Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。

Applied to files:

  • packages/taro-components/scripts/stencil/stencil.config.ts
📚 Learning: 2025-08-25T22:16:50.118Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json:2356-2356
Timestamp: 2025-08-25T22:16:50.118Z
Learning: The file `packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json` is auto-generated by the post-build script `packages/taro-platform-h5/scripts/post-build.mjs`, which copies content from `taro-platform-h5/dist/definition.json`. This file should not be manually edited.

Applied to files:

  • packages/taro-components/scripts/stencil/stencil.config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
🔇 Additional comments (1)
packages/taro-components/scripts/stencil/stencil.config.ts (1)

103-103: 验证测试超时增加的具体理由和必要性。

测试超时从默认的 5 秒增加到 60 秒(12 倍增长)是显著变化,但缺乏明确的说明:

  • 代码注释中未解释此超时值的由来
  • 未发现特定的慢速测试需要此增长
  • 无证据表明新的 Node.js 22/24 环境导致测试性能显著下降

建议提供以下信息确认此改动的合理性:

  1. 新 CI 环境中实际测试执行时间(是否接近 60 秒)
  2. 是否有具体的测试用例在新环境中超时失败
  3. 优化这些慢速测试是否可行,而非全局增加超时

如果此改动基于 CI 稳定性需求,请在代码注释中说明。


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/nodejs.yml (1)

149-261: 建议重构:大量代码重复需要整合

nodejs-testing-new job与原有的 nodejs-testing job几乎完全相同(约110行重复代码),仅在矩阵配置和第191行的安装命令有差异。这违反了DRY原则,增加了维护成本。

根据PR描述,旧的 nodejs-testing 最终会被移除,建议考虑以下方案:

  1. 短期:直接合并两个矩阵到一个job中(更新 node-versionhost,调整exclude/include规则)
  2. 使用GitHub Actions的reusable workflows来消除重复

这样可以避免未来维护两份相同代码的问题。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a018f9d and 58ce338.

📒 Files selected for processing (1)
  • .github/workflows/nodejs.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/nodejs.yml (1)

156-165: 澄清矩阵排除规则的设计意图

新job的矩阵配置中,Node 22被排除在所有非ubuntu平台上(macos-13、macos-latest、windows-latest),这意味着:

  • Node 22:仅在ubuntu-latest上测试
  • Node 24:在所有平台上测试

请确认这是否为故意设计(例如Node 22在其他平台上还不稳定),还是需要扩展Node 22的测试覆盖范围。

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.32%. Comparing base (a018f9d) to head (600e302).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18578      +/-   ##
==========================================
+ Coverage   55.97%   56.32%   +0.35%     
==========================================
  Files         416      447      +31     
  Lines       21563    23342    +1779     
  Branches     5283     5756     +473     
==========================================
+ Hits        12070    13148    +1078     
- Misses       8013     8372     +359     
- Partials     1480     1822     +342     
Flag Coverage Δ
taro-cli 72.69% <ø> (-0.17%) ⬇️
taro-runtime 60.33% <ø> (+0.46%) ⬆️
taro-web 53.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 97 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.

This was referenced Nov 8, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/build-rust-binding.yml (1)

22-22: 使用 -latest 运行器版本的风险提示。

主机矩阵从特定版本(ubuntu-22.04macos-13)更改为 -latest 版本。这可能会导致 CI/CD 行为的不可预测性,因为运行器 OS 可能会在没有通知的情况下更改。

鉴于此更改与 PR 目标中提到的"更新分支保护规则后移除旧的 nodejs-testing 配置"相关,这似乎是有意为之的基础设施现代化计划的一部分。建议确保有适当的监控和回滚计划,以便在发现不兼容性时处理。

Also applies to: 30-30, 34-34

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58ce338 and 600e302.

📒 Files selected for processing (2)
  • .github/workflows/build-rust-binding.yml (1 hunks)
  • .github/workflows/nodejs.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/nodejs.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
🔇 Additional comments (2)
.github/workflows/build-rust-binding.yml (2)

34-38: macOS ARM 架构支持很好。

将 macOS 目标从 x86_64 更改为 aarch64-apple-darwin 是正确的,符合 PR 目标中提到的"macOS ARM 架构"支持。构建命令(第 37-38 行)正确指定了目标并使用了适当的 strip 命令。


71-71: 安装命令改进良好。

使用 --filter @tarojs/binding... --frozen-lockfile 提高了 CI 构建的可预测性和可重现性。这符合 CI/CD 最佳实践。

fail-fast: false
matrix:
node-version: [18.x]
node-version: [22]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

PR 目标与代码不匹配:缺少 Node.js 24 版本。

PR 标题为"chore: node24",PR 目标明确提到"为 Node.js 22、Node.js 24 和 macOS ARM 架构添加测试",但矩阵中仅包含 [22],缺少 Node.js 24。根据最新信息,Node.js 24 已于 2025 年 10 月 31 日正式进入长期支持(LTS)并将继续接收维护和安全更新至 2028 年 4 月。

请确认是否应在矩阵中添加 Node.js 24。如果是有意为之,请更新 PR 描述以反映实际的测试范围。

建议的修复:

-        node-version: [22]
+        node-version: [22, 24]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
node-version: [22]
node-version: [22, 24]
🤖 Prompt for AI Agents
.github/workflows/build-rust-binding.yml around line 17: the GitHub Actions
node-version matrix currently lists only [22] while the PR title/description
claims tests for Node.js 22 and 24; update the matrix to include Node.js 24
(e.g., node-version: [22, 24]) so CI runs for both versions, or if 24 is
intentionally omitted, adjust the PR title/description to accurately reflect the
actual tested versions.

This was referenced Nov 15, 2025
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