cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Adding a default setter for domainPath in ControlledEntityResponse, Overridden in NetworkRespose class and populated the same in createNetworkResponse method of ApiResponseHelper #8086

Open isupersky opened this issue 2 years ago • 31 comments

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- Screenshot from 2023-11-09 16-14-55

After- Screenshot from 2023-11-09 16-15-17

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?

isupersky avatar Nov 09 '23 10:11 isupersky

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.

codecov[bot] avatar Nov 09 '23 11:11 codecov[bot]

@blueorangutan package

shwstppr avatar Nov 13 '23 06:11 shwstppr

@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 avatar Nov 13 '23 06:11 blueorangutan

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 avatar Nov 13 '23 07:11 blueorangutan

@blueorangutan package

rohityadavcloud avatar Nov 14 '23 07:11 rohityadavcloud

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

blueorangutan avatar Nov 14 '23 07:11 blueorangutan

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

blueorangutan avatar Nov 14 '23 08:11 blueorangutan

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Nov 15 '23 09:11 github-actions[bot]

@isupersky can you resolve the conflict?

DaanHoogland avatar Nov 15 '23 09:11 DaanHoogland

@blueorangutan package

DaanHoogland avatar Nov 15 '23 12:11 DaanHoogland

@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 avatar Nov 15 '23 12:11 blueorangutan

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 avatar Nov 15 '23 13:11 blueorangutan

@blueorangutan test keepEnv

DaanHoogland avatar Nov 15 '23 13:11 DaanHoogland

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

blueorangutan avatar Nov 15 '23 13:11 blueorangutan

[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

blueorangutan avatar Nov 16 '23 02:11 blueorangutan

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

DaanHoogland avatar Nov 20 '23 07:11 DaanHoogland

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 ?

isupersky avatar Nov 20 '23 07:11 isupersky

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

shwstppr avatar Nov 20 '23 07:11 shwstppr

@blueorangutan package

shwstppr avatar Nov 25 '23 11:11 shwstppr

@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 avatar Nov 25 '23 11:11 blueorangutan

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 avatar Nov 25 '23 12:11 blueorangutan

@blueorangutan test

DaanHoogland avatar Nov 25 '23 17:11 DaanHoogland

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

blueorangutan avatar Nov 25 '23 17:11 blueorangutan

[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

blueorangutan avatar Nov 26 '23 06:11 blueorangutan

@shwstppr @vishesh92 Are you alright with the code like this?

DaanHoogland avatar Nov 27 '23 05:11 DaanHoogland

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Dec 01 '23 13:12 github-actions[bot]

@vishesh92 @shwstppr can you approve of this now?

DaanHoogland avatar Dec 04 '23 08:12 DaanHoogland

@blueorangutan package

shwstppr avatar Dec 05 '23 07:12 shwstppr

@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 avatar Dec 05 '23 07:12 blueorangutan

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

blueorangutan avatar Dec 05 '23 08:12 blueorangutan