api,server,ui: support tags for domains#11964
api,server,ui: support tags for domains#11964harikrishna-patnala merged 6 commits intoapache:mainfrom
Conversation
Fixes apache#11608 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #11964 +/- ##
==========================================
Coverage 17.84% 17.85%
- Complexity 15983 15996 +13
==========================================
Files 5929 5930 +1
Lines 531084 531272 +188
Branches 64914 64939 +25
==========================================
+ Hits 94795 94835 +40
- Misses 425675 425818 +143
- Partials 10614 10619 +5
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:
|
There was a problem hiding this comment.
Pull Request Overview
This pull request adds tag support for Domain resources in Apache CloudStack. The changes enable domains to have resource tags attached, similar to other CloudStack resources like VMs, networks, and projects.
Key Changes
- Enabled resource tagging support for Domain entities by updating the ResourceObjectType configuration
- Modified DomainResponse to extend BaseResponseWithTagInformation and populate tags in the API response
- Updated the UI to include Domain in the list of resources that support tags
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| api/src/main/java/com/cloud/server/ResourceTag.java | Enabled resource tags support for Domain entities by changing the first parameter from false to true |
| api/src/main/java/org/apache/cloudstack/api/response/DomainResponse.java | Changed base class to BaseResponseWithTagInformation and added setTags() method |
| server/src/main/java/com/cloud/api/query/dao/DomainJoinDaoImpl.java | Added logic to retrieve and populate tags when creating domain responses |
| server/src/main/java/com/cloud/api/ApiResponseHelper.java | Added logic to retrieve and populate tags in createDomainResponse() method and reorganized imports |
| ui/src/components/view/InfoCard.vue | Added 'Domain' to the list of supported resources for tag display |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| List<ResourceTagJoinVO> tags = ApiDBUtils.listResourceTagViewByResourceUUID(domain.getUuid(), | ||
| ResourceTag.ResourceObjectType.Domain); | ||
| if (CollectionUtils.isNotEmpty(tags)) { | ||
| Set<ResourceTagResponse> tagResponses = new HashSet<>(); | ||
| for (ResourceTagJoinVO tag : tags) { | ||
| ResourceTagResponse tagResponse = ApiDBUtils.newResourceTagResponse(tag, true); | ||
| tagResponses.add(tagResponse); | ||
| } | ||
| domainResponse.setTags(tagResponses); | ||
| } |
There was a problem hiding this comment.
This tag retrieval and population logic is duplicated in ApiResponseHelper.createDomainResponse(). Consider extracting this into a shared helper method to avoid code duplication and maintain consistency.
| List<ResourceTagJoinVO> tags = ApiDBUtils.listResourceTagViewByResourceUUID(domain.getUuid(), | |
| ResourceTag.ResourceObjectType.Domain); | |
| if (CollectionUtils.isNotEmpty(tags)) { | |
| Set<ResourceTagResponse> tagResponses = new HashSet<>(); | |
| for (ResourceTagJoinVO tag : tags) { | |
| ResourceTagResponse tagResponse = ApiDBUtils.newResourceTagResponse(tag, true); | |
| tagResponses.add(tagResponse); | |
| } | |
| domainResponse.setTags(tagResponses); | |
| } | |
| ApiResponseHelper.populateDomainTags(domain.getUuid(), domainResponse); |
|
@blueorangutan package |
|
@DaanHoogland 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16002 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14970)
|
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
Addressed comments from Copilot @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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16025 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@blueorangutan package |
|
@harikrishna-patnala a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 16544 |
|
@blueorangutan package |
|
@harikrishna-patnala a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16550 |
* api,server,ui: support tags for domains Fixes apache#11608 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * address copilot comment Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * fix import Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * Added tags support to listDomains API --------- Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> Co-authored-by: Harikrishna Patnala <harikrishna.patnala@gmail.com>

Description
Fixes #11608
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?