Skip to content

ci: update ci#18570

Merged
Single-Dancer merged 1 commit intomainfrom
fix/ci-stuck
Nov 5, 2025
Merged

ci: update ci#18570
Single-Dancer merged 1 commit intomainfrom
fix/ci-stuck

Conversation

@Single-Dancer
Copy link
Copy Markdown
Collaborator

@Single-Dancer Single-Dancer commented Nov 4, 2025

这个 PR 做了什么? (简要描述所做更改)

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

  • 错误修复 (Bugfix) issue: fix #
  • 新功能 (Feature)
  • 代码重构 (Refactor)
  • TypeScript 类型定义修改 (Types)
  • 文档修改 (Docs)
  • 代码风格更新 (Code style update)
  • 构建优化 (Chore)
  • 其他,请描述 (Other, please describe):

这个 PR 涉及以下平台:

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

Summary by CodeRabbit

发布说明

  • Chores
    • 优化了构建流程,在不同平台上使用不同的构建策略以提升稳定性

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 4, 2025

概览

在 GitHub 工作流中添加了条件化的构建步骤,根据操作系统选择不同的 npm 脚本,并在 package.json 中引入了一个新的串行构建脚本以支持单并发工作区构建。

变更

内聚组 / 文件 变更摘要
GitHub 工作流优化
.github/workflows/nodejs.yml
构建步骤现在根据运行器类型执行条件命令:Windows 上使用 pnpm build:serial,其他系统使用 pnpm build。添加了 NODE_OPTIONS=--max_old_space_size=4096 环境变量以增加内存限制。
构建脚本扩展
package.json
scripts 部分新增 build:serial 脚本,使用 --workspace-concurrency=1 参数以串行方式执行工作区构建。

序列图

sequenceDiagram
    participant CI as GitHub Actions
    participant Workflow as nodejs.yml
    participant Build as Build Script
    
    CI->>Workflow: 触发工作流
    Workflow->>Workflow: 检测操作系统
    
    alt Windows
        Workflow->>Build: 执行 pnpm build:serial<br/>(--workspace-concurrency=1)
    else 其他系统
        Workflow->>Build: 执行 pnpm build<br/>(默认并发)
    end
    
    Note over Build: NODE_OPTIONS=<br/>--max_old_space_size=4096
    Build->>Build: 构建工作区
Loading

代码审查工作量评估

🎯 1 (简单) | ⏱️ ~5 分钟

  • 变更主要是配置级别的调整,无复杂业务逻辑变化
  • 两个文件的修改都很直观且相关联
  • 需要验证:在 Windows 环境下 build:serial 脚本是否能正确执行,内存配置是否合理

建议的审查者

  • yoyo837
  • tutuxxx

诗歌

🐰 构建流程分岔路,
Windows 串行稳稳走,
内存充足莫烦忧,
并发与串行各有度,
工作流更添光彩!✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive 标题过于笼统,使用"update ci"这样的模糊措辞,没有清晰地传达主要变更。 建议将标题改为更具体的描述,如"ci: add serial build script for windows"或"ci: add NODE_OPTIONS and platform-specific build commands"。
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ci-stuck

📜 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 84cdc51 and f3c2c8b.

📒 Files selected for processing (2)
  • .github/workflows/nodejs.yml (1 hunks)
  • package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • package.json
  • .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). (11)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc

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.

@coderabbitai coderabbitai Bot requested review from tutuxxx and yoyo837 November 4, 2025 09:38
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.97%. Comparing base (914dbd4) to head (f3c2c8b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main   #18570    +/-   ##
========================================
  Coverage   55.97%   55.97%            
========================================
  Files         416      416            
  Lines       21563    21563            
  Branches     5299     5287    -12     
========================================
  Hits        12070    12070            
+ Misses       8013     7878   -135     
- Partials     1480     1615   +135     
Flag Coverage Δ
taro-cli 72.85% <ø> (ø)
taro-runtime 59.87% <ø> (ø)
taro-web 53.12% <ø> (ø)

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

Copy link
Copy Markdown

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e5f7ce and 84cdc51.

📒 Files selected for processing (4)
  • .github/workflows/nodejs.yml (1 hunks)
  • package.json (1 hunks)
  • packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json (1 hunks)
  • packages/taro-rn/src/lib/index.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/nodejs.yml
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
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.
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 中依赖提升的标准做法。
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 文件。
Learnt from: ianzone
Repo: NervJS/taro PR: 17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
📚 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/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json
📚 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:

  • package.json
⏰ 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). (7)
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
🔇 Additional comments (2)
package.json (1)

24-24: LGTM!

新增的 build:serial 脚本通过 --workspace-concurrency=1 强制串行构建,这对于解决 CI 环境中的资源限制问题(如内存不足)是合理的做法。脚本定义正确,与 PR 目标一致。

packages/taro-rn/src/lib/index.ts (1)

2-2: 该审查意见不正确

ENV_TYPE 导出位于第 2 行是 getLibList.js 脚本正确生成的结果,而非手动修改。

验证结果显示:

  • ENV_TYPEpackages/taro-rn/src/lib/ 目录中的第一个子目录
  • getLibList.js 通过 readdirSync() 读取目录并按文件系统顺序生成导出语句
  • 当前 index.ts 中的导出顺序(ENV_TYPE → arrayBufferToBase64 → authorize...)完全符合 readdirSync() 返回的顺序,不按字母表排序
  • 此顺序与脚本生成逻辑一致,无需修改脚本或重新生成文件

