Skip to content

API: Fix pagination issue with listing LDAP configuration - #11444

Draft
Pearl1594 wants to merge 2 commits into
4.20from
fix-ldapconf-list-pagination
Draft

API: Fix pagination issue with listing LDAP configuration#11444
Pearl1594 wants to merge 2 commits into
4.20from
fix-ldapconf-list-pagination

Conversation

@Pearl1594

Copy link
Copy Markdown
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?

@codecov

codecov Bot commented Aug 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.32%. Comparing base (6136ac9) to head (3546263).

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.32%   16.32%           
- Complexity    13556    13559    +3     
=========================================
  Files          5669     5669           
  Lines        501399   501400    +1     
  Branches      60902    60902           
=========================================
+ Hits          81847    81875   +28     
+ Misses       410390   410355   -35     
- Partials       9162     9170    +8     
Flag Coverage Δ
uitests 4.15% <ø> (+<0.01%) ⬆️
unittests 17.18% <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 Harness.
📢 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.

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@sonarqubecloud

Copy link
Copy Markdown

: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
Copy Markdown
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
Copy Markdown
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does ldap configuration returns any of id, name or usagetype? Won't it automatically fallback to idx + '-' + Math.random()
On qa server, I was getting,

(qaserver) 🐱 > list ldapconfigurations 
{
  "LdapConfiguration": [
    {
      "hostname": "ldap.forumsys.com",
      "port": 389
    }
  ],
  "count": 1
}

@DaanHoogland

Copy link
Copy Markdown
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.

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

java code lgtm

: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
Copy Markdown
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
DaanHoogland force-pushed the fix-ldapconf-list-pagination branch from 41b92dd to 6f432d1 Compare December 12, 2025 09:37
@sonarqubecloud

Copy link
Copy Markdown

@shwstppr shwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

code lgtm

@Pearl1594 can you please check the outstanding comment?

: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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does ldap configuration returns any of id, name or usagetype? Won't it automatically fallback to idx + '-' + Math.random()
On qa server, I was getting,

(qaserver) 🐱 > list ldapconfigurations 
{
  "LdapConfiguration": [
    {
      "hostname": "ldap.forumsys.com",
      "port": 389
    }
  ],
  "count": 1
}

@weizhouapache weizhouapache added this to the 4.20.4 milestone Jun 29, 2026
@DaanHoogland
DaanHoogland force-pushed the fix-ldapconf-list-pagination branch from 6f432d1 to 57f1529 Compare August 4, 2026 07:08
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from blueorangutan Aug 4, 2026
@apache apache deleted a comment from Pearl1594 Aug 4, 2026
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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
Copy Markdown

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

@DaanHoogland

Copy link
Copy Markdown
Contributor

@Pearl1594 , do you need to do more work on this (draft) PR?

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

Test Result Time (s) Test File

@DaanHoogland

Copy link
Copy Markdown
Contributor

@Pearl1594 , this can be marked ready-for-merge right?

@DaanHoogland
DaanHoogland force-pushed the fix-ldapconf-list-pagination branch from 57f1529 to 3546263 Compare August 31, 2026 09:51
@DaanHoogland DaanHoogland moved this from Backlog to Ready in CloudStack Testing Aug 31, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

6 participants