Skip to content

API: Fix pagination issue with listing LDAP configuration #11444

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

Draft
wants to merge 2 commits into
base: 4.20
Choose a base branch
from

Conversation

Pearl1594
Copy link
Contributor

Description

This PR fixes issue with pagination when listing ldap configuration. When there are more than 20 entries and we want to list the 2nd page of ldap configs when using page size 20 , it returns the 1st 20 entries always.

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

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?

Copy link

codecov bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.20%. Comparing base (7e04143) to head (41b92dd).
⚠️ Report is 25 commits behind head on 4.20.

Files with missing lines Patch % Lines
.../cloudstack/ldap/dao/LdapConfigurationDaoImpl.java 0.00% 9 Missing ⚠️
.../org/apache/cloudstack/ldap/LdapConfiguration.java 0.00% 1 Missing ⚠️
...va/org/apache/cloudstack/ldap/LdapManagerImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #11444      +/-   ##
============================================
+ Coverage     16.16%   16.20%   +0.04%     
- Complexity    13278    13319      +41     
============================================
  Files          5656     5656              
  Lines        497911   499237    +1326     
  Branches      60383    60933     +550     
============================================
+ Hits          80464    80913     +449     
- Misses       408492   409350     +858     
- Partials       8955     8974      +19     
Flag Coverage Δ
uitests 4.28% <ø> (+0.28%) ⬆️
unittests 17.04% <0.00%> (+0.03%) ⬆️

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.

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 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 ✔️ debian ✔️ suse15. SL-JID 14625

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.

clgtm

@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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_13_retrieve_vr_default_files Error 1.13 test_diagnostics.py
test_14_retrieve_vr_one_file Error 1.13 test_diagnostics.py
test_15_retrieve_ssvm_default_files Error 1.13 test_diagnostics.py
test_16_retrieve_ssvm_single_file Error 1.13 test_diagnostics.py
test_17_retrieve_cpvm_default_files Error 1.14 test_diagnostics.py
test_18_retrieve_cpvm_single_file Error 1.14 test_diagnostics.py

@DaanHoogland DaanHoogland self-requested a review August 15, 2025 08:34
@DaanHoogland
Copy link
Contributor

@pearl, It does not seem to work, I think we must consider the option ro add a uuid to the API/records

@Pearl1594
Copy link
Contributor Author

Seemed to be a UI issue. It works via cmk. Thanks for testing @DaanHoogland

Copy link

@blueorangutan
Copy link

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

@@ -21,7 +21,7 @@
:loading="loading"
:columns="isOrderUpdatable() ? columns : columns.filter(x => x.dataIndex !== 'order')"
:dataSource="items"
:rowKey="(record, idx) => record.id || record.name || record.usageType || idx + '-' + Math.random()"
:rowKey="(record, idx) => hasNoUniqueKey() ? (idx + '-' + Math.random()) : (record.id || record.name || record.usageType || idx + '-' + Math.random())"
Copy link
Contributor

Choose a reason for hiding this comment

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

how about making the key/id be the concatenation of hostnam+”-“+port+”-“+domainid?

Copy link
Member

Choose a reason for hiding this comment

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

good point @DaanHoogland

also, can we create a method for this ? @Pearl1594

@DaanHoogland
Copy link
Contributor

@Pearl1594 , the pagination works but no it reveals new issues, sorting does not work beyond the page we are looking at. I do not consider this a big issues as most installations will not have enormous amounts of ldap configurations, but still it seems like a(nother) justifications for giving ldapconfigurations a proper uuid. That said, lgtm.

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@DaanHoogland DaanHoogland reopened this Aug 18, 2025
@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14077)

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

java code lgtm

@@ -21,7 +21,7 @@
:loading="loading"
:columns="isOrderUpdatable() ? columns : columns.filter(x => x.dataIndex !== 'order')"
:dataSource="items"
:rowKey="(record, idx) => record.id || record.name || record.usageType || idx + '-' + Math.random()"
:rowKey="(record, idx) => hasNoUniqueKey() ? (idx + '-' + Math.random()) : (record.id || record.name || record.usageType || idx + '-' + Math.random())"
Copy link
Member

Choose a reason for hiding this comment

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

good point @DaanHoogland

also, can we create a method for this ? @Pearl1594

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.

5 participants