Skip to content

Conversation

@oasis-cloud
Copy link
Collaborator

@oasis-cloud oasis-cloud commented Feb 17, 2025

Summary by CodeRabbit

  • Chores

    • 优化了 Beta 发布流程,通过拉取请求触发并调整相关配置,提高发布效率。
    • 更新包版本至 3.0.0-beta.14。
  • New Features

    • 新增专用命令支持 Beta 和最新版本的发布,简化了发布步骤。
  • Refactor

    • 移除了过时的样式配置选项,以保持配置一致性。

@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2025

Warning

Rate limit exceeded

@oasis-cloud has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 16 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 82cab23 and f0e928f.

📒 Files selected for processing (2)
  • .github/workflows/release-beta.yml (3 hunks)
  • .github/workflows/release.yml (2 hunks)

Walkthrough

此次 PR 修改了发布流程和构建脚本。GitHub 工作流触发条件由 push 改为 pull_request,并移除了一些环境变量和提交信息校验步骤,同时调整了发布命令。package.json 中版本号由 beta.13 升级至 beta.14。此外,发布相关的脚本文件新增了用于 npm 发布 beta 和 latest 版本的命令,而类型定义文件中则移除了不再需要的 CSS 变量。

Changes

文件 更改说明
.github/workflows/release-beta.yml - 触发条件由 push 改为 pull_request(针对 feat_v3.x 分支)
- 移除部分环境变量(如 NODE_AUTH_TOKENNPM_CONFIG_PROVENANCERELEASE_TAG
- 注释提交信息校验与构建、发布步骤,修改发布命令为 pnpm
package.json - 版本号由 3.0.0-beta.13 升级到 3.0.0-beta.14
scripts/build-taro.mjs, scripts/build.mjs - 在 generateReleasePackageJson 函数中新增 "publish:beta""publish:latest" 脚本,用于以不同标签及访问权限发布 npm 包
src/packages/configprovider/types.ts - 在 NutCSSVariables 联合类型中移除 'nutuiPickerListHeight'

Sequence Diagram(s)

sequenceDiagram
    participant Dev as 开发者
    participant GH as GitHub Actions
    participant WF as 发布工作流
    Dev->>GH: 提交针对 feat_v3.x 的 Pull Request
    GH->>WF: 触发 release-beta 工作流
    WF->>WF: 跳过提交信息校验、依赖安装与部分构建步骤
    WF->>WF: 执行更新后的发布脚本(pnpm 发布)
    WF-->>GH: 返回发布状态更新
Loading

Possibly related PRs

Suggested reviewers

  • xiaoyatong
  • Alex-huxiyang

Poem

我是一只快乐的小兔子,
跳跃中带来代码的新意;
版本更新风驰电掣,
工作流轻快又明晰。
让我们一起审查这次改动,
欢迎良伴共赏代码花开!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added 3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) labels Feb 17, 2025
@pull-request-size pull-request-size bot added size/M and removed size/L labels Feb 17, 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: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3539ffc and 1989f86.

📒 Files selected for processing (5)
  • .github/workflows/release-beta.yml (1 hunks)
  • package.json (1 hunks)
  • scripts/build-taro.mjs (1 hunks)
  • scripts/build.mjs (1 hunks)
  • src/packages/configprovider/types.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • src/packages/configprovider/types.ts
✅ Files skipped from review due to trivial changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test
🔇 Additional comments (3)
scripts/build.mjs (1)

363-366: 新增的发布脚本配置正确!

新增的 publish:betapublish:latest 脚本遵循了 npm 最佳实践:

  • 使用 --tag 正确区分 beta 和 latest 版本
  • 设置了 --access public 确保包可以被公开访问
  • 添加了 --no-git-checks 以简化发布流程
scripts/build-taro.mjs (1)

424-427: 保持了与 H5 构建脚本的一致性!

Taro 版本的发布脚本配置与 H5 版本保持一致,这是一个很好的实践:

  • 统一的发布命令格式
  • 相同的访问权限设置
  • 一致的标签管理策略
.github/workflows/release-beta.yml (1)

3-7: 工作流触发条件的变更需要仔细评估

将触发条件从 push 改为 pull_request 可能会影响发布流程:

  • PR 可能包含未完全审查的代码
  • 需要确保只有经过充分测试的代码才能触发发布

建议:

  1. 添加必要的 PR 检查条件
  2. 考虑添加必要的审查要求

Comment on lines 23 to 40
# - name: Get commit message
# run: |
# COMMIT_MESSAGE=$(git log --format=%s -n 1)
# FILTERED_MESSAGE="${COMMIT_MESSAGE//[^a-zA-Z0-9.()_:, -]/}"
# echo "COMMIT_MESSAGE=${FILTERED_MESSAGE}" >> $GITHUB_ENV
# - name: Show commit message
# run: echo "$COMMIT_MESSAGE"
#
# - name: Commit message compliance verification
# if: |
# !startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) ||
# !contains( env.COMMIT_MESSAGE , '-beta' )
# run: echo "ABORT=true" >> $GITHUB_ENV
#
# - name: Get Tag message
# if: contains( env.COMMIT_MESSAGE , '-beta')
# run: echo "RELEASE_TAG=beta" >> $GITHUB_ENV
#
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

