cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Improving code related to the Agent properties

Open paulazomig opened this issue 3 years ago • 61 comments

Description

The classes AgentProperties and AgentPropertiesFileHandler were previously created to map the existing properties of the agent.properties file to facilitate their use; however, only a few properties were mapped at the time.

This PR aims to build on those changes. All of the properties of the agent.properties file were mapped in the AgentProperties class. While executing the mapping, I found some properties that were used in the code, but were not documented in the "agent.properties" file. These properties were also documented, and registered accordingly in the properties file.

The way the properties were accessed in the code was changed, and now the values are obtained through the AgentPropertiesFileHandler class. Also, Unit Tests were added and modified according to necessity.

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • [x] Major
  • [ ] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [ ] Minor
  • [ ] Trivial

Screenshots (if appropriate):

How Has This Been Tested?

This was manually tested in a local lab, by altering properties and performing main actions: creating and deleting VMs, creating new Volumes and snapshots, etc.

paulazomig avatar May 02 '22 19:05 paulazomig

PR Analysis

https://sonarcloud.io/summary/new_code?id=apachecloudstack&pullRequest=6348

PR Coverage Report

CLASS INSTRUCTION MISSED INSTRUCTION COVERED BRANCH MISSED BRANCH COVERED LINE MISSED LINE COVERED
BridgeVifDriver 1116 125 151 17 222 29
IvsVifDriver 812 0 106 0 162 0
LibvirtComputingResource 8573 2026 1026 144 1899 452
OvsVifDriver 643 135 82 12 106 34
KVMStorageProcessor 5982 498 446 22 1236 71

acs-robot avatar May 02 '22 20:05 acs-robot

@paulazomig can you merge the latest main to your PR branch?

rohityadavcloud avatar May 04 '22 06:05 rohityadavcloud

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

github-actions[bot] avatar May 12 '22 12:05 github-actions[bot]

@paulazomig youĺl need to solve a conflict

DaanHoogland avatar May 16 '22 08:05 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 May 23 '22 13:05 github-actions[bot]

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

acs-robot avatar Jun 24 '22 14:06 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 Jun 24 '22 14:06 blueorangutan

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

blueorangutan avatar Jun 24 '22 14:06 blueorangutan

SonarCloud Quality Gate failed. Quality Gate failed

Bug A 0 Bugs Vulnerability A 0 Vulnerabilities Security Hotspot E 1 Security Hotspot Code Smell A 100 Code Smells

20.8% 20.8% Coverage 0.0% 0.0% Duplication

please have a look at these @paulazomig . There are certainly some that can be improved.

DaanHoogland avatar Jun 27 '22 13:06 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 Jun 28 '22 07:06 github-actions[bot]

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

acs-robot avatar Jul 01 '22 14:07 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 Jul 01 '22 14:07 blueorangutan

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

blueorangutan avatar Jul 01 '22 14:07 blueorangutan

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

acs-robot avatar Jul 04 '22 15:07 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 Jul 04 '22 15:07 blueorangutan

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

blueorangutan avatar Jul 04 '22 15:07 blueorangutan

SonarCloud Quality Gate failed. Quality Gate failed

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

20.4% 20.4% Coverage 0.0% 0.0% Duplication

@paulazomig can you go through these ^? most make sense and though some are from before your days in the project they might be little effort for a small improvement making the code more robust.

DaanHoogland avatar Jul 05 '22 08:07 DaanHoogland

SonarCloud Quality Gate failed. Quality Gate failed Bug A 0 Bugs Vulnerability A 0 Vulnerabilities Security Hotspot A 0 Security Hotspots Code Smell A 16 Code Smells 20.4% 20.4% Coverage 0.0% 0.0% Duplication

@paulazomig can you go through these ^? most make sense and though some are from before your days in the project they might be little effort for a small improvement making the code more robust.

@DaanHoogland I will address those code defects/smells as soon as possible.

JoaoJandre avatar Jul 06 '22 14:07 JoaoJandre

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

acs-robot avatar Jul 06 '22 15:07 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 Jul 06 '22 15:07 blueorangutan

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

blueorangutan avatar Jul 06 '22 15:07 blueorangutan

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

acs-robot avatar Jul 06 '22 15:07 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 Jul 06 '22 15:07 blueorangutan

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

blueorangutan avatar Jul 06 '22 15:07 blueorangutan

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

acs-robot avatar Jul 08 '22 16:07 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 Jul 08 '22 16:07 blueorangutan

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

blueorangutan avatar Jul 08 '22 16:07 blueorangutan

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

acs-robot avatar Aug 11 '22 19:08 acs-robot