Skip to content

Fixed and enhanced vlan field validation in the UI #10983

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erikbocks
Copy link
Contributor

Description

This PR fixes and enhances the validation of the values inserted in the VLAN/VNI field when configuring a new zone. Currently, it only checks if any of the fields are empty and if the range start value is greater than the range end value. Thus, it is possible to insert invalid values, as negatives.

With the PR changes, now the field validates if: any of the values is negative, any of the fields is empty or if the inserted values are inside the isolation method max and min values. The maximum and minimum values are now defined based on the selected isolation method (isolation method limits used can be find in the NetworkServiceImpl class). This PR also fixes a minor graphical issue, where the field displayed a red check icon, instead of a red error icon.

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

Before the changes:
image

After the changes:
image

How Has This Been Tested?

  1. Simulated the creation of a new zone, then validated the fix with the following tests:
VLAN
Test Start End Valid
Empty Null Null False
Negative value -10 100 False
Equal 100 100 False
Start > End 100 10 False
End > Limit 1 4096 False
Start < Limit 0 100 False
Valid 1 100 True
VXLAN
Test Start End Valid
Empty Null Null False
Negative value -4090 4100 False
Equal 4096 4096 False
Start > End 4100 4096 False
End > Limit 4096 16777215 False
Start < Limit 4095 4100 False
Valid 4096 4100 True
GRE
Test Start End Valid
Empty Null Null False
Negative value -10 100 False
Equal 100 100 False
Start > End 100 99 False
End > Limit 1 4294967296 False
Start < Limit -1 100 False
Valid 1 4000 True

@DaanHoogland
Copy link
Contributor

@blueorangutan ui

@blueorangutan
Copy link

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

Copy link

codecov bot commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.57%. Comparing base (7632814) to head (67ead53).
Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10983      +/-   ##
============================================
- Coverage     16.57%   16.57%   -0.01%     
- Complexity    13868    13869       +1     
============================================
  Files          5719     5719              
  Lines        507178   507210      +32     
  Branches      61571    61574       +3     
============================================
+ Hits          84085    84087       +2     
- Misses       413674   413704      +30     
  Partials       9419     9419              
Flag Coverage Δ
uitests 3.96% <ø> (-0.01%) ⬇️
unittests 17.45% <ø> (-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.

@blueorangutan
Copy link

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

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.

3 participants