Repository navigation
Conversation
|
3 of 41 tasks
robocanic
reviewed
Dec 5, 2026
robocanic
left a comment
Contributor
There was a problem hiding this comment.
优点(Strengths)
- 模式校验清晰完备(
pkg/console/model/service.go:196-206、pkg/console/handler/service.go:136-145):统一规范化大小写与空白、默认"true"、保留 legacy"protobuf"兼容输入,并在发起任何 RPC 前返回data.field="generic"。 attachments优先级与不可变处理严谨(pkg/console/service/service_generic_invoke.go:93-101):先浅拷贝调用方attachments再写入请求generic,避免污染原 map,并通过TestGenericInvokeSDKModes走真实 SDK reference / filter 链覆盖了dubbo与tri下的各种模式。invoked标记设计合理(pkg/console/service/service_generic_invoke.go:90-130,393-397):客户端初始化失败时不虚构protocol与serialization,配合重试/取消/失败单测覆盖较充分。- 前端请求快照语义正确:发起调用时固化
requestedGeneric,切换下拉框不会污染上一笔调用的结果标签,同时同步更新了 mock 与 API 类型定义。
问题(Issues)
Critical(必须修复)
- 与
develop分支存在冲突,需适配新的结构化错误与 IDL 调用路径- 位置:
pkg/console/handler/service.go:136-158、pkg/console/service/service_generic_invoke.go:109、pkg/console/model/service.go、pkg/console/model/service_generic_invoke_test.go - 原因:当前 PR 处于
CONFLICTING状态。develop分支已合入writeGenericInvokeError、ServiceGenericInvokeValidationError、IDL 元数据选择与service_idl_invoke.go,并且两侧均新增了pkg/console/model/service_generic_invoke_test.go。本 PR 的GenericModeError与 handler 错误分支会与上述结构化错误设计冲突;同时service_generic_invoke.go:109在Dial路径上硬编码了client.WithIDL(dubboconstant.NONIDL),未兼容 IDL provider。 - 建议:先 rebase 到最新
develop(同时剔除与develop重复的pkg/console/handler/observability_test.go改动),复用ServiceGenericInvokeValidationError{Field: "generic"}和writeGenericInvokeError,并明确 IDL 调用路径的generic/protocol/serialization返回及WithIDL处理。
- 位置:
Important(建议修复)
-
generic="false"普通调用丢弃了元数据解析出的ParameterTypes,复杂参数场景易失败- 位置:
pkg/console/service/service_generic_invoke.go:111-123 - 原因:当
invocation.Generic == "false"时,仅将解码后的[]hessian.Object传给conn.CallUnary,丢弃了从 provider 元数据解析得到的invocation.ParameterTypes。在dubbo+hessian2场景下,SDK 会按 Go 运行时值推导线缆类型签名,面对 Java 的int/Integer、long/Long、List<T>、POJO 或重载方法时极易触发找不到方法或类型不匹配。当前单测使用 stub protocol 仅校验了参数数量,未验证真实线缆行为。 - 建议:补充针对真实 Dubbo provider(含非
String参数或方法重载)的集成测试来验证"false"模式;若当前形态无法可靠支持复杂类型,应对支持范围做显式限制或给出清晰提示。
- 位置:
-
Handler 早期错误路径改变了响应契约,返回了误导性的零值
data- 位置:
pkg/console/handler/service.go:148-158 - 原因:当
InvokeServiceGeneric在未发起 RPC 前失败(如实例不存在、元数据缺失或参数解码失败,返回resp == nil)时,handler 仍构造并返回data: {generic, elapsedMs: 0, rawResult: null}。这不仅改变了原有无data的错误响应契约,elapsedMs: 0也容易让调用方误以为已尝试调用。 - 建议:结合 rebase 后的
writeGenericInvokeError,仅在确实发生过调用尝试或需要显式字段时返回相应data,避免在未调用前填充零值字段。
- 位置:
-
SearchInstanceResp复用于全局实例接口,且展示数据源与实际调用源存在偏差风险- 位置:
pkg/console/model/instance.go:57-60、pkg/console/service/service_provider_instances.go - 原因:
SearchInstanceResp被多个通用实例列表接口复用,直接在其中添加 provider 元数据专属的Generic以及Serialization/PreferSerialization字段会泄漏到其他实例接口;此外,页面展示读取的是目录层Instance,而调用阶段读取的是RPCInstance,两者不同步时界面展示与实际调用配置会不一致。 - 建议:为 provider 实例列表定义独立的响应 DTO,并保证展示字段与调用阶段来源一致。
- 位置:
-
前端“provider 支持情况未确认”提示为静态常显,未结合已声明的
selectedProvider.generic判断- 位置:
ui-vue3/src/views/resources/services/tabs/debug.vue:177-179 - 原因:提示文本写死常显,即便实例已声明
generic且与当前所选模式匹配仍持续展示;反之,当用户所选模式与实例声明不一致时却没有针对性提示。 - 建议:基于
selectedProvider.generic是否声明及与所选模式是否一致,动态决定展示“未声明/未确认”还是“与实例声明不一致”的提示。
- 位置:
总体评估
合并建议:With fixes(修改后可合入)
模式校验、attachments 优先级控制、失败场景下的传输信息上报及对应测试设计清晰;但当前分支与 develop 新增的结构化错误及 IDL 调用实现存在冲突,需先 rebase 整合,同时解决 generic="false" 类型签名丢失与早期错误响应契约问题。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Please provide a description of this PR:
相关 issue apache/dubbo-go#3742
让 Admin 明确选择调用模式,并展示序列化信息
更改内容:
默认是 "true",支持 Gson、Bean、Protobuf JSON 和 "false" 普通调用;保留 legacy "protobuf" 的 API 兼容输入。未知模式会返回 data.field="generic",不会发起 RPC
泛化模式通过 SDK 的 WithGenericType 传递;"false" 调用真实方法名,不走 $invoke。请求中的模式优先于 attachments 中的同名值
保留原有自动选择和重试逻辑,没有新增手动选择序列化的功能。响应增加 generic、protocol、serialization;失败时也能展示已尝试的调用信息,客户端初始化失败则不虚构实际值
增加模式下拉框、实例序列化配置和结果信息。provider 能力未确认时明确提示;结果使用请求发出时的模式,切换选项不会改变上一笔结果的标签
覆盖模式校验、SDK 调用行为、序列化重试记录,以及前端请求和结果展示
To help us figure out who should review this PR, please put an X in all the areas that this PR affects.