apache / apache/cloudstack

Refactor `listTemplates` and `listIsos` workflows

Open
#11,209 1 comment 1 reaction 0 assignees View on GitHub
type:cleanup type:enhancement
Dominant language
Java
Stars
3.1k
Forks
1.4k
Avg merge
6d 19h
Merged PRs (30d)
32

Description

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

Contributor guide

Open the contributing guide

Research direction

Start in server/src/main/java/com/cloud/api/query/QueryManagerImpl.java at searchForTemplatesInternal, then trace the listIsos and listTemplates workflows and their direct DAO operations. The refactor is done when the workflows are modularized, service-layer responsibilities are improved, logging is added, and unit tests cover the changed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, cloud
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.