Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12779 +/- ##
============================================
+ Coverage 17.60% 17.62% +0.02%
- Complexity 15671 15742 +71
============================================
Files 5917 5918 +1
Lines 531647 532040 +393
Branches 65000 65132 +132
============================================
+ Hits 93595 93775 +180
- Misses 427494 427704 +210
- Partials 10558 10561 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR cleans up static analysis warnings in UserVmManagerImpl and related files, including the service interface and a template interface. The changes address issues like raw types, unnecessary casts, unused variables, inefficient null checks, and missing throw keywords.
Changes:
- Removed unused imports, fields (
statsCollector,vmScheduleManager), unused constants (MAX_HTTP_GET_LENGTH, etc.), and dead code (unused constructors/methods inVmAndCountDetails,getName(),getRandomPrivateTemplateName()) - Simplified conditionals: replaced
== null ? false : valuewith directBoolean.parseBoolean, replaced!list.stream().anyMatch(...)withlist.stream().noneMatch(...), replacedsize() > 0with!isEmpty(), etc. - Fixed multiple bugs: missing
throwforInvalidParameterValueExceptionat validation, NPE in error messages using null objects' methods, removedcallerparameter from methods where it was unused, improved method signatures to remove unchecked exceptions
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java |
Major cleanup: remove unused imports/fields/methods, fix bugs (missing throw, null NPE in error messages), simplify conditionals/collections usage |
server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java |
Update test method calls to match new method signatures (removed caller parameters, replaced 1l with 1L) |
api/src/main/java/com/cloud/vm/UserVmService.java |
Remove StorageUnavailableException from method signatures, remove redundant public modifier from interface method |
api/src/main/java/com/cloud/template/VirtualMachineTemplate.java |
Add generic type parameter to getDetails() return type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17071 |
| } catch (CloudException e) { | ||
| throw new CloudRuntimeException("Unable to contact the agent to stop the Instance " + vm, e); | ||
| } | ||
| return status; | ||
| } | ||
|
|
||
| private UserVm rebootVirtualMachine(long userId, long vmId, boolean enterSetup, boolean forced) throws InsufficientCapacityException, ResourceUnavailableException { | ||
| private UserVm rebootVirtualMachine(long vmId, boolean enterSetup, boolean forced) throws InsufficientCapacityException, ResourceUnavailableException { |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15595)
|
|
@sureshanaparti can you have a look as well, please? |
Co-authored-by: Abhisar Sinha <63767682+abh1sar@users.noreply.github.com> Co-authored-by: dahn <daan.hoogland@gmail.com>
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Co-authored-by: Abhisar Sinha <63767682+abh1sar@users.noreply.github.com>
|
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17289 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15774)
|


Description
This PR cleans static analysis warnings from UserVmManagerImpl and some in dependencies.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?