apache / apache/cloudstack

Refactor `listTemplates` and `listIsos` workflows

未关闭
#11,209 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
type:cleanup type:enhancement
主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 19 小时
30 天内合并 PR
32

描述

The workflows of the `listIsos` and `listTemplates` APIs, particularly the `com.cloud.api.query.QueryManagerImpl#searchForTemplatesInternal` method, could greatly benefit from refactoring.

This method accepts over 20 parameters, spans approximately 200 lines, performs DAO operations directly from the business/service layer, and lacks modularization, logging, and unit tests. These issues make troubleshooting and maintenance challenging.

https://github.com/apache/cloudstack/blob/f52e05863e608f53f9e97e93fe47577b8dfe189b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java#L4802-L5007

贡献指南

打开贡献指南

调研方向

从 server/src/main/java/com/cloud/api/query/QueryManagerImpl.java 中的 searchForTemplatesInternal 开始,然后跟踪 listIsos 和 listTemplates 工作流及其直接的 DAO 操作。当工作流完成模块化、服务层职责得到改进、添加日志记录,并且单元测试覆盖变更后的行为时,重构即完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
backend-api-design, cloud
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。