Skip to content

Conversation

@DaanHoogland
Copy link
Contributor

Description

This PR...

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
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

Copy link
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 represents a forward merge from version 4.22, containing multiple enhancements and refactoring across UI components, server-side logic, and testing infrastructure.

Key Changes:

  • Enhanced VPN management UI with IP range specification and improved modal flow
  • Refactored NIC management with better form structure and tooltips
  • Optimized DRS (Dynamic Resource Scheduling) with affinity constraints and performance improvements
  • Improved database upgrade checker with standalone/cluster detection
  • Refactored storage pool maintenance handling for better code organization

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ui/src/views/network/VpnDetails.vue Added IP range specification for VPN and reorganized enable/disable flow
ui/src/views/network/NicsTab.vue Converted to vertical form layout with tooltips and added MAC address field
ui/src/views/infra/network/IpRangesTabPublic.vue Added isolation method selection (VLAN/VXLAN) for public IP ranges
ui/src/views/iam/EditAccount.vue Added validation to prevent role changes for default accounts
ui/public/locales/en.json Added localization strings for VPN IP range and isolation method
server/.../ClusterDrsServiceImpl.java Major refactoring to optimize DRS with caching and affinity constraints
server/.../AccountManagerImpl.java Added check to prevent role modification for default accounts
server/.../StoragePoolAutomationImpl.java Refactored maintenance logic into smaller, more focused methods
server/.../ManagementServerImpl.java Split host migration logic into separate phases (compatibility, affinity, capacity)
engine/.../DatabaseUpgradeChecker.java Added standalone detection to prevent clustered upgrades
plugins/drs/cluster/.../Balanced.java Updated to use optimized imbalance calculation
plugins/drs/cluster/.../Condensed.java Updated to use optimized imbalance calculation
api/.../ClusterDrsAlgorithm.java Added optimized methods with pre-calculated metrics arrays

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 100 to 101
</div>
<div v-else>
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

There is a duplicate closing div tag followed by a v-else that seems to be orphaned. Line 100 has a closing </div> tag, and line 101 has another closing </div> with v-else attribute. This v-else appears misplaced as it's on a closing tag rather than an opening tag. This could cause rendering issues or break the component's template structure.

Copilot uses AI. Check for mistakes.
</template>
<a-input
:placeholder="addNetworkData.apiParams.ipaddress.description"
v-model:value="addNetworkData.ipaddress" />
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The variable name changed from ip to ipaddress but this inconsistency with the previous usage suggests this could be incomplete. The field is named ip in the data structure on line 364, but the v-model binds to addNetworkData.ipaddress on line 120. This mismatch will cause the IP address value not to be properly stored or cleared.

Suggested change
v-model:value="addNetworkData.ipaddress" />
v-model:value="addNetworkData.ip" />

Copilot uses AI. Check for mistakes.
:filterOption="(input, option) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}" >
<a-select-option value="">{{ }}</a-select-option>
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The empty string value for the first select option will display as blank, making it unclear to users what this option represents. Consider adding a meaningful label like "Default" or "None" to improve user experience.

Copilot uses AI. Check for mistakes.
*/
private static void checkHierarchyForPreparingForMaintenance(StoragePoolVO pool, List<StoragePoolVO> storagePools) {
for (StoragePoolVO storagePool : storagePools) {
if (!(storagePool.getParent().equals(pool.getParent()) || !pool.getParent().equals(storagePool.getId())) &&
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The logic for checking hierarchy in PrepareForMaintenance mode appears inverted. The condition !(storagePool.getParent().equals(pool.getParent()) || !pool.getParent().equals(storagePool.getId())) uses double negation which is confusing. The expression !(A || !B) is equivalent to !A && B by De Morgan's law, but this doesn't clearly express the intended logic. This should be simplified for clarity and correctness.

Suggested change
if (!(storagePool.getParent().equals(pool.getParent()) || !pool.getParent().equals(storagePool.getId())) &&
if (!storagePool.getParent().equals(pool.getParent()) && pool.getParent().equals(storagePool.getId()) &&

Copilot uses AI. Check for mistakes.
Comment on lines 414 to 415
hostVmMap.get(vm.getHostId()).remove(vm);
hostVmMap.get(destHost.getId()).add(vm);
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The duplicate lines 414-415 suggest an incomplete merge. Line 414 and 415 both perform the same operation: removing vm from source host and adding to destination host. One of these duplicate blocks should be removed.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 37.03704% with 289 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.58%. Comparing base (0a13fb2) to head (644948b).

Files with missing lines Patch % Lines
...a/com/cloud/storage/StoragePoolAutomationImpl.java 0.00% 155 Missing ⚠️
...ache/cloudstack/cluster/ClusterDrsServiceImpl.java 70.58% 29 Missing and 11 partials ⚠️
...in/java/com/cloud/server/ManagementServerImpl.java 0.00% 39 Missing ⚠️
...java/com/cloud/upgrade/DatabaseUpgradeChecker.java 56.14% 22 Missing and 3 partials ⚠️
...apache/cloudstack/cluster/ClusterDrsAlgorithm.java 58.82% 12 Missing and 9 partials ⚠️
.../java/org/apache/cloudstack/cluster/Condensed.java 62.50% 2 Missing and 1 partial ⚠️
...n/java/org/apache/cloudstack/cluster/Balanced.java 71.42% 1 Missing and 1 partial ⚠️
...c/main/java/com/cloud/user/AccountManagerImpl.java 50.00% 1 Missing and 1 partial ⚠️
...min/network/CreateManagementNetworkIpRangeCmd.java 0.00% 1 Missing ⚠️
...k/api/command/admin/vlan/CreateVlanIpRangeCmd.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #12261      +/-   ##
============================================
+ Coverage     17.55%   17.58%   +0.02%     
- Complexity    15544    15575      +31     
============================================
  Files          5910     5910              
  Lines        529162   529372     +210     
  Branches      64641    64668      +27     
============================================
+ Hits          92918    93093     +175     
- Misses       425786   425796      +10     
- Partials      10458    10483      +25     
Flag Coverage Δ
uitests 3.58% <ø> (-0.01%) ⬇️
unittests 18.65% <37.03%> (+0.02%) ⬆️

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.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
23.7% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube Cloud

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.

4 participants