xiaobaicai66695 opened a new issue, #1547:
URL: https://github.com/apache/dubbo-admin/issues/1547

   ## 背景
   
   Dubbo Admin 目前缺少对 Dubbo 3 已有 Affinity Router 与 Script Router 
的完整管理能力。Dubbo-Go / Dubbo-Java consumer 已具备相应的动态配置监听与运行时路由实现,但 Admin 需要补齐公共 YAML 
契约、配置中心发布回读、API 和 UI,才能形成可管理、可验证的治理闭环。
   
   本 issue 从 #1523 拆分而来,仅覆盖 Affinity 与 Script Router,避免与 OSPP “Dubbo-go Runtime 
与 Dubbo-admin 控制面能力对齐”中承担的 Condition、Tag 与实例禁流工作重叠。
   
   ## 范围
   
   ### Affinity Router
   
   - 支持 service/application scope 的 `.affinity-router` 规则管理。
   - 规则名必须为 `<key>.affinity-router`。
   - 外部 YAML 使用 `affinityAware.key` 与 `affinityAware.ratio`,且 `ratio` 范围为 
`[0,100]`。
   - 固定使用 `configVersion: v3.1`,以兼容 Dubbo-Java Affinity parser。
   - 完成 Admin resource、YAML codec、配置中心下发/回读、Console API、前端 CRUD 及 Dubbo-Go E2E。
   
   ### Script Router
   
   - 支持 application scope 的 `.script-router` 规则管理。
   - 规则名必须为 `<provider-application>.script-router`。
   - 仅允许 `javascript` 类型、非空脚本和受限脚本长度。
   - 完成 Admin resource、YAML codec、配置中心下发/回读、Console API、前端 CRUD 及 Dubbo-Go E2E。
   - Admin 只管理和下发脚本,不执行脚本;不承诺同一脚本文本在 Java 与 Go runtime 间可移植。
   
   ### 配置中心契约
   
   - ZooKeeper:`/dubbo/config/dubbo/<ruleName>`。
   - Nacos:`DataId=<ruleName>, Group=dubbo`。
   - 验证 create/update/delete 使 Dubbo-Go consumer 分别收到 Add/Update/Delete,并更新/撤销 
RouterChain 中的动态状态。
   
   ## 非目标 / 协作边界
   
   - 不处理 Condition Router、Tag Router、实例禁流;这些由 OSPP 项目负责。
   - 不处理 Dynamic Config / `.configurators`。
   - 不处理 Dubbo-Go 应用级 metadata、服务视图、Prometheus 指标、OpenTelemetry trace。
   - 不改变或恢复 Dubbo-Go 旧接口级服务发现模型。
   - 不扩展新的治理语义,仅对齐已有 Affinity/Script Router 的配置与管理链路。
   
   ## 实施 PR 计划
   
   每个实现 PR 采用单一目标,先在个人 fork 内完成 review 与 E2E 验证,再整理提交到上游仓库。
   
   1. **Affinity/Script resource and YAML contract**
      - ResourceKind、suffix、外部 YAML encode/decode、前置校验与单元测试。
      - 不修改 Condition/Tag 的模型或语义。
   
   2. **Affinity/Script configuration-center and Console API**
      - ZK/Nacos 的发布、回读、watcher kind 分派。
      - search/detail/create/update/delete handler、service、model 与后端测试。
   
   3. **Affinity/Script frontend management**
      - 菜单、路由、API client、YAML 编辑/回显与 CRUD 页面。
      - Affinity 仅 v3.1;Script 仅 application/javascript。
   
   4. **Dubbo-Go consumption E2E and compatibility documentation**
      - 真实 ZK(必要时 Nacos)create/update/delete 验证。
      - Consumer 收到变更、RouterChain 路由结果变化、删除后恢复。
      - 文档明确 Java/Go 的脚本语义边界和 Dubbo-Go Affinity 注册前提。
   
   ## 验收标准
   
   ```text
   Admin create/update/delete
     -> 配置中心出现正确的 key、group 与 YAML
     -> Dubbo-Go 收到 Add/Update/Delete
     -> Affinity/Script RouterChain 行为随规则变更而变化
     -> 删除后不再保留动态规则影响
     -> Admin 回读不丢失 Affinity/Script 的外部字段
   ```
   


-- 
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]

Reply via email to