Skip to content

Conversation

@madhukar93
Copy link
Contributor

@madhukar93 madhukar93 commented Oct 26, 2023

Description

This PR addresses #7837. It adds all fields to Traffic type response that are required while adding traffic type to a physical network using addTrafficType command

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

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

  • added unit test for response creation
  • added marvin test
  • manually tested on simulator with cmk
MySQL root@(none):cloud> update physical_network_traffic_types set vlan="100-200" where physical_network_id=200;

(localcloud) 🐱 > list traffictypes physicalnetworkid=05f91607-18a6-40f5-ac8c-6ee86a052e0e
{
  "count": 4,
  "traffictype": [
    {
      "id": "51821c55-b0d6-49d1-ad3b-da53a90822d4",
      "isolationmethods": "VLAN",
      "physicalnetworkid": "05f91607-18a6-40f5-ac8c-6ee86a052e0e",
      "traffictype": "Guest",
      "vlan": "100-200"
    },
...
  ]
}

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

Nothing besides running test automation

@boring-cyborg
Copy link

boring-cyborg bot commented Oct 26, 2023

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

@madhukar93 madhukar93 marked this pull request as draft October 26, 2023 12:28
@madhukar93 madhukar93 changed the title Fixes:7863: Add isolationMethods and vlan to TrafficTypeResponse Fixes:#7837: Add isolationMethods and vlan to TrafficTypeResponse Oct 26, 2023
@madhukar93 madhukar93 changed the title Fixes:#7837: Add isolationMethods and vlan to TrafficTypeResponse (WIP) Fixes:#7837: Add isolationMethods and vlan to TrafficTypeResponse Oct 26, 2023
@madhukar93 madhukar93 force-pushed the listTrafficType-7863 branch from 1c10c58 to 0b1950b Compare October 26, 2023 13:30
Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

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

left some remarks

@rohityadavcloud
Copy link
Member

@madhukar93 you can also consider to add a unit test and/or a functional test to cover the API response.

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

❌ Patch coverage is 53.33333% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.58%. Comparing base (2dbc86a) to head (c4d1bed).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
...e/cloudstack/api/response/TrafficTypeResponse.java 50.00% 6 Missing ⚠️
...src/main/java/com/cloud/api/ApiResponseHelper.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8151      +/-   ##
============================================
+ Coverage     17.56%   17.58%   +0.01%     
- Complexity    15542    15543       +1     
============================================
  Files          5909     5909              
  Lines        529058   529073      +15     
  Branches      64617    64618       +1     
============================================
+ Hits          92922    93014      +92     
+ Misses       425683   425602      -81     
- Partials      10453    10457       +4     
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.64% <53.33%> (+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.

@madhukar93
Copy link
Contributor Author

madhukar93 commented Oct 27, 2023

@madhukar93 you can also consider to add a unit test and/or a functional test to cover the API response.

will do after clarifying the schema

@madhukar93 madhukar93 force-pushed the listTrafficType-7863 branch 2 times, most recently from 18714f8 to 23d1b77 Compare October 27, 2023 12:39
@madhukar93 madhukar93 marked this pull request as ready for review October 28, 2023 11:18
@madhukar93 madhukar93 changed the title (WIP) Fixes:#7837: Add isolationMethods and vlan to TrafficTypeResponse Fixes:#7837: Add isolationMethods and vlan to TrafficTypeResponse Oct 28, 2023
Copy link
Contributor Author

@madhukar93 madhukar93 left a comment

Choose a reason for hiding this comment

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

@rohityadavcloud There don't seem to be too many functional tests for the cloud-api package to refer. Need suggestions for what the test scenario should be. Just validating the response schema would be very close the what the unit test is already checking.

@harikrishna-patnala
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@harikrishna-patnala 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7562

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

LGTM @madhukar93 can you check if we can add a small marvin test.

@rohityadavcloud
Copy link
Member

@madhukar93 the integration test scenario would to be call the API and check the response against expected values of the API response. When changing the response type, you may need to make changes to Marvin library if a utility is used to call the api and process response; otherwise you would use the API client to make the API call and from its response object you'd get keys/entities to compare. When you rebuilt cloudstack (entirely), apidocs and marvin API stubs will be regenerated (which covers the case of say adding new api param or responses, or changing response type class etc).

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.

looks mostly good, one remark and needs testing

@boring-cyborg boring-cyborg bot added component:integration-test Python Warning... Python code Ahead! labels Nov 4, 2023
@madhukar93 madhukar93 force-pushed the listTrafficType-7863 branch from aa14677 to cbba3d3 Compare November 4, 2023 06:26
@blueorangutan
Copy link

[SF] Trillian test result (tid-8436)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 57136 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8151-t8436-kvm-centos7.zip
Smoke tests completed. 116 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_trigger_shutdown Failure 336.99 test_safe_shutdown.py
test_01_invalid_upgrade_kubernetes_cluster Failure 3606.30 test_kubernetes_clusters.py
test_02_upgrade_kubernetes_cluster Failure 3606.46 test_kubernetes_clusters.py
test_03_deploy_and_scale_kubernetes_cluster Failure 0.04 test_kubernetes_clusters.py
test_04_autoscale_kubernetes_cluster Failure 0.03 test_kubernetes_clusters.py
test_05_basic_lifecycle_kubernetes_cluster Failure 0.03 test_kubernetes_clusters.py
test_06_delete_kubernetes_cluster Failure 0.05 test_kubernetes_clusters.py
test_07_deploy_kubernetes_ha_cluster Failure 0.04 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 0.05 test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_cluster Failure 0.05 test_kubernetes_clusters.py
test_10_vpc_tier_kubernetes_cluster Failure 51.95 test_kubernetes_clusters.py
test_11_test_unmanaged_cluster_lifecycle Error 0.24 test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardown Error 56.69 test_kubernetes_clusters.py
test_hostha_enable_ha_when_host_in_maintenance Error 307.97 test_hostha_kvm.py

@shwstppr
Copy link
Contributor

shwstppr commented Dec 6, 2023

@vishesh92 @harikrishna-patnala @kishankavala are your concerns addressed. Can you please re-review?

@github-actions
Copy link

github-actions bot commented Dec 7, 2023

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@sureshanaparti
Copy link
Contributor

hi @madhukar93 please resolve the conflicts.

@Pearl1594 Pearl1594 mentioned this pull request Oct 21, 2025
14 tasks
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland 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 15581

@DaanHoogland
Copy link
Contributor

@blueorangutan test keepEnv

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-14737)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 63318 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8151-t14737-kvm-ol8.zip
Smoke tests completed. 147 look OK, 1 have errors, 2 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_enableHumanReadableLogs Error 0.36 test_human_readable_logs.py
all_test_image_store_object_migration Skipped --- test_image_store_object_migration.py
all_test_import_unmanage_volumes Skipped --- test_import_unmanage_volumes.py

