cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Refactor SnapshotDataStoreDaoImpl

Open GutoVeronezi opened this issue 2 years ago • 17 comments

Description

PR #5909 is moving class SnapshotDataStoreDaoImpl to another package. Sonarcloud identified it as changes in every line of the file, reporting several code smells. As for the PR context it is only necessary to move the class to another package, I created this PR to address the code smells and also refactor some methods of the class.

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)
  • [x] Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • [ ] Major
  • [x] Minor

How Has This Been Tested?

I created unit tests for the methods.

GutoVeronezi avatar Sep 19 '22 21:09 GutoVeronezi

Codecov Report

Merging #6751 (e9a76a8) into main (bbc1260) will increase coverage by 0.10%. The diff coverage is 5.03%.

@@             Coverage Diff              @@
##               main    #6751      +/-   ##
============================================
+ Coverage     10.42%   10.52%   +0.10%     
- Complexity     6701     6787      +86     
============================================
  Files          2458     2464       +6     
  Lines        243246   244089     +843     
  Branches      38067    38203     +136     
============================================
+ Hits          25358    25701     +343     
- Misses       214714   215154     +440     
- Partials       3174     3234      +60     
Impacted Files Coverage Δ
...ack/storage/image/db/SnapshotDataStoreDaoImpl.java 5.75% <5.03%> (+1.48%) :arrow_up:
...rce/wrapper/LibvirtResizeVolumeCommandWrapper.java 49.50% <0.00%> (-27.17%) :arrow_down:
.../cloud/hypervisor/kvm/storage/KVMPhysicalDisk.java 70.27% <0.00%> (-10.98%) :arrow_down:
...pper/LibvirtPrepareForMigrationCommandWrapper.java 43.10% <0.00%> (-10.09%) :arrow_down:
...loud/hypervisor/kvm/resource/LibvirtSecretDef.java 60.00% <0.00%> (-3.16%) :arrow_down:
.../hypervisor/kvm/storage/ScaleIOStorageAdaptor.java 10.48% <0.00%> (-2.63%) :arrow_down:
...apache/cloudstack/storage/volume/VolumeObject.java 35.75% <0.00%> (-2.61%) :arrow_down:
...vm/resource/wrapper/LibvirtStopCommandWrapper.java 42.66% <0.00%> (-1.78%) :arrow_down:
.../main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java 27.34% <0.00%> (-0.74%) :arrow_down:
...torage/allocator/AbstractStoragePoolAllocator.java 9.03% <0.00%> (-0.66%) :arrow_down:
... and 73 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 19 '22 23:09 codecov[bot]

@blueorangutan package

GutoVeronezi avatar Sep 20 '22 11:09 GutoVeronezi

@GutoVeronezi a 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 Sep 20 '22 11:09 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 4222

blueorangutan avatar Sep 20 '22 12:09 blueorangutan

@blueorangutan test

DaanHoogland avatar Sep 20 '22 14:09 DaanHoogland

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

blueorangutan avatar Sep 20 '22 14:09 blueorangutan

Trillian Build Failed (tid-4936)

blueorangutan avatar Sep 20 '22 14:09 blueorangutan

Trillian Build Failed (tid-4937)

blueorangutan avatar Sep 20 '22 14:09 blueorangutan

@blueorangutan package

DaanHoogland avatar Sep 21 '22 09:09 DaanHoogland

@DaanHoogland a 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 Sep 21 '22 09:09 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 4232

blueorangutan avatar Sep 21 '22 10:09 blueorangutan

@blueorangutan test matrix

DaanHoogland avatar Sep 21 '22 10:09 DaanHoogland

@DaanHoogland a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

blueorangutan avatar Sep 21 '22 10:09 blueorangutan

Trillian Build Failed (tid-4950)

blueorangutan avatar Sep 21 '22 10:09 blueorangutan

Trillian Build Failed (tid-4951)

blueorangutan avatar Sep 21 '22 10:09 blueorangutan

Trillian Build Failed (tid-4952)

blueorangutan avatar Sep 21 '22 10:09 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Sep 30 '22 23:09 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Sep 30 '22 23:09 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Sep 30 '22 23:09 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Sep 30 '22 23:09 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Sep 30 '22 23:09 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Sep 30 '22 23:09 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6751 (SL-JID-2451)

blueorangutan avatar Sep 30 '22 23:09 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6751 (SL-JID-2452)

blueorangutan avatar Sep 30 '22 23:09 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6751 (SL-JID-2453)

blueorangutan avatar Sep 30 '22 23:09 blueorangutan

@blueorangutan package

DaanHoogland avatar Oct 02 '22 15:10 DaanHoogland

@DaanHoogland a 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 Oct 02 '22 15:10 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 4331

blueorangutan avatar Oct 02 '22 15:10 blueorangutan

@blueorangutan package

DaanHoogland avatar Oct 03 '22 12:10 DaanHoogland