Skip to content

Conversation

@weareoutman
Copy link
Member

@weareoutman weareoutman commented Nov 28, 2025

依赖检查

组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。

请勾选以下两组选项其中之一:

  • 本次 MR 没有使用上游组件(例如框架、后台组件等)的较新版本提供的特性。

或者:

  • 本次 MR 使用了上游组件(例如框架、后台组件等)的较新版本提供的特性。
  • 在对应的文件中更新了该上游组件的依赖版本(或确认了当前声明的依赖版本已包含本次 MR 使用的新特性)。

提交信息检查

Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。

破坏性变更是针对于下游使用者而言,可以通过本次改动对下游使用者的影响来识别变更类型:

  • 下游使用者不做任何改动,仍可以正常工作时,那么它属于普通变更。
  • 反之,下游使用者不做改动就无法正常工作时,那么它属于破坏性变更。

例如,构件修改了一个属性名,小产品 Storyboard 中需要使用新属性名才能工作,那么它就是破坏性变更。
又例如,构件还没有任何下游使用者,那么它的任何变更都是普通变更。

破坏性变更:

  • ⚠️ 本次 MR 包含破坏性变更的提交,请继续确认以下所有选项:
  • 没有更好的兼容方案,必须做破坏性变更。
  • 使用了 feat 作为提交类型。
  • 标注了 BREAKING CHANGE: 你的变更说明
  • 同时更新了本仓库中所有下游使用者的调用。
  • 同时更新了本仓库中所有下游使用者对该子包的依赖为即将发布的 major 版本。
  • 同时为其它仓库的 Migrating 做好了准备,例如文档或批量改动的方法。
  • 手动验证过破坏性变更在 Migrate 后可以正常工作。
  • 破坏性变更所在的提交没有意外携带其它子包的改动。

新特性:

  • 本次 MR 包含新特性的提交,且该提交不带有破坏性变更,并使用了 feat 作为提交类型。
  • 给新特性添加了单元测试。
  • 手动验证过新特性可以正常工作。

问题修复:

  • 本次 MR 包含问题修复的提交,且该提交不带有新特性或破坏性变更,并使用了 fix 作为提交类型。
  • 给问题修复添加了单元测试。
  • 手动验证过问题修复得到解决。

杂项工作:

即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:

  • 本次 MR 包含杂项工作的提交,且该提交不带有问题修复、新特性或破坏性变更,并使用了 chore, docs, test 等作为提交类型。

Summary by CodeRabbit

发布说明

  • Bug 修复
    • 改进了流程 API 的错误处理机制,确保身份验证失败错误能够被正确传递并由上层逻辑妥善处理,而非作为通用错误进行日志记录。

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

Walkthrough

在远程获取流程API定义时,对未认证错误添加了特殊处理。当批量合约获取抛出错误时,现在会检测是否为未认证错误,若是则重新抛出;之前未认证错误被作为通用故障处理和记录。

Changes

Cohort / File(s) Change Summary
错误处理改进
packages/easyops-runtime/src/flowApi/FlowApi.ts
添加了 isUnauthenticatedError 导入,在 fetchFlowApiDefinitionFromRemote 的批量合约获取错误处理中,添加了条件判断以特殊处理未认证错误,使其重新抛出而非作为一般故障处理

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 分钟

  • 仅涉及一个文件的修改
  • 核心改动为在异常处理块中添加单个条件判断
  • 需确认 isUnauthenticatedError 的导入源和使用是否正确
  • 需验证错误重新抛出的行为是否与上层业务逻辑期望相符

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning PR描述仅包含清单模板,所有检查项均未勾选,缺少对本次改动的具体说明和验证。 请填写PR描述中的简单描述部分说明具体工作内容,并根据改动类型勾选对应的检查项(本次为问题修复类型)。
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed PR标题清晰准确地概括了主要改动:修复在合约获取失败时抛出未认证错误。
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch steve/v3-flow-api-not-found

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.14%. Comparing base (22be1cb) to head (ac50ce3).
⚠️ Report is 2 commits behind head on v3.

