Skip to content

Add access modifiers to VirtualMachineTO#9277

Merged
DaanHoogland merged 5 commits intoapache:mainfrom
scclouds:add-private-keyword-to-vmTO
Jun 17, 2025
Merged

Add access modifiers to VirtualMachineTO#9277
DaanHoogland merged 5 commits intoapache:mainfrom
scclouds:add-private-keyword-to-vmTO

Conversation

@FelipeM525
Copy link
Copy Markdown
Contributor

Description

The class VirtualMachineTO lacks access modifiers in its fields. This PR aims to improve adherence to object-oriented programming by adding private access modifiers to all fields in the class mentioned above, along with their respective getters and setters.

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)
  • build/CI

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

I ran all the tests related to VirtualMachineTO, checked all usages of the class, and made sure nothing was broken.

Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
@JoaoJandre
Copy link
Copy Markdown
Contributor

@FelipeM525 there are some test failures

@github-actions
Copy link
Copy Markdown

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

@sureshanaparti sureshanaparti added this to the 4.21.0 milestone Jun 5, 2025
@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan package

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves encapsulation in the VirtualMachineTO class by adding private access modifiers to previously package-private fields and introducing corresponding getters and setters.

  • Changed field visibility to private.
  • Added new accessor and mutator methods for improved object-oriented design.
  • Ensured backward compatibility with existing functionality.
Comments suppressed due to low confidence (2)

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java:257

  • [nitpick] Consider renaming isEnableHA() to isHaEnabled() to better align with Java naming conventions for boolean getters.
public boolean isEnableHA() {

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java:440

  • Consider adding JavaDoc comments to the newly added getters and setters to improve code clarity and maintainability.
public void setSpeed(Integer speed) {

@blueorangutan
Copy link
Copy Markdown

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

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13629

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13722

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13739

@DaanHoogland
Copy link
Copy Markdown
Contributor

@winterhazel , can you assess the status of this PR , please?

@winterhazel
Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

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

@winterhazel
Copy link
Copy Markdown
Member

@winterhazel , can you assess the status of this PR , please?

@DaanHoogland I fixed the merge conflicts, it should be good to go if the CI passses. I don't think we need more testing for a simple change like this one.

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 23.07692% with 30 lines in your changes missing coverage. Please review.

Project coverage is 16.60%. Comparing base (e83a347) to head (f3cb29c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../java/com/cloud/agent/api/to/VirtualMachineTO.java 23.07% 30 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9277      +/-   ##
============================================
- Coverage     16.60%   16.60%   -0.01%     
- Complexity    13923    13924       +1     
============================================
  Files          5730     5730              
  Lines        508224   508254      +30     
  Branches      61789    61789              
============================================
- Hits          84383    84382       -1     
- Misses       414406   414436      +30     
- Partials       9435     9436       +1     
Flag Coverage Δ
uitests 3.93% <ø> (ø)
unittests 17.49% <23.07%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link
Copy Markdown

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

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-13532)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 57953 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9277-t13532-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

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 f8c4121 into apache:main Jun 17, 2025
26 checks passed
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants