Skip to content
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

Accept a role ID on linking an account to LDAP #8236

Open
wants to merge 3 commits into
base: 4.19
Choose a base branch
from

Conversation

DaanHoogland
Copy link
Contributor

Description

This PR implements #3677

Fixes: #3677

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?

@DaanHoogland
Copy link
Contributor Author

@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.

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (c3b77cb) 18.28% compared to head (f6b76f3) 30.76%.

Files Patch % Lines
...e/cloudstack/api/command/LinkAccountToLdapCmd.java 0.00% 4 Missing ⚠️
...va/org/apache/cloudstack/ldap/LdapManagerImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #8236       +/-   ##
=============================================
+ Coverage     18.28%   30.76%   +12.48%     
- Complexity    16826    33931    +17105     
=============================================
  Files          4848     5341      +493     
  Lines        324301   374976    +50675     
  Branches      45561    54546     +8985     
=============================================
+ Hits          59290   115363    +56073     
+ Misses       256437   244331    -12106     
- Partials       8574    15282     +6708     
Flag Coverage Δ
simulator-marvin-tests 24.64% <0.00%> (+6.36%) ⬆️
uitests 4.39% <ø> (?)
unit-tests 16.49% <0.00%> (?)

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.

@DaanHoogland
Copy link
Contributor Author

@blueorangutan test keepEnv

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
ContextSuite context=TestDeployVM>:setup Error 0.00 test_vm_life_cycle.py
test_01_secure_vm_migration Error 0.02 test_vm_life_cycle.py
test_02_unsecure_vm_migration Error 0.02 test_vm_life_cycle.py
test_03_secured_to_nonsecured_vm_migration Error 0.01 test_vm_life_cycle.py
test_04_nonsecured_to_secured_vm_migration Error 0.01 test_vm_life_cycle.py
ContextSuite context=TestVMLifeCycle>:setup Error 3.05 test_vm_life_cycle.py
ContextSuite context=TestVMSchedule>:setup Error 0.00 test_vm_schedule.py
ContextSuite context=TestVmSnapshot>:setup Error 3.16 test_vm_snapshots.py
test_04_deploy_vnf_appliance Error 93.40 test_vnf_templates.py
test_04_deploy_vnf_appliance Error 93.40 test_vnf_templates.py
test_05_delete_vnf_template Error 1.08 test_vnf_templates.py
ContextSuite context=TestVnfTemplates>:teardown Error 2.19 test_vnf_templates.py
ContextSuite context=TestCreateVolume>:setup Error 0.00 test_volumes.py
test_01_root_volume_encryption Error 0.02 test_volumes.py
test_02_data_volume_encryption Error 0.01 test_volumes.py
test_03_root_and_data_volume_encryption Error 0.01 test_volumes.py
ContextSuite context=TestVolumes>:setup Error 4.34 test_volumes.py
test_01_verify_ipv6_vpc Error 3.33 test_vpc_ipv6.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Error 4.30 test_vpc_redundant.py
test_02_redundant_VPC_default_routes Error 4.20 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Error 4.18 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Error 4.25 test_vpc_redundant.py
test_05_rvpc_multi_tiers Error 4.22 test_vpc_redundant.py
test_01_VPC_nics_after_destroy Error 4.22 test_vpc_router_nics.py
test_02_VPC_default_routes Error 4.19 test_vpc_router_nics.py
test_01_redundant_vpc_site2site_vpn Failure 4.38 test_vpc_vpn.py
test_01_vpc_site2site_vpn_multiple_options Failure 3.37 test_vpc_vpn.py
test_01_vpc_remote_access_vpn Failure 1.18 test_vpc_vpn.py
test_01_vpc_site2site_vpn Failure 3.36 test_vpc_vpn.py
test_01_cancel_host_maintenace_with_no_migration_jobs Error 0.05 test_host_maintenance.py
test_02_cancel_host_maintenace_with_migration_jobs Error 0.04 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 0.05 test_host_maintenance.py
test_01_cancel_host_maintenance_ssh_enabled_agent_connected Error 0.01 test_host_maintenance.py
test_03_cancel_host_maintenance_ssh_disabled_agent_connected Error 0.01 test_host_maintenance.py
test_04_cancel_host_maintenance_ssh_disabled_agent_disconnected Error 0.01 test_host_maintenance.py
test_hostha_enable_ha_when_host_in_maintenance Error 320.30 test_hostha_kvm.py

@DaanHoogland
Copy link
Contributor Author

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

@DaanHoogland
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@DaanHoogland DaanHoogland modified the milestones: 4.20.0.0, 4.19.1.0 Jan 18, 2024
@DaanHoogland DaanHoogland marked this pull request as ready for review January 18, 2024 09:23
@DaanHoogland
Copy link
Contributor Author

@JoaoJandre , this could also go into 4.18.2. borderline enhancement.

Copy link
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

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

CLGTM, didn't test it

@JoaoJandre
Copy link
Contributor

@JoaoJandre , this could also go into 4.18.2. borderline enhancement.

Sure, I don't see a problem with it

@DaanHoogland
Copy link
Contributor Author

DaanHoogland commented Jan 19, 2024

@JoaoJandre , this could also go into 4.18.2. borderline enhancement.

Sure, I don't see a problem with it

/ok, I'll rebase on 4.18/won't backport as 4.18.2 is out already/

@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2024

Codecov Report

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

Project coverage is 14.95%. Comparing base (e409c6d) to head (f06e4f2).
Report is 36 commits behind head on 4.19.

Files Patch % Lines
...e/cloudstack/api/command/LinkAccountToLdapCmd.java 0.00% 6 Missing ⚠️
...va/org/apache/cloudstack/ldap/LdapManagerImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #8236      +/-   ##
============================================
- Coverage     14.96%   14.95%   -0.01%     
+ Complexity    10995    10987       -8     
============================================
  Files          5373     5373              
  Lines        468989   469171     +182     
  Branches      61009    60977      -32     
============================================
- Hits          70191    70182       -9     
- Misses       391019   391221     +202     
+ Partials       7779     7768      -11     
Flag Coverage Δ
uitests 4.30% <ø> (-0.02%) ⬇️
unittests 15.66% <0.00%> (-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.

@DaanHoogland
Copy link
Contributor Author

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

@DaanHoogland
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_01_events_resource Error 408.71 test_events_resource.py

@@ -134,7 +138,14 @@ public String getAdmin() {
}

public Account.Type getAccountType() {
return Account.Type.getFromValue(accountType);
if (accountType == null) {
return RoleType.getAccountTypeByRole(roleService.findRole(roleId), null);
Copy link
Member

Choose a reason for hiding this comment

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

@DaanHoogland This will return null if roleId is null. Is that fine?
@DaanHoogland Do we need some validations around input as well? e.g. both account type & role id can't be null.

}

public Long getRoleId() {
return RoleType.getRoleByAccountType(roleId, getAccountType());
Copy link
Member

Choose a reason for hiding this comment

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

This can be null as well. Is that fine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

linkAccountToLDAP must either use role or account type
6 participants