Skip to content

server: fix clone network offerings with detail internetProtocol=IPv4 - #13615

Merged
winterhazel merged 2 commits into
apache:mainfrom
weizhouapache:4.23-fix-clone-network-offering
Jul 20, 2026
Merged

server: fix clone network offerings with detail internetProtocol=IPv4#13615
winterhazel merged 2 commits into
apache:mainfrom
weizhouapache:4.23-fix-clone-network-offering

Conversation

@weizhouapache

Copy link
Copy Markdown
Member

Description

This PR fixes#13610

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?

CopilotAI review requested due to automatic review settings July 14, 2026 14:17
@weizhouapacheweizhouapache added this to the 4.23.0 milestone Jul 14, 2026
@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 fixes cloning of network offerings when the source offering contains details like internetProtocol=IPv4, which previously could trigger a ClassCastException in NetworkOfferingBaseCmd.getDetails() due to an unexpected details-map structure during clone.

Changes:

  • Stop injecting source offering details into the API details parameter structure during clone; instead, carry them via a dedicated internal sourceDetailsMap.
  • Update NetworkOfferingBaseCmd.getDetails() to fall back to sourceDetailsMap when no API details were provided.
  • Exclude internetProtocol, domainid, and zoneid from the cloned details map (these are handled via dedicated command fields / parameters).

Reviewed changes

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

FileDescription
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.javaAdjusts clone parameter population to avoid mis-shaping details and filters out special-case detail keys.
api/src/main/java/org/apache/cloudstack/api/command/admin/network/NetworkOfferingBaseCmd.javaAdds an internal fallback details map and changes getDetails() to return it when API details are absent.

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

Comment threadserver/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java Outdated
@codecov

codecovBot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.64%. Comparing base (028e1ef) to head (297185e).
⚠️ Report is 1 commits behind head on main.

Files with missing linesPatch %Lines
.../cloud/configuration/ConfigurationManagerImpl.java25.00%3 Missing ⚠️
.../command/admin/network/NetworkOfferingBaseCmd.java0.00%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #13615 +/- ##
=========================================
Coverage 19.64% 19.64% Complexity 19793 19793 =========================================
Files 6368 6368 Lines 575100 575102 +2 Branches 70370 70371 +1 =========================================
+ Hits 113002 113006 +4 
Misses 449815 449815 + Partials 12283 12281 -2 
FlagCoverage Δ
uitests3.41% <ø> (ø)
unittests20.92% <20.00%> (+<0.01%)⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@Pearl1594Pearl1594 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

code lgtm

CopilotAI review requested due to automatic review settings July 14, 2026 14:43
@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment on lines 433 to 436
public Map<String, String> getDetails() {
if (details == null || details.isEmpty()) {
return null;
return sourceDetailsMap;
}
@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

weizhouapacheand others added 2 commits July 14, 2026 17:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings July 14, 2026 15:54
@weizhouapache
weizhouapacheforce-pushed the 4.23-fix-clone-network-offering branch from dbdf6a8 to 297185eCompareJuly 14, 2026 15:54

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment on lines 433 to 436
public Map<String, String> getDetails() {
if (details == null || details.isEmpty()) {
return null;
return sourceDetailsMap;
}

@kiranchavalakiranchavala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Tested manually

Able to clone the network offering and vpc offerings

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@weizhouapache 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-16572)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 53998 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13615-t16572-kvm-ol8.zip
Smoke tests completed. 156 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File

@weizhouapache
weizhouapache marked this pull request as ready for review July 17, 2026 13:20
@winterhazel

Copy link
Copy Markdown
Member

Merging based on manual testing by @kiranchavala and approvals

@winterhazel
winterhazel merged commit 7900b27 into apache:mainJul 20, 2026
26 of 27 checks passed
@DaanHoogland
DaanHoogland deleted the 4.23-fix-clone-network-offering branch July 20, 2026 17:31
Sign up for freeto 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.

Unable to clone a network offering

7 participants

@weizhouapache@blueorangutan@winterhazel@kiranchavala@Pearl1594@DaanHoogland