-
Notifications
You must be signed in to change notification settings - Fork 1.2k
api,server,ui: support tags for domains #11964
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: main
Are you sure you want to change the base?
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.56% 17.56% -0.01%
Complexity 15540 15540
============================================
Files 5909 5909
Lines 529045 529075 +30
Branches 64615 64621 +6
============================================
+ Hits 92933 92938 +5
- Misses 425657 425683 +26
+ Partials 10455 10454 -1
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); | ||
| } |
Copilot
AI
Nov 4, 2025
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.
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); |
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?