Files with missing lines Patch % Lines
packages/easyops-runtime/src/flowApi/FlowApi.ts 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##               v3    #4830      +/-   ##
==========================================
- Coverage   95.16%   95.14%   -0.03%     
==========================================
  Files         212      212              
  Lines        9357     9359       +2     
  Branches     1802     1803       +1     
==========================================
  Hits         8905     8905              
- Misses        332      334       +2     
  Partials      120      120              
Files with missing lines Coverage Δ
packages/easyops-runtime/src/flowApi/FlowApi.ts 95.69% <0.00%> (-2.11%) ⬇️
🚀 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.

@cypress
Copy link

cypress bot commented Nov 28, 2025

next-core    Run #11836

Run Properties:  status check passed Passed #11836  •  git commit bb49599172 ℹ️: Merge ac50ce3bf4d469282c5bb7897e6cb5729645a167 into 22be1cb42e9c501728041dde6713...
Project next-core
Branch Review steve/v3-flow-api-not-found
Run status status check passed Passed #11836
Run duration 00m 24s
Commit git commit bb49599172 ℹ️: Merge ac50ce3bf4d469282c5bb7897e6cb5729645a167 into 22be1cb42e9c501728041dde6713...
Committer Shenwei Wang
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 17
View all changes introduced in this branch ↗︎

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)
packages/easyops-runtime/src/flowApi/FlowApi.ts (1)

284-287: 未认证错误改为上抛的行为符合预期,但要注意调用方和缓存语义

这里在批量合约查询失败时,若 isUnauthenticatedError(e) 为真就直接 throw e,其余错误则仍然记录在本地 error 变量并最终打印日志、返回 null。这基本符合 PR 的目标:让未认证错误走统一的上层处理链路(如登录拦截),而不是被当成 “Flow API 不存在/查询失败”。

几点小建议和注意点:

  1. 调用方行为变化

    • 之前:未认证错误会被吞掉,调用 fetchFlowApiDefinitionFromRemote 的地方只会拿到 null(通过 fetchFlowApiDefinition 再转成 FlowApiNotFoundError 等逻辑)。
    • 现在:未认证会直接 reject Promise。请确认上层调用链(例如 getArgsOfFlowApi 的使用者)都有统一的全局错误处理,不会因为新增的 reject 导致未捕获异常或 UI 行为变化超出预期。
  2. 与缓存 remoteContractCache 的交互

    • 当前逻辑里,fetchFlowApiDefinitionFromRemote(...) 返回的 Promise 会被直接缓存到 remoteContractCache 中。
    • 之前:未认证场景最终 resolve 为 null,相当于缓存了一个 “负结果”;
    • 现在:未认证场景会缓存一个 rejected Promise。在同一运行时中如果之后用户完成登录,但没有重启/重置 runtime,这个 provider 的后续请求依然会直接沿用已 rejected 的 Promise。
    • 这个行为与之前缓存 null 的“不会重试”语义是一致的,但如果未来希望在同一运行时里支持“登录后自动重试获取契约”,可以考虑在上层登录/登出流里清空 remoteContractCache,或者只在成功获取合约后再写入缓存。

整体来看改动没有明显正确性问题,语义也与 PR 描述一致,上述只是后续演进可以关注的点。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 22be1cb and ac50ce3.

📒 Files selected for processing (1)
  • packages/easyops-runtime/src/flowApi/FlowApi.ts (2 hunks)
⏰ 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). (2)
  • GitHub Check: build (20.x)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
packages/easyops-runtime/src/flowApi/FlowApi.ts (1)

14-14: 引入 isUnauthenticatedError 与下方用法一致

@next-core/runtime 引入 isUnauthenticatedError,与后续在 catch 分支中的使用保持一致,没有多余引用,整体合理。

建议确认下该 helper 在当前版本下对 ContractCenterApi_batchSearchContract 抛出的未认证场景(例如 401、登录态过期等)都能正确识别,避免误判导致真正的未认证错误被当作普通失败走到日志/null 的分支。

@weareoutman weareoutman merged commit 8a0ea43 into v3 Nov 28, 2025
7 of 9 checks passed
@weareoutman weareoutman deleted the steve/v3-flow-api-not-found branch November 28, 2025 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants