Adding a default setter for domainPath in ControlledEntityResponse, Overridden in NetworkRespose class and populated the same in createNetworkResponse method of ApiResponseHelper #8086
Description
- Adding a default method setDomainPath in ControlledEntityResponse to avoid creating a variable and setter definitions in all implementations of ControlledEntityResponse class.
- and populated the same in createNetworkResponse method of ApiResponseHelper
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)
- [x] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
Screenshots (if appropriate):
Before-
After-
How Has This Been Tested?
Created a guest network and called the list networks filter=name,type,domainpath before and after the code change
How did you try to break this feature and the system with this change?
Codecov Report
Attention: Patch coverage is 20.00000% with 12 lines in your changes missing coverage. Please review.
Project coverage is 22.96%. Comparing base (
5651eab) to head (66dc924). Report is 713 commits behind head on main.
| Files | Patch % | Lines |
|---|---|---|
| ...src/main/java/com/cloud/api/ApiResponseHelper.java | 14.28% | 11 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #8207 +/- ##
============================================
- Coverage 23.44% 22.96% -0.49%
+ Complexity 23754 23279 -475
============================================
Files 5100 5118 +18
Lines 346393 346799 +406
Branches 49768 49789 +21
============================================
- Hits 81219 79634 -1585
- Misses 253491 255649 +2158
+ Partials 11683 11516 -167
| Flag | Coverage Δ | |
|---|---|---|
| simulator-marvin-tests | 24.60% <20.00%> (-0.53%) |
:arrow_down: |
| uitests | 4.44% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@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]: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 7727
@blueorangutan package
@rohityadavcloud 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]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 7741
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@isupersky can you resolve the conflict?
@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]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 7760
@blueorangutan test keepEnv
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
[SF] Trillian test result (tid-8328) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 46033 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8207-t8328-kvm-centos7.zip Smoke tests completed. 118 look OK, 0 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|
@shwstppr you "requested changes" but it not entirely clear what changes. Do you require "ROOT" to be returned? As said in https://github.com/apache/cloudstack/pull/8207#discussion_r1395338161, I think this should only be so in the UI.
Adding setDomainPath() method in ControlledEntityResponse makes sense but it is an interface and the method is not overridden in any of the implemented classes. Only NetworkResponse will have domainpath param which was having it even before this PR and the method there as well is not overridden.
@shwstppr I added it at two new flows of createNetworkResponse in ApiResponseHelper. I'm not sure which other implementation class would require domainpath for ListNetwork API ?
Adding setDomainPath() method in ControlledEntityResponse makes sense but it is an interface and the method is not overridden in any of the implemented classes. Only NetworkResponse will have domainpath param which was having it even before this PR and the method there as well is not overridden.
@shwstppr I added it at two new flows of createNetworkResponse in ApiResponseHelper. I'm not sure which other implementation class would require domainpath for ListNetwork API ?
In that case please appropriately update PR title/description that the change is limited to listNetworks API and not all implementations of ControlledEntityResponse class
@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]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 7828
@blueorangutan test
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
[SF] Trillian test result (tid-8392) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 45011 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8207-t8392-kvm-centos7.zip Smoke tests completed. 117 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|---|---|---|
| test_08_migrate_vm | Error |
0.05 | test_vm_life_cycle.py |
@shwstppr @vishesh92 Are you alright with the code like this?
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@vishesh92 @shwstppr can you approve of this now?
@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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7918