Skip to content

Improves the network offering creation form#12951

Open
Tonitzpp wants to merge 1 commit intoapache:mainfrom
scclouds:additions-to-network-offering
Open

Improves the network offering creation form#12951
Tonitzpp wants to merge 1 commit intoapache:mainfrom
scclouds:additions-to-network-offering

Conversation

@Tonitzpp
Copy link
Copy Markdown
Contributor

@Tonitzpp Tonitzpp commented Apr 2, 2026

Description

Currently, when creating a new network offering through the CloudStack graphical interface it is not possible to specify the specifyipranges parameter. Furthermore, the default value of the egressdefaultpolicy field is DENY, while the API's default is ALLOW.

This PR made modifications to add the specifyipranges field to the form and change the default value of egressdefaultpolicy.

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

Screenshots (if appropriate):

How Has This Been Tested?

In the CloudStack graphical interface, I opened the create new network offering form and checked the new specifyipranges parameter was only in the Isolated guest type and checked that the default value of egressdefaultpolicy is now Allow. After creating the new network offering, I created a new network and it was observed in the form that the fields to specify the IPs ranges were present.

@bernardodemarco
Copy link
Copy Markdown
Member

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@bernardodemarco a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.00%. Comparing base (9cc6c09) to head (34f055d).
⚠️ Report is 52 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12951      +/-   ##
============================================
+ Coverage     17.93%   18.00%   +0.07%     
- Complexity    16159    16458     +299     
============================================
  Files          5939     5977      +38     
  Lines        533147   537728    +4581     
  Branches      65237    66026     +789     
============================================
+ Hits          95601    96817    +1216     
- Misses       426804   429993    +3189     
- Partials      10742    10918     +176     
Flag Coverage Δ
uitests 3.52% <ø> (-0.14%) ⬇️
unittests 19.17% <ø> (+0.12%) ⬆️

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

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12951 (QA-JID-904)

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 enhances the CloudStack UI network offering creation flow by exposing the specifyipranges API parameter in the form (for isolated guest networks) and aligning the UI default for egressdefaultpolicy with the API default (ALLOW).

Changes:

  • Added a specifyipranges switch to the “Add Network Offering” form for isolated guest type offerings.
  • Updated the form’s default egressdefaultpolicy value from deny to allow.
  • Ensured specifyipranges is passed in request params where applicable and removed for L2 offerings.

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

Comment on lines +114 to +124
<a-row :gutter="12">
<a-col :md="12" :lg="12">
<a-form-item name="specifyipranges" ref="specifyipranges" v-if="guestType === 'isolated'">
<template #label>
<tooltip-label :title="$t('label.specifyipranges')" :tooltip="apiParams.specifyipranges.description"/>
</template>
<a-switch v-model:checked="form.specifyipranges" />
</a-form-item>
</a-col>
<a-col :md="12" :lg="12">
</a-col>
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The new specifyipranges row includes an empty <a-col> (md/lg=12) which adds unnecessary markup and can make the layout harder to maintain. Consider removing the empty column or changing the layout to a single full-width column for this row.

Copilot uses AI. Check for mistakes.
Comment on lines 1142 to +1147
if (values.specifyvlan === true) {
params.specifyvlan = true
}

params.specifyipranges = values.specifyipranges

Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

specifyipranges will already be added to params by the generic keys.forEach loop (it’s not in ignoredKeys and boolean false passes the null/undefined checks). The additional params.specifyipranges = values.specifyipranges assignment in the isolated branch is therefore redundant; consider either adding specifyipranges to ignoredKeys and handling it only in the guest-type branches, or removing this extra assignment to avoid duplicate logic.

Copilot uses AI. Check for mistakes.
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.

5 participants