-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: implement discovery backend by zk #1371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds ZooKeeper discovery support to dubbo-admin, enabling the system to discover and monitor Dubbo services registered in ZooKeeper. The PR also includes a significant refactoring of constant naming conventions (adding "Dot" suffix variants) and introduces a new ID field to the discovery configuration structure to better identify discovery instances.
Key changes include:
- Implementation of ZooKeeper discovery with recursive path watching capabilities
- Addition of new resource types (ZKConfig and ZKMetadata) for handling ZooKeeper-specific data
- Refactoring of rule suffix constants to distinguish between dot-prefixed and non-prefixed versions
- Extraction of common resource conversion helper functions to promote code reuse
Reviewed changes
Copilot reviewed 47 out of 48 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/discovery/zk/factory.go | Implements the ZooKeeper discovery factory with resource conversion functions |
| pkg/discovery/zk/zkwatcher/watcher.go | Provides recursive ZooKeeper node watching with event emission |
| pkg/discovery/zk/zkwatcher/watcher_test.go | Basic integration test for the ZooKeeper watcher |
| pkg/discovery/zk/listerwatcher/listerwatcher.go | Implements list-watch pattern for ZooKeeper resources |
| pkg/core/discovery/subscriber/zk_metadata.go | Subscriber for processing ZooKeeper metadata events |
| pkg/core/discovery/subscriber/zk_config.go | Subscriber for processing ZooKeeper config events |
| pkg/core/resource/apis/mesh/v1alpha1/zkmetadata_types.go | Resource type definition for ZKMetadata |
| pkg/core/resource/apis/mesh/v1alpha1/zkconfig_types.go | Resource type definition for ZKConfig |
| pkg/core/resource/apis/mesh/v1alpha1/*_helper.go | Extracted helper functions for resource conversion |
| pkg/config/discovery/config.go | Added ID field and validation for discovery configuration |
| pkg/common/constants/rule.go | Refactored rule suffix constants with dot-prefixed variants |
| pkg/console/handler/*.go | Updated to use new dot-suffixed constant names |
| app/dubbo-admin/dubbo-admin.yaml | Example configuration updated for ZooKeeper discovery |
| go.mod/go.sum | Added go-zookeeper dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 46 out of 47 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 46 out of 47 changed files in this pull request and generated 13 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
GPT 代码审查报告(feat: implement discovery backend by zk)
无重大 Bug:代码防御性较好,ZK 连接和监视逻辑使用标准库,配置解析完整。
无重大错误:ZK 集成逻辑合理,新资源类型与现有框架兼容,常量重构(dot 前缀)提升可维护性。
规范良好:Go 风格一致,Send/Sync 实现合理,注释清晰。 总体建议 优点:ZK 发现支持完整,重构提升可维护性,配置 ID 改进唯一性。 |
|



Please provide a description of this PR:
refer to #1365
To help us figure out who should review this PR, please put an X in all the areas that this PR affects.
Please check any characteristics that apply to this pull request.