CAICAIIs opened a new issue, #3329: URL: https://github.com/apache/dubbo-go/issues/3329
## 目标 继续推进 #3204,最终优雅移除 legacy `config` package。 当前不建议直接用一个大 PR 删除 `config/`,而是先让 `global` / `InstanceOptions` / URL attributes 成为运行时唯一配置来源。等运行时依赖和兼容桥都清理完后,再做最终删除。 ## 当前剩余范围 当前扫描显示,legacy `config` 依赖主要还集中在: - `registry/directory` - `registry/protocol` - `remoting/getty` - `graceful_shutdown` - `filter/graceful_shutdown` - root compat bridge 和相关测试 - `tools/variadicrpccheck` 测试 - `config/interfaces` 中仍被使用的 `ConfigReader` ## PR 拆分计划 ### PR 1:移除 registry 对 legacy config 的运行时依赖 清理: - `registry/directory/directory.go` - `registry/protocol/protocol.go` 目标是移除 `config.GetRootConfig()`、`config.GetProviderConfig()`、`config.GetProviderService()`、`config.GetShutDown()` 等旧路径读取。 需要覆盖的关键路径: - application listener key - reExport service map - Destroy 时 shutdown wait 逻辑 ### PR 2:移除 getty remoting 对 legacy config 的依赖 清理: - `remoting/getty/getty_client.go` - `remoting/getty/getty_server.go` 目标是移除 protocol / TLS 配置从 legacy root config 读取的 fallback,改为使用 URL attributes 或 runtime config。 ### PR 3:收敛 graceful shutdown 兼容逻辑 清理: - `graceful_shutdown/shutdown.go` - `filter/graceful_shutdown/*` 目标是把 `config.Setter` 这类小接口移出 legacy `config`,并在旧 config 调用方不再注入 `*config.ShutdownConfig` 后,删除 filter 中的旧类型兼容分支。 ### PR 4:迁移仍被使用的 `ConfigReader` 清理: - `common/extension/config_reader.go` - `protocol/rest/config/reader/rest_config_reader.go` 只迁移仍被使用的 `ConfigReader`,不要机械搬迁整个 `config/interfaces` 目录。已有重复接口需要顺手收敛,迁移位置需要避免 import cycle。 ### PR 5:移除 root compat bridge 在运行时路径不再读取 legacy config 后,清理: - `compat.go` - 相关 compat 测试 - `instance_options_init.go` 中写回 legacy `RootConfig` 的逻辑 同时确认 config-center 动态更新不再依赖写回 legacy `RootConfig`。 ### PR 6:最终删除 legacy `config/` 当所有 import 都清零后: - 删除 `config/` 目录 - 删除 `config/generic` 等 deprecated alias - 更新仍引用旧 package path 的测试和工具 - 更新仍引用旧 `config` 的 docs / samples / templates ## 非目标 - 不删除 `config_center` - 不删除 `common/config` - 不做无关 registry / remoting / protocol 行为重构 - 不引入新的兼容层,除非维护者明确希望保留一个版本周期 ## 验收标准 - 运行时代码不再 import `dubbo.apache.org/dubbo-go/v3/config` - `config_center` 保持可用 - registry、remoting、graceful shutdown、timeout、TLS 行为保持兼容 - 每个 PR 独立通过相关 package tests - 最终 PR 通过 `go test ./...` - 最终 PR 通过 `make lint` - 最终删除前完成相关 samples smoke test -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
