fix: stabilize CI and decouple proxy SPI loading - #7
Merged
Merged
Conversation
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.
问题
当前
main的 GitHub Actions 在Run unit tests阶段失败:rpc-core单测通过 SPI 实例化JdkProxyFactory时,构造器会立刻创建RpcClient,进而尝试加载nettyTransport。由于rpc-core本身按设计不依赖rpc-transport-netty,因此测试 classpath 中不存在该 Transport 实现,最终报No such extension of name netty。这不是 Nacos 或 runner 问题,而是 ProxyFactory 构造阶段存在不必要的基础设施初始化。
修复
JdkProxyFactory改为延迟初始化RpcClientByteBuddyProxyFactory同样改为延迟初始化,保持两套代理行为一致RpcClient注入构造器,现有代理复用测试不受影响ExtensionLoaderTest:直接实例化jdk和bytebuddy两个 ProxyFactory,防止后续回归CI 更新
升级 GitHub 官方 Actions 到当前主版本:
actions/checkout@v7actions/setup-java@v6actions/upload-artifact@v7其中
setup-javav6 当前版本包含 Temurin 17 在 GitHub Actions 环境下的修复。预期结果
rpc-core可以独立执行单元测试,不需要反向依赖rpc-transport-netty,避免 Maven 模块循环依赖,同时修复当前 CI 的单测红叉。