fix(naming): Fix the empty cluster name parameter handling logic to ensure the v3 HTTP processing logic is consistent with gRPC.#14674
Hidden character warning
Conversation
|
Thanks for your this PR. 🙏 感谢您提交的PR。 🙏 |
- 删除了 InstanceListForm 中未使用的 UtilsAndCommons 导入 - 保持代码整洁性并减少不必要的依赖引入
|
- 将通配符导入替换为具体的JUnit断言方法导入 - 明确导入assertEquals、assertFalse、assertNotNull、assertTrue和assertThrows方法 - 提高代码可读性和维护性 - 遵循最佳实践减少不必要的导入依赖
- 删除了对 clusterName 的冗余验证逻辑 - 保留了实际集群名称的必要验证 - 简化了服务实例选择流程中的条件判断
- 将 listInstances 方法调用中的第四个参数从 anyString() 修改为 any() - 保持其他参数匹配器不变 - 确保测试方法 getInstanceList 的功能正常运行
|
修改之后是否会影响到控制台的展示逻辑? 能否帮忙测试一下? |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
@iggzq 根据review, 控制台的访问应该不受影响,但是如果用户在使用maintainer-client进行访问或者直接调用api会有行为不同的影响, 需要你更新一下文档进行说明。 文档需改的PR提交无问题后再合并此PR |
|
|
ok,晚上我改一下 |
- 为 listInstances 方法添加带有 clusterName 参数的测试用例
已在nacos-group/nacos-group.github.io中修改文档 |
|
|
|
你们是谁啊,不要再给我发邮件了,好吗
坏坏的对你笑
***@***.***
原始邮件
发件人:Same ***@***.***>
发件时间:2026年3月25日 10:16
收件人:alibaba/nacos ***@***.***>
抄送:Subscribed ***@***.***>
主题:Re: [alibaba/nacos] fix(naming): Fix the empty cluster name parameter handling logic to ensure the v3 HTTP processing logic is consistent with gRPC. (PR #14674)
@Sarahbella4040 approved this pull request.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
|
@iggzq 文档已经reivew,有修改意见麻烦更新一下。 |
| } | ||
| if (!serviceStorage.getClusters(service).contains(clusterName)) { | ||
| throw new NacosException(NacosException.NOT_FOUND, "cluster " + clusterName + " is not found!"); | ||
| String actualCluster = StringUtils.isBlank(clusterName) ? StringUtils.EMPTY : clusterName; |
There was a problem hiding this comment.
这一行看起来是多余的。 因为下面有校验是否为blank
|
@iggzq 给了一点新的评论: 同时建议同步一下develop分支, develop分支优化了一下ci的稳定性。文档的冲突也解决一下。 |
What is the purpose of the change
fix(#14650) : the Nacos v3 API is inconsistent with the gRPC client mechanism.
Brief changelog
XX
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check spotbugs:check -DskipTeststo make sure basic checks pass. Runmvn clean install -DskipITsto make sure unit-test pass. Runmvn clean test-compile failsafe:integration-testto make sure integration-test pass.