Remove the 'externalId' parameter when creating networks#13287
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the unused externalId network creation parameter from the create network API/UI path and updates related service/orchestration method signatures and tests.
Changes:
- Removes
externalIdinputs from isolated network and VPC tier creation forms. - Removes
externalIdfromCreateNetworkCmd,Network,NetworkProfile, andNetworkVO. - Updates network creation call sites, interfaces, mocks, and tests to match the revised signatures.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
ui/src/views/network/VpcTiersTab.vue |
Removes external ID field and API submission parameter for VPC tiers. |
ui/src/views/network/CreateIsolatedNetworkForm.vue |
Removes external ID field and parameter forwarding for isolated networks. |
api/src/main/java/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java |
Removes createNetwork externalid API parameter/getter. |
api/src/test/java/org/apache/cloudstack/api/command/user/network/CreateNetworkCmdTest.java |
Removes test coverage for the deleted getter. |
api/src/main/java/com/cloud/network/Network.java |
Removes external ID from the network interface. |
api/src/main/java/com/cloud/network/NetworkProfile.java |
Removes external ID profile storage/access. |
engine/schema/src/main/java/com/cloud/network/dao/NetworkVO.java |
Removes external ID persistence mapping and constructor plumbing. |
engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java |
Updates network orchestration service signature. |
engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java |
Updates VPC guest network creation signature. |
engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java |
Updates network creation implementation and call sites. |
server/src/main/java/com/cloud/network/NetworkServiceImpl.java |
Removes external ID flow through network creation/commit logic. |
server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java |
Removes external ID from VPC tier creation flow. |
server/src/main/java/com/cloud/api/ApiResponseHelper.java |
Stops populating network response external ID. |
server/src/main/java/com/cloud/network/IpAddressManagerImpl.java |
Updates default network creation call signature. |
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java |
Updates default/applicable network creation call signatures. |
server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java |
Updates unmanaged VM default network creation call signature. |
server/src/test/java/com/cloud/vpc/MockNetworkManagerImpl.java |
Updates mock manager signature. |
server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java |
Updates Mockito matcher count for revised signature. |
server/src/test/java/com/cloud/network/vpc/VpcManagerImplTest.java |
Updates VPC network creation expectations. |
server/src/test/java/com/cloud/network/NetworkServiceImplTest.java |
Updates network service tests and mocks for revised signatures. |
server/src/test/java/com/cloud/network/CreatePrivateNetworkTest.java |
Updates mock expectation for revised signature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| null, null, null, null, null, null); | ||
| bypassVlanOverlapCheck, null, owner, null, pNtwk, pNtwk.getDataCenterId(), | ||
| ACLType.Account, null, vpcId, null, null, true, null, null, | ||
| null, null, null, null, null, null, null, null); |
| null, null, null, false, null, owner, null, physicalNetwork, zoneId, | ||
| aclType, null, null, null, null, true, null, | ||
| null, null, null, null, null, null, null, null, vrIfaceMTUs, null); | ||
| null, null, null, null, null, null, null, null, null); |
| Mockito.verify(vpcMgr, times(1)).createVpcGuestNetwork(networkOfferingId, "Vpc 1 -- testNetwork", "Test Network", null, null, | ||
| null, null, accountMock, null, phyNet, zoneId, null, null, vpcId, null, accountMock, true, | ||
| null, null, null, null, null, null, null, new Pair<>(0, privateMtu), null); | ||
| null, null, null, null, null, null, null, null); |
| @@ -2805,7 +2805,6 @@ public NetworkResponse createNetworkResponse(ResponseView view, Network network) | |||
| } | |||
| response.setNetworkSpannedZones(networkSpannedZones); | |||
| } | |||
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #13287 +/- ##
=============================================
- Coverage 17.67% 3.69% -13.98%
=============================================
Files 5922 448 -5474
Lines 533165 38105 -495060
Branches 65208 7059 -58149
=============================================
- Hits 94242 1409 -92833
+ Misses 428276 36509 -391767
+ Partials 10647 187 -10460
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:
|
Description
The
externalIdparameter of thecreateNetworkAPI was initially introduced to add support for networks managed by Nuage in Apache CloudStack. Nuage was a network plugin that was supported by ACS, but the support was discontinued in 2019 (see #3622) and the parameter was left unused.Therefore, this PR removes the
externalIdparameter increateNetworkAPI and in the UI.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
To perform the testes, I opened the
createNetworkform in GUI and checked that theexternalIdparameter isn't present in the form anymore. Via CMK, I checked that theexternalIdparameter isn't present in thecreateNetworkAPI too. Then, I created a new Network and created a new VM with it. No problems have been found in the process.