Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enhance VPC Network Tier form to auto-populate Gateway, and Netmask #10617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 28, 2025

Conversation

Imvedansh
Copy link
Contributor

Description

This PR fixes a UX gap in the VPC Network Tier (Add Network) form, where the parent VPC CIDR was not visible or accessible during subnet configuration. Previously, users had to manually close the form, navigate back to the VPC details, copy the CIDR, and then reopen the form to paste the correct subnet range.

With this PR:

  • The Add Network form now auto-fills:

  • Gateway: Based on CIDR

  • Netmask: Based on CIDR

  • This eliminates context switching, reduces input errors, and improves workflow efficiency.

Expected behavior (after fix):

When creating a new network tier inside a VPC, the form automatically suggests a valid (CIDR) gateway, and netmask within the VPC's CIDR block.
This Fixes : #10615

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):

Screenshot 2025-03-25 at 5 11 46 PM
Screenshot 2025-03-25 at 5 16 38 PM

How Has This Been Tested?

  • Verified by creating a new VPC with a /16 CIDR block.

  • Used the Add Network form under the created VPC.

  • Confirmed that the form auto-fills a /24 subnet, valid gateway, and netmask.

  • Ensured the inputs reflect valid and usable values within the VPC CIDR.

  • Checked that manual override is still possible.

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

-Tried editing the auto-filled values to invalid CIDRs → proper validation triggers.

-Created multiple network tiers to ensure no collisions and clean suggestions.

@Imvedansh
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member

@Imvedansh
are the VPC startip/netmask displayed in the form ? it might mislead users.

it is good idea to display VPC cidr in the form.
I think you can add it in the placeholder of a-input, e.g
image
(for both gateway and netmask)

@Imvedansh
Copy link
Contributor Author

@weizhouapache Yes,
I agree, it could be misleading for new users.
it looks somewhat like this after changes,
What do u think?about this
Screenshot 2025-03-26 at 2 01 28 AM

placeholder will suggest according as per super CIDR

@Imvedansh
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@DaanHoogland DaanHoogland linked an issue Mar 26, 2025 that may be closed by this pull request
@DaanHoogland DaanHoogland added this to the 4.19.3 milestone Mar 26, 2025
Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.89%. Comparing base (95c2481) to head (60acacf).
Report is 12 commits behind head on 4.19.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #10617      +/-   ##
============================================
+ Coverage     15.16%   15.89%   +0.73%     
- Complexity    11326    11331       +5     
============================================
  Files          5414     5046     -368     
  Lines        474804   445155   -29649     
  Branches      57909    52704    -5205     
============================================
- Hits          72002    70756    -1246     
+ Misses       394749   366490   -28259     
+ Partials       8053     7909     -144     
Flag Coverage Δ
uitests ?
unittests 15.89% <ø> (+<0.01%) ⬆️

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.

@Imvedansh
Copy link
Contributor Author

@weizhouapache is this good to go?

@weizhouapache
Copy link
Member

@weizhouapache is this good to go?

I suggest to change "Your current" which is unclear.

others look good

@Imvedansh
Copy link
Contributor Author

Imvedansh commented Mar 26, 2025

@weizhouapache ,Replacing it with "For example", It will suggest netmask as per CIDR notation of VPC

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

Copy link
Collaborator

@bernardodemarco bernardodemarco left a comment

Choose a reason for hiding this comment

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

@Imvedansh, nice work, overall looks good. Here are some minor suggestions

}

const cidrValue = `${address}/${maskBits}`
const netmask = subnetMasks[prefix] || '255.255.255.0'
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about abstracting this process of retrieving a CIDR's netmask into an utility function? Maybe, we could place it inside the ui/src/utils folder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had considered abstracting this logic, as the use of subnetMask list felt out of place in that context.
Sure , will do now

32: '255.255.255.255'
}

const cidrValue = `${address}/${maskBits}`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it necessary to define this cidrValue here? It'll contain the same value as the cidr variable has, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, I was automating the input of the Gateway and Netmask fields. In that case, the Gateway needed to be the network address, and the Subnet Mask had to be derived from the prefix.
Thanks for pointing it out , will clear it out

@bernardodemarco
Copy link
Collaborator

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@Imvedansh
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

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

Copy link
Collaborator

@bernardodemarco bernardodemarco left a comment

Choose a reason for hiding this comment

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

lgtm. tested in the QA environment

@blueorangutan
Copy link

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

Co-authored-by: Bernardo De Marco Gonçalves <[email protected]>
Copy link
Contributor

@Pearl1594 Pearl1594 left a comment

Choose a reason for hiding this comment

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

LGTM. tested on QA env. Thanks @Imvedansh.

@weizhouapache
Copy link
Member

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

@weizhouapache weizhouapache merged commit ee94ae5 into apache:4.19 Mar 28, 2025
26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in ACS 4.20.1 Mar 28, 2025
DaanHoogland pushed a commit that referenced this pull request Apr 9, 2025
* 4.20:
  xenserver: do not destroy halted hypervisor vm (#9175)
  define the limit of projects through the UI (#10652)
  fix projects metrics on dashboard (#10651)
  systemvm: Bump systemvm template version to debian 12.10 (#10628)
  Enhance VPC Network Tier form to auto-populate  Gateway, and Netmask (#10617)
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

VPC CIDR Not Shown While Creating Network Tier
7 participants