cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

fix: clean magic value, and update if-else to switch

Open cheng102e opened this issue 1 year ago • 10 comments

Description

This PR...

clean magic value, and update if-else to switch

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

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [ ] Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

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

cheng102e avatar Mar 29 '24 09:03 cheng102e

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:

  • In case of a new feature add useful documentation (raise doc PR at https://github.com/apache/cloudstack-documentation)
  • Be patient and persistent. It might take some time to get a review or get the final approval from the committers.
  • Pay attention to the quality of your code, ensure tests are passing and your PR doesn't have conflicts.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Issues, Mailing list and Slack.
  • Be sure to read the CloudStack Coding Conventions. Apache CloudStack is a community-driven project and together we are making it better 🚀. In case of doubts contact the developers at: Mailing List: [email protected] (https://cloudstack.apache.org/mailing-lists.html) Slack: https://apachecloudstack.slack.com/

boring-cyborg[bot] avatar Mar 29 '24 09:03 boring-cyborg[bot]

@blueorangutan package

DaanHoogland avatar Mar 29 '24 16:03 DaanHoogland

@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 avatar Mar 29 '24 16:03 blueorangutan

Codecov Report

:x: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 31.06%. Comparing base (449ee8e) to head (78fac07). :warning: Report is 1539 commits behind head on main.

Files with missing lines Patch % Lines
...-proxy/rdpconsole/src/main/java/common/Client.java 0.00% 12 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8848      +/-   ##
============================================
- Coverage     31.16%   31.06%   -0.11%     
+ Complexity    34052    33954      -98     
============================================
  Files          5404     5404              
  Lines        380309   380309              
  Branches      55507    55505       -2     
============================================
- Hits         118535   118150     -385     
- Misses       246073   246491     +418     
+ Partials      15701    15668      -33     
Flag Coverage Δ
simulator-marvin-tests 24.80% <0.00%> (-0.14%) :arrow_down:
uitests 4.34% <ø> (ø)
unit-tests 16.88% <ø> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Mar 29 '24 16:03 codecov[bot]

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

blueorangutan avatar Mar 29 '24 17:03 blueorangutan

@blueorangutan test alma9 kvm-alma9

DaanHoogland avatar Apr 02 '24 09:04 DaanHoogland

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

blueorangutan avatar Apr 02 '24 09:04 blueorangutan

suggestion:

use EnumUtils.getEnumIgnoreCase with a default value

weizhouapache avatar Apr 02 '24 10:04 weizhouapache

[SF] Trillian test result (tid-9656) Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9 Total time taken: 53600 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8848-t9656-kvm-alma9.zip Smoke tests completed. 127 look OK, 2 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_enableHumanReadableLogs Error 0.16 test_human_readable_logs.py
test_03_secured_to_nonsecured_vm_migration Error 155.35 test_vm_life_cycle.py
test_04_nonsecured_to_secured_vm_migration Error 274.39 test_vm_life_cycle.py

blueorangutan avatar Apr 03 '24 01:04 blueorangutan

suggestion:

use EnumUtils.getEnumIgnoreCase with a default value

@cheng102e , will you replace the switch statement?

DaanHoogland avatar Apr 03 '24 08:04 DaanHoogland

@blueorangutan package

sureshanaparti avatar Jun 05 '25 10:06 sureshanaparti

@cheng102e , will you still be looking at this (and answer https://github.com/apache/cloudstack/pull/8848#discussion_r1555703046) ?

DaanHoogland avatar Oct 10 '25 08:10 DaanHoogland

@blueorangutan package

sureshanaparti avatar Oct 10 '25 08:10 sureshanaparti

tnx @sureshanaparti , let’s merge and keep the nit in mind.

DaanHoogland avatar Oct 10 '25 08:10 DaanHoogland

@blueorangutan package

DaanHoogland avatar Oct 10 '25 08:10 DaanHoogland

@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 avatar Oct 10 '25 08:10 blueorangutan

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

blueorangutan avatar Oct 10 '25 11:10 blueorangutan

@blueorangutan test

DaanHoogland avatar Oct 10 '25 11:10 DaanHoogland

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

blueorangutan avatar Oct 10 '25 11:10 blueorangutan

[SF] Trillian Build Failed (tid-14620)

blueorangutan avatar Oct 10 '25 12:10 blueorangutan

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

Test Result Time (s) Test File
test_10_reboot_cpvm_forced Error 10.01 test_ssvm.py

blueorangutan avatar Oct 11 '25 08:10 blueorangutan

@blueorangutan package

rosi-shapeblue avatar Oct 14 '25 04:10 rosi-shapeblue

@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 avatar Oct 14 '25 04:10 blueorangutan

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

blueorangutan avatar Oct 14 '25 06:10 blueorangutan

@blueorangutan test

rosi-shapeblue avatar Oct 14 '25 08:10 rosi-shapeblue

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

blueorangutan avatar Oct 14 '25 08:10 blueorangutan

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

Test Result Time (s) Test File

blueorangutan avatar Oct 15 '25 01:10 blueorangutan