-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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.46% 17.46% -0.01%
+ Complexity 15516 15515 -1
============================================
Files 5913 5913
Lines 529385 529401 +16
Branches 64679 64681 +2
============================================
+ Hits 92448 92449 +1
- Misses 426518 426533 +15
Partials 10419 10419
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); |
|
@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 |
DaanHoogland
left a comment
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
|
[SF] Trillian test result (tid-14970)
|
sudo87
left a comment
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
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 |
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?