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

Add conditional depagination by native api, apply to bindings #11215

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

richard-cox
Copy link
Member

@richard-cox richard-cox commented Jun 12, 2024

Summary

Fixes #11024

Occurred changes and/or fixed issues

  • Support conditionally de-paginating resource lists
  • Apply conditional de-pagination to cluster and project bindings. Counts of either over 5000 will mean NO de-pagination happens
  • This will ensure users with an amount of resources that the UI can reasonable fetch and cache... are fetched. For users with too many the current functionality continues (some bindings will be missing)
    • In the next feature release these changes will most probably be reverted and server-side pagination is used instead

Technical notes summary

Main change

  • change depaginate type setting from boolean to boolean | function
  • depaginate function will conditionally return true
  • currently condition only supports a pre-defined count (don't de-paginate if there are too many resources)

In addition / supporting changes

  • fix currentProduct(resource) getter lookups for norman cluster and project roles (they returned cluster instead of rancher, affected by case sensitive type name)
  • fix for some cases where we were creating or viewing norman resources and trying to call steve only fetchResourceFields

Areas or cases that should be tested

Resource Count Expectation
Cluster Bindings under 1k Cluster --> Cluster and Project Roles --> Cluster Tab. All results should show (it should be enough just to check the of X Cluster Memberships in pagination control at bottom)
Cluster Bindings over 1k and under 5k Cluster --> Cluster and Project Roles --> Cluster Tab. All results should show (it should be enough just to check the of X Cluster Memberships in pagination control at bottom)
Cluster Bindings over 5k Cluster --> Cluster and Project Roles --> Cluster Tab. Only 1k results should show (it should be enough just to check the of X Cluster Memberships in pagination control at bottom)
Project Bindings under 1k Cluster --> Cluster and Project Roles --> Project Tab. All results should show (it should be enough just to check the of X Project Memberships in pagination control at bottom)
Project Bindings over 1k and under 5k Cluster --> Cluster and Project Roles --> Project Tab. All results should show (it should be enough just to check the of X Project Memberships in pagination control at bottom)
Project Bindings over 5k Cluster --> Cluster and Project Roles --> Project Tab. Only 1k results should show (it should be enough just to check the of X Project Memberships in pagination control at bottom)

Areas which could experience regressions

  • Create and then view any resource type, no errors in console

Screenshot/Video

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@richard-cox richard-cox added this to the v2.9.0 milestone Jun 12, 2024
@richard-cox richard-cox self-assigned this Jun 12, 2024
We could just set depaginate to true, however this would break management of members both explorer and cluster management side at scale.
Hopefully in 2.10.0 there'll be a permanent fix for this (server-side pagination)


Main change
- change depaginate type setting from boolean to boolean || function
- depaginate function will conditionally be true
- currently condition only supports limited depagination by a pre-defined count

In addition / supporint changes
- fix lookup of norman types settings (case sensative)
- fix currentProduct(resource) lookups for norman cluster and project roles
): conditionalDepaginateFn => {
return (fnArgs: conditionalDepaginateArgs ): boolean => {
const { rootGetters } = fnArgs.ctx;
const { type } = fnArgs.args;
Copy link
Member Author

Choose a reason for hiding this comment

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

remove opt

Copy link
Member

@nwmac nwmac left a comment

Choose a reason for hiding this comment

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

LGTM

@richard-cox richard-cox merged commit bfaf90e into rancher:master Jun 21, 2024
28 checks passed
@richard-cox richard-cox deleted the limit-bindings branch June 21, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cluster Membership fails to show some members when bindings count exceeds 1000
2 participants