Skip to content

Conversation

@Pearl1594
Copy link
Contributor

Description

This PR fixes: #11405

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?

Screenshot from 2025-08-18 15-47-17 Screenshot from 2025-08-18 15-46-57

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

@codecov
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.06%. Comparing base (f2d6356) to head (27408f7).
⚠️ Report is 161 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11465      +/-   ##
============================================
+ Coverage     17.35%   18.06%   +0.70%     
- Complexity    15230    16883    +1653     
============================================
  Files          5886     5900      +14     
  Lines        525685   563597   +37912     
  Branches      64159    79424   +15265     
============================================
+ Hits          91247   101791   +10544     
- Misses       424138   450712   +26574     
- Partials      10300    11094     +794     
Flag Coverage Δ
uitests 3.93% <ø> (+0.30%) ⬆️
unittests 19.11% <ø> (+0.71%) ⬆️

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

@DaanHoogland
Copy link
Contributor

@Pearl1594 , can you have a look?

@sonarqubecloud
Copy link

@shwstppr
Copy link
Contributor

@blueorangutan ui

@blueorangutan
Copy link

@shwstppr 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/11465 (QA-JID-777)

Copy link
Contributor

@shwstppr shwstppr 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 server

@rosi-shapeblue rosi-shapeblue self-assigned this Oct 12, 2025
@rosi-shapeblue
Copy link
Collaborator

@blueorangutan package

@blueorangutan
Copy link

@rosi-shapeblue a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

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

@vishesh92 vishesh92 requested a review from Copilot October 13, 2025 06:16
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 adds CIDR format validation for the VPC creation form to prevent invalid CIDR values from being submitted. The validation ensures proper IPv4 CIDR format and valid octet ranges (0-255).

Key Changes:

  • Added a new isValidIPv4Cidr validator function that validates CIDR format and IP octet ranges
  • Integrated the validator into the VPC creation form's validation rules

Reviewed Changes

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

File Description
ui/src/utils/util.js Implements the isValidIPv4Cidr validator function with regex pattern matching and octet validation
ui/src/views/network/CreateVpc.vue Imports and applies the CIDR validator to the form's validation rules

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

lgtm. did some testing with different inputs and it seems to be working as expected.

Copy link
Collaborator

@rosi-shapeblue rosi-shapeblue left a comment

Choose a reason for hiding this comment

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

LGTM. The CIDR validator works as expected

UI Test Results:

Screencast.from.2025-10-13.09-48-11.webm
Screenshot from 2025-10-13 09-53-47

API Test Results:

image
(localcloud) 🐱 > list vpcs 
{
  "count": 2,
  "vpc": [
    {
      "account": "admin",
      "cidr": "10.10.10.10/24",
      "created": "2025-10-13T07:01:44+0000",
      "displaytext": "TestVPC",
      "distributedvpcrouter": false,
      "domain": "ROOT",
      "domainid": "797d5086-a795-11f0-8a1f-1e0082000199",
      "domainpath": "ROOT",
      "fordisplay": true,
      "hasannotations": false,
      "id": "55231568-6c61-4f36-8977-c4c56d7af900",
      "name": "TestVPC",
      "network": [],
      "networkdomain": "cs2cloud.internal",
      "publicmtu": 1500,
      "redundantvpcrouter": false,
      "regionlevelvpc": false,
      "restartrequired": false,
      "service": [
        {
          "name": "Vpn",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "Lb",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            },
            {
              "name": "InternalLbVm"
            }
          ]
        },
        {
          "name": "UserData",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "Dhcp",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "PortForwarding",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "NetworkACL",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "StaticNat",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "Dns",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "SourceNat",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        }
      ],
      "state": "Enabled",
      "tags": [],
      "vpcofferingid": "7bb6732a-8e44-4576-8815-dcdd350bcbad",
      "vpcofferingname": "Default VPC offering",
      "zoneid": "fb812556-cf86-4a36-899f-0611e17ae8e7",
      "zonename": "ref-trl-9661-k-Mol8-rositsa-kyuchukova"
    },
    {
      "account": "admin",
      "cidr": "10.0.0.0/16",
      "created": "2025-10-13T06:48:31+0000",
      "displaytext": "test",
      "distributedvpcrouter": false,
      "domain": "ROOT",
      "domainid": "797d5086-a795-11f0-8a1f-1e0082000199",
      "domainpath": "ROOT",
      "fordisplay": true,
      "hasannotations": false,
      "id": "a537d7f3-1b6a-4880-825e-8db4d8a94d66",
      "name": "Test",
      "network": [],
      "networkdomain": "cs2cloud.internal",
      "publicmtu": 1500,
      "redundantvpcrouter": false,
      "regionlevelvpc": false,
      "restartrequired": false,
      "service": [
        {
          "name": "Vpn",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "Lb",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            },
            {
              "name": "InternalLbVm"
            }
          ]
        },
        {
          "name": "UserData",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "Dhcp",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "PortForwarding",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "NetworkACL",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "StaticNat",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "Dns",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        },
        {
          "name": "SourceNat",
          "provider": [
            {
              "name": "VpcVirtualRouter"
            }
          ]
        }
      ],
      "state": "Enabled",
      "tags": [],
      "vpcofferingid": "7bb6732a-8e44-4576-8815-dcdd350bcbad",
      "vpcofferingname": "Default VPC offering",
      "zoneid": "fb812556-cf86-4a36-899f-0611e17ae8e7",
      "zonename": "ref-trl-9661-k-Mol8-rositsa-kyuchukova"
    }
  ]
}

image

@DaanHoogland DaanHoogland merged commit 0e93ae3 into main Oct 13, 2025
50 of 52 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.22.0 Oct 13, 2025
@DaanHoogland DaanHoogland deleted the add-cidr-check branch October 13, 2025 09:18
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Have the placeholders or the tooltip display default formats of fields.

7 participants