@DaanHoogland
Copy link
Contributor

(localcloud) 🐱 > list traffictypes physicalnetworkid=30346ff3-00f0-4155-98dd-7ebddfe48d85 
{
  "count": 2,
  "traffictype": [
    {
      "id": "54c84eac-abb9-41b9-8662-89c5081859a2",
      "isolationmethods": "VLAN",
      "kvmnetworklabel": "cloudbr1",
      "physicalnetworkid": "30346ff3-00f0-4155-98dd-7ebddfe48d85",
      "traffictype": "Guest",
      "vmwarenetworklabel": "vSwitch1,,vmwaresvs",
      "xennetworklabel": "Network1"
    },
    {
      "id": "ec058b01-3536-4cf7-94d1-c237eb8a7f6d",
      "isolationmethods": "VLAN",
      "kvmnetworklabel": "cloudbr1",
      "physicalnetworkid": "30346ff3-00f0-4155-98dd-7ebddfe48d85",
      "traffictype": "Public",
      "vmwarenetworklabel": "vSwitch1,,vmwaresvs",
      "xennetworklabel": "Network1"
    }
  ]
}
(localcloud) 🐱 > list traffictypes physicalnetworkid=f39759cd-3fc0-433b-acb8-c24613a9168e 
{
  "count": 2,
  "traffictype": [
    {
      "id": "733e8d2e-bec7-4069-9867-3d5e0000d736",
      "isolationmethods": "VLAN",
      "kvmnetworklabel": "cloudbr0",
      "physicalnetworkid": "f39759cd-3fc0-433b-acb8-c24613a9168e",
      "traffictype": "Management",
      "vmwarenetworklabel": "vSwitch0,,vmwaresvs",
      "xennetworklabel": "Network0"
    },
    {
      "id": "090cf3c5-e7aa-46d4-b13d-c12ed5a59edb",
      "isolationmethods": "VLAN",
      "kvmnetworklabel": "cloudbr0",
      "physicalnetworkid": "f39759cd-3fc0-433b-acb8-c24613a9168e",
      "traffictype": "Storage",
      "vmwarenetworklabel": "vSwitch0,,vmwaresvs",
      "xennetworklabel": "Network0"
    }
  ]
}

@Pearl1594 , it looks like vlan tags are not returned (vlan://51 for public and vlan://untagged for mgmt). Is this good enough like this?

@DaanHoogland
Copy link
Contributor

ping @Pearl1594 , how do you suggest we proceed?

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.

clgtm. E2E test added is also passing.

@Pearl1594
Copy link
Contributor

ping @Pearl1594 , how do you suggest we proceed?

Sorry for the delay @DaanHoogland - I think this is good to merge.

@DaanHoogland DaanHoogland merged commit f985a67 into apache:main Nov 12, 2025
28 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 12, 2025

Awesome work, congrats on your first merged pull request!

ribafish added a commit to ribafish/apache-cloudstack that referenced this pull request Nov 14, 2025
* main: (1223 commits)
  Standardize and auto add license headers for SQL files with pre-commit (apache#12071)
  pre-commit use colored text in the CI for `pass / fail / skipped` (apache#11977)
  ui(locales): remove duplicates and fix typos (apache#11872)
  pre-commit: auto add table of contents with `doctoc` (apache#11679)
  chore: rename workflow `linter.yml` to `pre-commit.yml` (apache#11647)
  engine-schema: upgrade path for 4.23.0 (apache#12048)
  Fixes:apache#7837: Add isolationMethods and vlan to TrafficTypeResponse (apache#8151)
  Svgs (apache#12051)
  Update GUI Kubernetes logo (apache#11895)
  Keeping consistency with other error messages. (apache#11649)
  enhancement: add instance info as Libvirt metadata (apache#11061)
  Add empty Provider value in Network/VPC Offering form (apache#11982)
  merge fix
  Updating pom.xml version numbers for release 4.23.0.0-SNAPSHOT
  Updating pom.xml version numbers for release 4.22.1.0-SNAPSHOT
  UI: fix typo Upload SSL certificate (apache#11869)
  api/test: fix storage pool update with only id (apache#11897)
  Updating pom.xml version numbers for release 4.22.0.0
  Handle null mountTimeout in RestoreBackupCommand (apache#11944)
  Fix the config 'powerflex.connect.on.demand' description (apache#11926)
  ...
@sureshanaparti sureshanaparti added this to the 4.23 milestone Nov 28, 2025
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.

10 participants