Skip to content

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Nov 3, 2025

Description

Fixes #11608

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

image

How Has This Been Tested?

> list  domains id=e1190923-d037-4464-9b97-ad912a242952
{
  "count": 1,
  "domain": [
    {
      "backupavailable": "Unlimited",
      "backuplimit": "Unlimited",
      "backupstorageavailable": "800",
      "backupstoragelimit": "Unlimited",
      "backupstoragetotal": 0,
      "backuptotal": 0,
      "bucketavailable": "Unlimited",
      "bucketlimit": "Unlimited",
      "buckettotal": 0,
      "cpuavailable": "Unlimited",
      "cpulimit": "Unlimited",
      "cputotal": 0,
      "created": "2025-10-13T13:06:28+0530",
      "gpuavailable": "Unlimited",
      "gpulimit": "Unlimited",
      "gputotal": 0,
      "hasannotations": false,
      "haschild": false,
      "id": "e1190923-d037-4464-9b97-ad912a242952",
      "ipavailable": "Unlimited",
      "iplimit": "Unlimited",
      "iptotal": 0,
      "level": 1,
      "memoryavailable": "Unlimited",
      "memorylimit": "Unlimited",
      "memorytotal": 0,
      "name": "d1",
      "networkavailable": "Unlimited",
      "networklimit": "Unlimited",
      "networktotal": 1,
      "objectstorageavailable": "Unlimited",
      "objectstoragelimit": "Unlimited",
      "objectstoragetotal": 0,
      "parentdomainid": "27c065d7-a514-11f0-ade4-a02942fcdd70",
      "parentdomainname": "ROOT",
      "path": "ROOT/d1",
      "primarystorageavailable": "Unlimited",
      "primarystoragelimit": "Unlimited",
      "primarystoragetotal": 0,
      "projectavailable": "Unlimited",
      "projectlimit": "Unlimited",
      "projecttotal": 0,
      "secondarystorageavailable": "Unlimited",
      "secondarystoragelimit": "Unlimited",
      "secondarystoragetotal": 0,
      "snapshotavailable": "Unlimited",
      "snapshotlimit": "Unlimited",
      "snapshottotal": 0,
      "state": "Active",
      "tags": [
        {
          "key": "abc",
          "value": "xyz"
        }
      ],
      "templateavailable": "Unlimited",
      "templatelimit": "Unlimited",
      "templatetotal": 0,
      "vmavailable": "Unlimited",
      "vmlimit": "Unlimited",
      "vmtotal": 0,
      "volumeavailable": "Unlimited",
      "volumelimit": "Unlimited",
      "volumetotal": 0,
      "vpcavailable": "Unlimited",
      "vpclimit": "Unlimited",
      "vpctotal": 0
    }
  ]
}

How did you try to break this feature and the system with this change?

Fixes apache#11608

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 5.55556% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.46%. Comparing base (f417c6b) to head (b1fb682).

Files with missing lines Patch % Lines
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% 12 Missing ⚠️
...apache/cloudstack/api/response/DomainResponse.java 0.00% 4 Missing ⚠️
...ava/com/cloud/api/query/dao/DomainJoinDaoImpl.java 0.00% 1 Missing ⚠️
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              
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.52% <5.55%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shwstppr shwstppr requested a review from Copilot November 4, 2025 04:13
Copy link
Contributor

Copilot AI left a 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.

Comment on lines 118 to 127
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);
}
Copy link

Copilot AI Nov 4, 2025

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16002

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@blueorangutan
Copy link

[SF] Trillian test result (tid-14970)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 55598 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11964-t14970-kvm-ol8.zip
Smoke tests completed. 147 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_uservm_host_control_state Failure 16.96 test_host_control_state.py
test_02_unsecure_vm_migration Error 333.76 test_vm_life_cycle.py
test_02_unsecure_vm_migration Error 333.77 test_vm_life_cycle.py
test_08_migrate_vm Error 20.27 test_vm_life_cycle.py
test_01_migrate_vm_strict_tags_success Error 71.61 test_vm_strict_host_tags.py

Copy link
Collaborator

@sudo87 sudo87 left a 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>
@shwstppr
Copy link
Contributor Author

Addressed comments from Copilot

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Domain Tagging

4 participants