移除提交消息验证可能带来风险

注释掉的提交消息验证逻辑会影响版本控制的质量:

  • 无法确保版本号格式的正确性
  • 失去了对 beta 版本标记的验证

建议:

  1. 保留提交消息验证
  2. 如果要简化流程,至少保留基本的版本号格式检查

Comment on lines 50 to 64
# - name: Install dependencies
# if: env.ABORT != 'true'
# run: pnpm install --frozen-lockfile
#
# - name: Run Build
# if: env.ABORT != 'true'
# run: |
# if ! pnpm build; then
# echo "构建 nutui-react 失败"
# exit 1
# fi
# if ! pnpm build:taro; then
# echo "构建 nutui-react-taro 失败"
# exit 1
# fi
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

构建步骤被注释可能导致发布未构建的包

注释掉构建步骤存在严重风险:

  • 可能发布未经构建的包
  • 跳过了构建失败检查

建议:

  1. 恢复构建步骤
  2. 保留构建失败的错误处理

Comment on lines 66 to 70
- name: Run Release @nutui/nutui-react
if: env.ABORT != 'true'
run: |
cd ./release/h5 || exit 1
if ! npm publish --tag ${{ env.RELEASE_TAG }}; then
echo "发布 @nutui/nutui-react 失败"
exit 1
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: pnpm --dir ./release/h5 publish:beta
run: echo "${{ secrets.NPM_TOKEN }}"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

避免在日志中暴露敏感令牌

使用 echo 输出 NPM_TOKEN 可能会在日志中暴露敏感信息。

建议修改为:

-        run: echo "${{ secrets.NPM_TOKEN }}"
+        run: pnpm --dir ./release/h5 publish:beta
📝 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
- name: Run Release @nutui/nutui-react
if: env.ABORT != 'true'
run: |
cd ./release/h5 || exit 1
if ! npm publish --tag ${{ env.RELEASE_TAG }}; then
echo "发布 @nutui/nutui-react 失败"
exit 1
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: pnpm --dir ./release/h5 publish:beta
run: echo "${{ secrets.NPM_TOKEN }}"
- name: Run Release @nutui/nutui-react
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: pnpm --dir ./release/h5 publish:beta
run: pnpm --dir ./release/h5 publish:beta

@codecov
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.79%. Comparing base (3539ffc) to head (f0e928f).
Report is 1 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #2994   +/-   ##
==========================================
  Coverage      85.79%   85.79%           
==========================================
  Files            281      281           
  Lines          18527    18527           
  Branches        2810     2810           
==========================================
  Hits           15896    15896           
  Misses          2626     2626           
  Partials           5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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: 0

🧹 Nitpick comments (1)
.github/workflows/release-beta.yml (1)

40-40: 清理多余注释

此处的单独 # 注释行似乎没有实际用途,建议移除以保持 YAML 文件的整洁。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1989f86 and 82cab23.

📒 Files selected for processing (1)
  • .github/workflows/release-beta.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test
🔇 Additional comments (6)
.github/workflows/release-beta.yml (6)

4-5: 触发器事件更新说明

将原先的 push 触发修改为 pull_request 触发,确保工作流在 PR 阶段启动发布流程。请确认这一调整与预期的发布策略保持一致。


13-15: 新增权限配置

在 job 级别中新增了 permissions 配置,授予了 contentsid-token 的写权限。建议核查这些权限是否符合最小授权原则,确保既满足需求又不会授权过度。


21-21: 确保检出最新提交

通过设置 ref: ${{ github.event.pull_request.head.sha }},保证 checkout 步骤能拉取 PR 中最新的提交。此配置有助于确保发布时的代码状态正确。


46-46: 注册表地址配置确认

新增的 registry-url: 'https://registry.npmjs.org' 明确指定了使用官方 npm 源,有助于确保依赖安装和发布过程的稳定性。


67-70: 发布命令更新:使用 pnpm

将用于发布 @nutui/nutui-react 的命令更新为 pnpm --dir ./release/h5 publish:beta,并通过环境变量传递 NODE_AUTH_TOKEN。请确认发布目录和命令参数符合实际需求。


72-76: 发布命令更新:针对 taro 版本

更新了 @nutui/nutui-react-taro 的发布命令,使用 pnpm 并指定了对应的发布目录 (./release/taro) 以及环境变量配置。请验证该配置是否正确。

@oasis-cloud oasis-cloud merged commit 35dba5e into feat_v3.x Feb 17, 2025
8 checks passed
@oasis-cloud oasis-cloud deleted the chore_publish_beta branch February 17, 2025 02:32
oasis-cloud added a commit to oasis-cloud/nutui-react that referenced this pull request Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants