cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Allow more generic searches of ACLs

Open DaanHoogland opened this issue 1 year ago • 8 comments

Description

This PR...

Fixes: #8859

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)
  • [x] 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):

How Has This Been Tested?

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

DaanHoogland avatar Aug 22 '24 07:08 DaanHoogland

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 15.77%. Comparing base (f8d8a9c) to head (21f9cbc). Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...a/com/cloud/network/vpc/NetworkACLServiceImpl.java 0.00% 9 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9566      +/-   ##
============================================
- Coverage     15.77%   15.77%   -0.01%     
  Complexity    12542    12542              
============================================
  Files          5623     5623              
  Lines        491611   491619       +8     
  Branches      60012    63123    +3111     
============================================
- Hits          77568    77565       -3     
- Misses       405584   405594      +10     
- Partials       8459     8460       +1     
Flag Coverage Δ
uitests 4.05% <ø> (-0.01%) :arrow_down:
unittests 16.59% <0.00%> (-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.

codecov[bot] avatar Aug 22 '24 07:08 codecov[bot]

@blueorangutan package

DaanHoogland avatar Aug 23 '24 09:08 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 Aug 23 '24 09:08 blueorangutan

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

blueorangutan avatar Aug 23 '24 10:08 blueorangutan

@blueorangutan test

DaanHoogland avatar Aug 23 '24 14:08 DaanHoogland

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

blueorangutan avatar Aug 23 '24 14:08 blueorangutan

[SF] Trillian test result (tid-11162) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 51662 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9566-t11162-kvm-ol8.zip Smoke tests completed. 139 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 Aug 24 '24 05:08 blueorangutan

@kiranchavala that would be a bigger effort, the search is no only for acl item fields. As for account, aclid, domain etc, those are implied (at least in the GUI). things like traffic_type and action, these are enumerals and require a different kind of selection, i.e. they are not free text searchable and hence are left out of scope.

DaanHoogland avatar Aug 26 '24 11:08 DaanHoogland

I manually tested in a local environment.

thanks @bernardodemarco

@DaanHoogland, what do you think about using one of the Ant Design components for the input field?

which one would you like to see implemented?

Regarding the listNetworkACLLists, when executing the API with the keyword parameter, apparently a NPE is not being handled.

(localcloud) 🐱 > list networkacllists vpcid="f9510528-eb2c-405f-b690-21a540c00661" keyword="acl"
🙈 Error: (HTTP 530, error code 4250) Caught error: null

Management server logs:

2024-09-01T16:09:42,439 ERROR [c.c.n.v.d.NetworkACLDaoImpl] (qtp1438988851-385:[ctx-49b0b1cf, ctx-54f34d08]) (logid:d0c03e10) Caught: com.mysql.cj.jdbc.ClientPreparedStatement: SELECT network_acl.id, network_acl.vpc_id, network_acl.uuid, network_acl.name, network_acl.description, network_acl.display FROM network_acl WHERE network_acl.vpc_id IN (1,0)  AND network_acl.display = 1  AND  (network_acl.name LIKE x'2561636c25'  OR network_acl.description LIKE x'2561636c25'  OR )  ORDER BY network_acl.id DESC  LIMIT 0, 500 java.lang.NullPointerException
2024-09-01T16:09:42,439 ERROR [c.c.a.ApiServer] (qtp1438988851-385:[ctx-49b0b1cf, ctx-54f34d08]) (logid:d0c03e10) unhandled exception executing api command: [Ljava.lang.String;@33af317 com.cloud.utils.exception.CloudRuntimeException: Caught error: null

thanks, will have a look

DaanHoogland avatar Sep 02 '24 09:09 DaanHoogland

which one would you like to see implemented?

I believe that the a-input or a-input-search components could be used, what do you think?

bernardodemarco avatar Sep 02 '24 18:09 bernardodemarco

@bernardodemarco took some time (priorities) but updated the PR now.

DaanHoogland avatar Sep 05 '24 16:09 DaanHoogland

@blueorangutan package

DaanHoogland avatar Sep 05 '24 16:09 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 Sep 05 '24 16:09 blueorangutan

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

blueorangutan avatar Sep 05 '24 17:09 blueorangutan

@blueorangutan test

DaanHoogland avatar Sep 05 '24 18:09 DaanHoogland

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

blueorangutan avatar Sep 05 '24 18:09 blueorangutan

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

Test Result Time (s) Test File
test_mount_shared_fs Failure 86.12 test_sharedfs_lifecycle.py
test_resize_shared_fs Error 0.23 test_sharedfs_lifecycle.py
test_01_redundant_vpc_site2site_vpn Failure 442.09 test_vpc_vpn.py

blueorangutan avatar Sep 06 '24 12:09 blueorangutan

@kiranchavala @bernardodemarco is this ok by you? (cc @JoaoJandre )

DaanHoogland avatar Sep 07 '24 12:09 DaanHoogland

@kiranchavala that would be a bigger effort, the search is no only for acl item fields. As for account, aclid, domain etc, those are implied (at least in the GUI). things like traffic_type and action, these are enumerals and require a different kind of selection, i.e. they are not free text searchable and hence are left out of scope.

Thanks @DaanHoogland we can revisit them in future if required

kiranchavala avatar Sep 09 '24 07:09 kiranchavala

@blueorangutan ui

vishesh92 avatar Sep 09 '24 09:09 vishesh92

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

blueorangutan avatar Sep 09 '24 09:09 blueorangutan

UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9566 (QA-JID-442)

blueorangutan avatar Sep 09 '24 09:09 blueorangutan

@blueorangutan package

DaanHoogland avatar Sep 09 '24 12:09 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 Sep 09 '24 12:09 blueorangutan

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

blueorangutan avatar Sep 09 '24 13:09 blueorangutan

@blueorangutan test

DaanHoogland avatar Sep 09 '24 14:09 DaanHoogland

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

blueorangutan avatar Sep 09 '24 14:09 blueorangutan

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

Test Result Time (s) Test File
ContextSuite context=TestVMSchedule>:setup Error 0.00 test_vm_schedule.py
test_01_redundant_vpc_site2site_vpn Failure 742.59 test_vpc_vpn.py
test_01_redundant_vpc_site2site_vpn Error 742.60 test_vpc_vpn.py
ContextSuite context=TestRVPCSite2SiteVpn>:teardown Error 786.18 test_vpc_vpn.py
all_test_vm_life_cycle Skipped --- test_vm_life_cycle.py

blueorangutan avatar Sep 10 '24 09:09 blueorangutan