Skip to content

Refactor SnapshotDataStoreDaoImpl #6751

Merged
DaanHoogland merged 9 commits intoapache:mainfrom
scclouds:resolve-code-smells-in-SnapshotDataStoreDaoImpl
Oct 11, 2022
Merged

Refactor SnapshotDataStoreDaoImpl #6751
DaanHoogland merged 9 commits intoapache:mainfrom
scclouds:resolve-code-smells-in-SnapshotDataStoreDaoImpl

Conversation

@GutoVeronezi
Copy link
Copy Markdown
Contributor

@GutoVeronezi GutoVeronezi commented Sep 19, 2022

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)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

I created unit tests for the methods.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 19, 2022

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%) ⬆️
...rce/wrapper/LibvirtResizeVolumeCommandWrapper.java 49.50% <0.00%> (-27.17%) ⬇️
.../cloud/hypervisor/kvm/storage/KVMPhysicalDisk.java 70.27% <0.00%> (-10.98%) ⬇️
...pper/LibvirtPrepareForMigrationCommandWrapper.java 43.10% <0.00%> (-10.09%) ⬇️
...loud/hypervisor/kvm/resource/LibvirtSecretDef.java 60.00% <0.00%> (-3.16%) ⬇️
.../hypervisor/kvm/storage/ScaleIOStorageAdaptor.java 10.48% <0.00%> (-2.63%) ⬇️
...apache/cloudstack/storage/volume/VolumeObject.java 35.75% <0.00%> (-2.61%) ⬇️
...vm/resource/wrapper/LibvirtStopCommandWrapper.java 42.66% <0.00%> (-1.78%) ⬇️
.../main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java 27.34% <0.00%> (-0.74%) ⬇️
...torage/allocator/AbstractStoragePoolAllocator.java 9.03% <0.00%> (-0.66%) ⬇️
... and 73 more

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

@GutoVeronezi
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

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

Comment thread framework/db/src/test/java/com/cloud/utils/db/GenericSearchBuilderTest.java Outdated
@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

Trillian Build Failed (tid-4936)

@blueorangutan
Copy link
Copy Markdown

Trillian Build Failed (tid-4937)

GutoVeronezi and others added 2 commits September 20, 2022 12:57
Co-authored-by: dahn <daan.hoogland@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

6.7% 6.7% Coverage
0.0% 0.0% Duplication

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

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

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test matrix

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

Trillian Build Failed (tid-4950)

@blueorangutan
Copy link
Copy Markdown

Trillian Build Failed (tid-4951)

@blueorangutan
Copy link
Copy Markdown

Trillian Build Failed (tid-4952)

@acs-robot
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

@acs-robot
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

@GutoVeronezi GutoVeronezi force-pushed the resolve-code-smells-in-SnapshotDataStoreDaoImpl branch from bc9cf00 to 7972f3f Compare September 30, 2022 23:31
@acs-robot
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

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

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 4343

@GutoVeronezi GutoVeronezi marked this pull request as draft October 3, 2022 14:24
@GutoVeronezi GutoVeronezi marked this pull request as ready for review October 3, 2022 16:03
@GutoVeronezi
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4345

Copy link
Copy Markdown
Contributor

@RodrigoDLopez RodrigoDLopez left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-5081)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 47902 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6751-t5081-kvm-centos7.zip
Smoke tests completed. 102 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_upgrade_kubernetes_cluster Failure 482.17 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 804.75 test_kubernetes_clusters.py

Comment on lines +63 to +64
private SearchBuilder<SnapshotDataStoreVO> searchFilteringStoreIdEqStoreRoleEqStateNeqRefCntNeq;
protected SearchBuilder<SnapshotDataStoreVO> searchFilteringStoreIdEqStateEqStoreRoleEqIdEqUpdateCountEqSnapshotIdEqVolumeIdEq;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

impresive names ;)

Copy link
Copy Markdown
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

@DaanHoogland DaanHoogland merged commit f7b2985 into apache:main Oct 11, 2022
@DaanHoogland DaanHoogland added this to the 4.18.0.0 milestone Oct 11, 2022
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.

5 participants