Likely an incorrect or invalid review comment.

"type": "Type"
},
"image": {
"lang": "string",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

确认此更改是否由构建脚本生成

根据项目记录,此文件由 packages/taro-platform-h5/scripts/post-build.mjs 自动生成,不应手动编辑。请确认:

  1. 如果是手动添加 lang 字段,应当在源文件 taro-platform-h5 中的定义更新,然后重新运行构建脚本
  2. 如果已在源文件中更新并运行了构建脚本,则此更改是正确的

基于学习记录

运行以下脚本验证源文件是否已更新:


🏁 Script executed:

#!/bin/bash
# 检查 taro-platform-h5 中 image 组件的 lang 字段定义

# 查找 image 组件定义中的 lang 字段
rg -n -A3 -B3 '"lang"' packages/taro-platform-h5/

Length of output: 0


需要进一步验证。由于在源目录中未找到 lang 字段,我需要检查构建脚本和源文件的实际结构。


🏁 Script executed:

#!/bin/bash
# 1. 查找 post-build.mjs 脚本位置和内容
echo "=== 查找 post-build.mjs ==="
find packages/taro-platform-h5/ -name "post-build.mjs" -o -name "post-build.js"

# 2. 查看 taro-platform-h5 目录结构
echo -e "\n=== taro-platform-h5 目录结构 ==="
ls -la packages/taro-platform-h5/ 2>/dev/null | head -20

# 3. 查找 image 组件相关定义文件
echo -e "\n=== 查找 image 相关定义文件 ==="
fd -t f "image" packages/taro-platform-h5/ | grep -E "\.(ts|js|json)$" | head -20

# 4. 查找 definition 相关文件
echo -e "\n=== 查找 definition 文件 ==="
fd "definition" packages/taro-platform-h5/

Length of output: 1009



🏁 Script executed:

#!/bin/bash
# 1. 检查源文件 definition.json 中是否存在 lang 字段
echo "=== 源文件 definition.json 中的 lang 字段 ==="
rg -n '"lang"' packages/taro-platform-h5/definition/definition.json

# 2. 查看 image 组件在源文件中的定义
echo -e "\n=== 源文件中 image 组件的 lang 字段 ==="
rg -n -A5 -B5 '"image"' packages/taro-platform-h5/definition/definition.json | head -40

# 3. 查看 post-build.mjs 脚本内容
echo -e "\n=== post-build.mjs 脚本内容 ==="
cat packages/taro-platform-h5/scripts/post-build.mjs

# 4. 检查生成的文件 h5-definition.json 中 lang 字段周围的内容
echo -e "\n=== 生成的文件中 lang 字段附近的内容 ==="
rg -n -B5 -A5 '"lang": "string"' packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json | head -30

Length of output: 1404



🏁 Script executed:

#!/bin/bash
# 检查构建后的 dist/definition.json 中 image 组件的定义
echo "=== dist/definition.json 中 image 组件的定义 ==="
if [ -f "packages/taro-platform-h5/dist/definition.json" ]; then
  rg -n -B5 -A5 '"image"' packages/taro-platform-h5/dist/definition.json | head -30
else
  echo "dist/definition.json 不存在,需要构建"
fi

# 检查 git diff 以确认哪些文件被修改
echo -e "\n=== git diff 中关于 h5-definition.json 的变化 ==="
git diff HEAD packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json | grep -A3 -B3 '"lang"' | head -20

Length of output: 117


应在源文件中添加 lang 字段定义,而不是直接修改 mock 文件

当前问题:

  • lang 字段已手动添加到 packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json(第2192行)
  • 但源文件 packages/taro-platform-h5/definition/definition.json 中的 image 组件并不包含此字段(仅有 lazyLoad, mode, nativeProps, src)
  • 根据项目规则,mock 文件由 post-build.mjs 脚本自动生成,不应手动编辑
  • 下次运行构建脚本后,此手动添加的字段将丢失

修复步骤:

  1. packages/taro-platform-h5/definition/definition.json 的 image 组件中添加 "lang": "string" 定义
  2. 运行项目的构建脚本重新生成 mock 文件
🤖 Prompt for AI Agents
In packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json
around line 2192: the `lang` field was manually added to the mock but must be
added in the source definition; open
packages/taro-platform-h5/definition/definition.json, locate the image component
entry and add "lang": "string" to that component's property definitions, then
run the project's build/post-build script to regenerate the mocks so the change
persists (do not manually edit the mock file).

@Single-Dancer Single-Dancer added this to the 4.1.8 milestone Nov 4, 2025
@ianzone
Copy link
Copy Markdown
Contributor

ianzone commented Nov 4, 2025

更新CI能不能把node版本也更新一下 #17905

@Single-Dancer Single-Dancer merged commit 9e7250a into main Nov 5, 2025
39 checks passed
@Single-Dancer Single-Dancer deleted the fix/ci-stuck branch November 5, 2025 02:48
@Single-Dancer
Copy link
Copy Markdown
Collaborator Author

更新CI能不能把node版本也更新一下 #17905

这个感觉得跟node最低版本这个一起变更,后面再搞吧

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.

3 participants