-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ui,api,server: template categorization based on os #10773
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
base: 4.20
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10773 +/- ##
============================================
+ Coverage 16.13% 16.15% +0.01%
- Complexity 13215 13255 +40
============================================
Files 5652 5659 +7
Lines 496578 497389 +811
Branches 60134 60348 +214
============================================
+ Hits 80139 80334 +195
- Misses 407518 408124 +606
- Partials 8921 8931 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
looks nice. would be great for end-users. |
Adds new interface for image selection (template/iso) for an instance in UI. Old interface can still be used and it can be configured using UI configuration (config.json) OS categories/Guest OS categories have been improved with ability to create new categories, delete an existing category, and marking a category as featured to allow it to show up in the UI in the image selection interface. New APIs added: - addOsCategory - deleteOsCategory - updateOsCategory APIs updated: - updateOsType - listTemplates - listOsCategories Several improvements in UI especially related to forms - DeloyVM, ReinstallVM, CreateVnfAppliance, AddAutoscaleGroup. DeployVM form can now be opened from template details view with query params. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
f9852f0
to
90294a6
Compare
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@blueorangutan package |
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13202 |
show only required elements when query params are passed Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@blueorangutan package |
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13221 |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
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 PR introduces an enhanced OS categorization interface for both the UI and API by adding new endpoints and updating existing ones to support operations such as adding, updating, and deleting OS categories. Key changes include:
- New API commands for managing OS categories (add, update, delete).
- Enhancements in the DAO and VO layers to support the new category properties such as featured and sortKey.
- Updates to tests and response objects to incorporate the new fields.
Reviewed Changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
engine/schema/src/main/java/com/cloud/storage/dao/GuestOSDaoImpl.java | Added a new method to list IDs by category. |
engine/schema/src/main/java/com/cloud/storage/GuestOSCategoryDaoImpl.java | Adjusted SQL count query for consistency. |
engine/schema/src/main/java/com/cloud/storage/GuestOSCategoryVO.java | Included new columns (featured, sortKey) with their getters/setters. |
api/.../*.java | Introduced and updated API commands and responses for managing OS categories. |
api/src/main/java/org/apache/cloudstack/api/ApiConstants.java | Added new constant for ISO support. |
api/src/main/java/com/cloud/server/ResourceTag.java | Added a new resource tag for Guest OS category. |
api/src/main/java/org/apache/cloudstack/api/ResponseGenerator.java | Added response generation method for Guest OS categories. |
api/src/main/java/org/apache/cloudstack/api/ManagementService.java | Declared new methods for OS category operations. |
@@ -71,7 +77,7 @@ public String getOsDisplayName() { | |||
return osDisplayName; | |||
} | |||
|
|||
public Map getDetails() { | |||
public Map<String, String> getDetails() { |
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.
The getDetails() method initializes a new empty map and then checks if it is not empty, which will always return false, effectively ignoring the 'details' parameter intended to be processed. Also, remove the redundant semicolon in the map initialization ("new HashMap<>();;").
Copilot uses AI. Check for mistakes.
@blueorangutan package |
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13228 |
@blueorangutan test |
@shwstppr a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
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.
code lgtm
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.
@shwstppr Some minor changes in the backend.
I am now reviewing changes in UI now.
api/src/main/java/org/apache/cloudstack/api/command/admin/guest/DeleteGuestOsCategoryCmd.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/command/admin/guest/DeleteGuestOsCategoryCmd.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsCategoryCmd.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsCmd.java
Outdated
Show resolved
Hide resolved
engine/schema/src/main/java/com/cloud/storage/dao/GuestOSCategoryDaoImpl.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/cloud/server/ManagementServerImpl.java
Outdated
Show resolved
Hide resolved
server/src/test/java/com/cloud/server/ManagementServerImplTest.java
Outdated
Show resolved
Hide resolved
@@ -50,7 +50,7 @@ public class UpdateGuestOsCmd extends BaseAsyncCmd { | |||
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = GuestOSResponse.class, required = true, description = "UUID of the Guest OS") | |||
private Long id; | |||
|
|||
@Parameter(name = ApiConstants.OS_DISPLAY_NAME, type = CommandType.STRING, required = true, description = "Unique display name for Guest OS") |
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.
JFYI, this will require a change in go sdk here to ensure the SDK is backward compatible.
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.
noted
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.
@vishesh92 created apache/cloudstack-go#109
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Related to apache/cloudstack#10773 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
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.
@shwstppr some minor changes in UI.
Related to apache/cloudstack#10773 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
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 PR enhances the OS category support for image/template selection in the UI and improves the related API functionality. Key changes include new API endpoints for adding, updating, and deleting OS categories; introducing a featured flag and sort key to the OS category model; and updating tests and API responses to support these changes.
Reviewed Changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
engine/schema/src/main/java/com/cloud/storage/dao/GuestOSDaoImpl.java | Added new method to list guest OS IDs by category |
engine/schema/src/main/java/com/cloud/storage/GuestOSCategoryVO.java | Introduced new fields "featured" and "sortKey" with corresponding accessors |
api/src/main/java/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java | Added osCategoryId parameter for template listing API |
api/src/main/java/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java | Extended API parameters (featured, iso, vnf, zoneId, arch) for listing OS categories |
api/src/main/java/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsCmd.java | Updated API parameters and details processing with new osCategoryId parameter |
api/src/main/java/org/apache/cloudstack/api/command/admin/guest/AddGuestOsCategoryCmd.java, UpdateGuestOsCategoryCmd.java, DeleteGuestOsCategoryCmd.java | New API commands for managing OS categories in the admin interface |
api/src/main/java/org/apache/cloudstack/api/ResponseGenerator.java, ApiConstants.java, ManagementService.java | Updated to support the newly added guest OS category functionality |
Comments suppressed due to low confidence (1)
api/src/main/java/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsCmd.java:53
- The required attribute was removed from the OS_DISPLAY_NAME parameter. Verify if this change is intentional, as it might affect how updates to the guest OS are validated.
@Parameter(name = ApiConstants.OS_DISPLAY_NAME, type = CommandType.STRING, description = "Unique display name for Guest OS")
@@ -152,4 +153,14 @@ public Pair<List<? extends GuestOS>, Integer> listGuestOSByCriteria(Long startIn | |||
return new Pair<>(result.first(), result.second()); | |||
} | |||
|
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.
[nitpick] Consider adding a brief comment for the new listIdsByCategoryId method to clarify its purpose and usage in retrieving guest OS IDs by category.
/** | |
* Retrieves a list of guest OS IDs that belong to the specified category. | |
* | |
* @param categoryId the ID of the guest OS category | |
* @return a list of guest OS IDs | |
*/ |
Copilot uses AI. Check for mistakes.
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr Found one bug in
Query params for the failed request {
"oscategoryid": "-1",
"page": "1",
"pageSize": "10",
"zoneid": "cd313a1e-89f5-4d20-bfab-2ec2f41d259c",
"account": "admin",
"domainid": "22bb67fe-2976-11f0-93a0-1e0077000180",
"templatefilter": "all",
"details": "all",
"showicon": "true",
"isvnf": "false",
"command": "listTemplates"
} |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@vishesh92 thanks for the review and testing. I've addressed the review comments and fixed the listTemplates issue |
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.
clgtm. did basic testing of the UI.
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13259 |
Description
Adds new interface for image selection (template/iso) for an instance in UI.
Old interface can still be used and it can be configured using UI configuration (config.json)
OS categories/Guest OS categories have been improved with ability to create new categories, delete an existing category, and marking a category as featured to allow it to show up in the UI in the image selection interface.
New APIs added:
APIs updated:
Several improvements in UI especially related to forms - DeloyVM, ReinstallVM, CreateVnfAppliance, AddAutoscaleGroup.
DeployVM form can now be opened from template/ISO details view with query params.
Reorganized (removed and added some) OS categories to the following (in the same order):
Documentation PR: apache/cloudstack-documentation#500
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?